|
Vince's CSV Parser
|
A data structure for handling column name information. More...
#include <col_names.hpp>
Public Member Functions | |
| ColNames (const std::vector< std::string > &names) | |
| const std::vector< std::string > & | get_col_names () const noexcept |
| void | set_col_names (const std::vector< std::string > &) |
| int | index_of (csv::string_view) const |
| void | set_policy (csv::ColumnNamePolicy policy) |
| Sets the column name lookup policy. | |
| bool | empty () const noexcept |
| size_t | size () const noexcept |
| const std::string & | operator[] (size_t i) const |
| Retrieve column name by index. | |
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 24 of file col_names.hpp.
|
inline |
Definition at line 27 of file col_names.hpp.
|
inlinenoexcept |
Definition at line 40 of file col_names.hpp.
|
noexcept |
Definition at line 8 of file col_names.cpp.
| int csv::internals::ColNames::index_of | ( | csv::string_view | col_name | ) | const |
Definition at line 30 of file col_names.cpp.
| 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 51 of file col_names.cpp.
| void csv::internals::ColNames::set_col_names | ( | const std::vector< std::string > & | cnames | ) |
Definition at line 12 of file col_names.cpp.
| void csv::internals::ColNames::set_policy | ( | csv::ColumnNamePolicy | policy | ) |
Sets the column name lookup policy.
Must be called before set_col_names() for CI policy to take effect.
Definition at line 43 of file col_names.cpp.
|
noexcept |
Definition at line 47 of file col_names.cpp.