Vince's CSV Parser
CSV Parser Internals

Internals of CSVReader. More...

Functions

void csv::CSVReader::set_col_names (const std::vector< std::string > &)
 Sets this reader's column names and associated data. More...
 

CSV Settings

CSVFormat csv::CSVReader::_format
 

Parser State

internals::ColNamesPtr csv::CSVReader::col_names = std::make_shared<internals::ColNames>()
 Pointer to a object containing column information.
 
std::unique_ptr< internals::IBasicCSVParsercsv::CSVReader::parser = nullptr
 Helper class which actually does the parsing.
 
std::unique_ptr< RowCollectioncsv::CSVReader::records {new RowCollection(100)}
 Queue of parsed CSV rows.
 
size_t csv::CSVReader::n_cols = 0
 The number of columns in this CSV.
 
size_t csv::CSVReader::_n_rows = 0
 How many rows (minus header) have been read so far.
 

Multi-Threaded File Reading Functions

bool csv::CSVReader::read_csv (size_t bytes=internals::ITERATION_CHUNK_SIZE)
 Read a chunk of CSV data. More...
 

Detailed Description

Internals of CSVReader.

Only maintainers and those looking to extend the parser should read this.

Function Documentation

◆ read_csv()

bool csv::CSVReader::read_csv ( size_t  bytes = internals::ITERATION_CHUNK_SIZE)
protected

Read a chunk of CSV data.

Note
This method is meant to be run on its own thread. Only one read_csv() thread should be active at a time.
Parameters
[in]bytesNumber of bytes to read.
See also
CSVReader::read_csv_worker
CSVReader::read_row()

Definition at line 241 of file csv_reader.cpp.

◆ set_col_names()

void csv::CSVReader::set_col_names ( const std::vector< std::string > &  names)
protected

Sets this reader's column names and associated data.

Parameters
[in]namesColumn names

Definition at line 224 of file csv_reader.cpp.