CSV Parser

template <typename _Handler>
class

Inherits from orcus::csv::parser_base

Public Types

typedef

Public Functions

orcus::csv_parser::csv_parser(const char *p, size_t n, handler_type &hdl, const csv::parser_config &config)
void orcus::csv_parser::parse()
struct

Run-time configuration object for orcus::csv_parser.

Public Functions

orcus::csv::parser_config::parser_config()

Public Members

std::string orcus::csv::parser_config::delimiters

One or more characters that serve as cell boundaries.

char orcus::csv::parser_config::text_qualifier

A single character used as a text quote value.

bool orcus::csv::parser_config::trim_cell_value

When true, the value of each cell gets trimmed i.e. any leading or trailing white spaces will get ignored.

Parser Handler

class

Public Functions

void csv_parser_handler::begin_parse()

Called when the parser starts parsing a stream.

void csv_parser_handler::end_parse()

Called when the parser finishes parsing a stream.

void csv_parser_handler::begin_row()

Called at the beginning of every row.

void csv_parser_handler::end_row()

Called at the end of every row.

void csv_parser_handler::cell(const char *p, size_t n)

Called after every cell is parsed.

Parameters
  • p: pointer to the first character of a cell content.
  • n: number of characters the cell content consists of.