|
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) | |
| std::vector< std::string > | get_col_names () const |
| 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 23 of file col_names.hpp.
|
inline |
Definition at line 26 of file col_names.hpp.
|
inlinenoexcept |
Definition at line 39 of file col_names.hpp.
| std::vector< std::string > csv::internals::ColNames::get_col_names | ( | ) | const |
Definition at line 7 of file col_names.cpp.
| int csv::internals::ColNames::index_of | ( | csv::string_view | col_name | ) | const |
Definition at line 29 of file col_names.cpp.
Retrieve column name by index.
Throws if index is out of bounds.
Definition at line 55 of file col_names.cpp.
Definition at line 11 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 47 of file col_names.cpp.
|
noexcept |
Definition at line 51 of file col_names.cpp.