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) {
10 this->col_names = cnames;
12 for (
size_t i = 0; i < cnames.size(); i++) {
13 this->col_pos[cnames[i]] = i;
18 auto pos = this->col_pos.find(col_name.data());
19 if (pos != this->col_pos.end())
20 return (
int)pos->second;
25 CSV_INLINE size_t ColNames::size() const noexcept {
26 return this->col_names.size();
#define CSV_INLINE
Helper macro which should be #defined as "inline" in the single header version.
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.