Vince's CSV Parser
Loading...
Searching...
No Matches
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.
 

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::parser::CSVParserDriverBase > csv::CSVReader::parser = nullptr
 Helper class which actually does the parsing.
 
std::unique_ptr< RowCollection > csv::CSVReader::records {new RowCollection(100)}
 Queue of parsed CSV rows.
 
std::unique_ptr< std::istream > csv::CSVReader::owned_stream = nullptr
 Optional owned stream used by two paths: 1) Emscripten filename-constructor fallback to stream parsing 2) Opt-in ownership constructor taking std::unique_ptr<std::istream>
 
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.
 

Worker Reading Functions

Functions that actively drive parser execution and produce rows.

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

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::CSV_CHUNK_SIZE_DEFAULT)
protected

Read a chunk of CSV data.

Note
This method may run on a worker thread or synchronously on the caller thread when CSVFormat::threading(false) is active. Only one read_csv() invocation should be active at a time.
See also
csv::internals::CSVReadScheduler
CSVReader::read_row()

Definition at line 164 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.

Install the active column names for this reader.

Definition at line 90 of file csv_reader.cpp.

Variable Documentation

◆ _format

CSVFormat csv::CSVReader::_format
protected

Definition at line 335 of file csv_reader.hpp.

◆ _n_rows

size_t csv::CSVReader::_n_rows = 0
protected

How many rows (minus header) have been read so far.

Definition at line 357 of file csv_reader.hpp.

◆ col_names

internals::ColNamesPtr csv::CSVReader::col_names = std::make_shared<internals::ColNames>()
protected

Pointer to a object containing column information.

Definition at line 341 of file csv_reader.hpp.

◆ n_cols

size_t csv::CSVReader::n_cols = 0
protected

The number of columns in this CSV.

Definition at line 356 of file csv_reader.hpp.

◆ owned_stream

std::unique_ptr<std::istream> csv::CSVReader::owned_stream = nullptr
protected

Optional owned stream used by two paths: 1) Emscripten filename-constructor fallback to stream parsing 2) Opt-in ownership constructor taking std::unique_ptr<std::istream>

Definition at line 354 of file csv_reader.hpp.

◆ parser

std::unique_ptr<internals::parser::CSVParserDriverBase> csv::CSVReader::parser = nullptr
protected

Helper class which actually does the parsing.

Definition at line 344 of file csv_reader.hpp.

◆ records

std::unique_ptr<RowCollection> csv::CSVReader::records {new RowCollection(100)}
protected

Queue of parsed CSV rows.

Definition at line 347 of file csv_reader.hpp.