Vince's CSV Parser
Loading...
Searching...
No Matches
csv::internals::ColNames Struct Reference

A data structure for handling column name information. More...

#include <col_names.hpp>

Public Member Functions

 ColNames (const std::vector< std::string > &names)
 
std::vector< std::string > get_col_names () const
 
void set_col_names (const std::vector< std::string > &)
 
int index_of (csv::string_view) const
 
bool empty () const noexcept
 
size_t size () const noexcept
 
const std::string & operator[] (size_t i) const
 Retrieve column name by index.
 

Detailed Description

A data structure for handling column name information.

These are created by CSVReader and passed (via smart pointer) to CSVRow objects it creates, thus allowing for indexing by column name.

Definition at line 22 of file col_names.hpp.

Constructor & Destructor Documentation

◆ ColNames()

csv::internals::ColNames::ColNames ( const std::vector< std::string > &  names)
inline

Definition at line 25 of file col_names.hpp.

Member Function Documentation

◆ empty()

bool csv::internals::ColNames::empty ( ) const
inlinenoexcept

Definition at line 33 of file col_names.hpp.

◆ get_col_names()

std::vector< std::string > csv::internals::ColNames::get_col_names ( ) const

Definition at line 5 of file col_names.cpp.

◆ index_of()

int csv::internals::ColNames::index_of ( csv::string_view  col_name) const

Definition at line 17 of file col_names.cpp.

◆ operator[]()

const std::string & csv::internals::ColNames::operator[] ( size_t  i) const

Retrieve column name by index.

Throws if index is out of bounds.

Definition at line 29 of file col_names.cpp.

◆ set_col_names()

void csv::internals::ColNames::set_col_names ( const std::vector< std::string > &  cnames)

Definition at line 9 of file col_names.cpp.

◆ size()

size_t csv::internals::ColNames::size ( ) const
noexcept

Definition at line 25 of file col_names.cpp.


The documentation for this struct was generated from the following files: