4 #include "csv_utility.hpp"
15 std::stringstream stream(in.data());
27 return parse(in, format);
67 for (
auto it = reader.
begin(); it != reader.
end(); ++it);
Main class for parsing CSVs from files and in-memory sources.
CSVFormat get_format() const
Return the format of the original raw CSV.
int index_of(csv::string_view col_name) const
Return the index of the column name if found or csv::CSV_NOT_FOUND otherwise.
HEDLEY_CONST iterator end() const noexcept
A placeholder for the imaginary past the end row in a CSV.
CONSTEXPR size_t n_rows() const noexcept
Retrieves the number of rows that have been read so far.
std::vector< std::string > get_col_names() const
Return the CSV's column names as a vector of strings.
iterator begin()
Return an iterator to the first row in the reader.
#define CSV_INLINE
Helper macro which should be #defined as "inline" in the single header version.
The all encompassing namespace.
int get_col_pos(csv::string_view filename, csv::string_view col_name, const CSVFormat &format)
Find the position of a column in a CSV file or CSV_NOT_FOUND otherwise.
CSVFileInfo get_file_info(const std::string &filename)
Get basic information about a CSV file.
CSVReader parse(csv::string_view in, CSVFormat format)
Shorthand function for parsing an in-memory CSV string.
CSVReader parse_no_header(csv::string_view in)
Parses a CSV string with no headers.
nonstd::string_view string_view
The string_view class used by this library.
Returned by get_file_info()