9 #include <unordered_map>
25 CSVReader operator ""_csv(
const char*,
size_t);
26 CSVReader operator ""_csv_no_header(
const char*,
size_t);
33 std::unordered_map<std::string, DataType>
csv_data_types(
const std::string&);
Main class for parsing CSVs from files and in-memory sources.
A standalone header file containing shared code.
Defines functionality needed for basic CSV parsing.
Implements data type parsing functionality.
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.
std::unordered_map< std::string, DataType > csv_data_types(const std::string &filename)
Useful for uploading CSV files to SQL databases.
nonstd::string_view string_view
The string_view class used by this library.
Returned by get_file_info()
size_t n_cols
Number of columns in a CSV.
std::vector< std::string > col_names
CSV column names.
char delim
Delimiting character.
std::string filename
Filename.
size_t n_rows
Number of rows in a file.