1#include "col_names.hpp"
5 CSV_INLINE std::vector<std::string> ColNames::get_col_names()
const {
6 return this->col_names;
9 CSV_INLINE void ColNames::set_col_names(
const std::vector<std::string>&
cnames) {
12 for (
size_t i = 0; i <
cnames.size(); i++) {
13 this->col_pos[
cnames[i]] = i;
19 if (
pos != this->col_pos.end())
20 return (
int)
pos->second;
26 return this->col_names.size();
30 if (i >= this->col_names.size())
31 throw std::out_of_range(
"Column index out of bounds.");
33 return this->col_names[i];
#define CSV_INLINE
Helper macro which should be #defined as "inline" in the single header version.
CSV_CONST CONSTEXPR_17 OutArray arrayToDefault(T &&value)
Helper constexpr function to initialize an array with all the elements set to value.
The all encompassing namespace.
constexpr int CSV_NOT_FOUND
Integer indicating a requested column wasn't found.
nonstd::string_view string_view
The string_view class used by this library.
const std::string & operator[](size_t i) const
Retrieve column name by index.