|
Vince's CSV Parser
|
Abstract base class which provides CSV parsing logic. More...
#include <basic_csv_parser.hpp>
Inherited by csv::internals::MmapParser, and csv::internals::StreamParser< TStream >.
Public Member Functions | |
| IBasicCSVParser (const CSVFormat &, const ColNamesPtr &) | |
| IBasicCSVParser (const ParseFlagMap &parse_flags, const WhitespaceMap &ws_flags) | |
| bool | eof () |
| Whether or not we have reached the end of source. | |
| virtual void | next (size_t bytes)=0 |
| Parse the next block of data. | |
| void | end_feed () |
| Indicate the last block of data has been parsed. | |
| CONSTEXPR_17 ParseFlags | parse_flag (const char ch) const noexcept |
| CONSTEXPR_17 ParseFlags | compound_parse_flag (const char ch) const noexcept |
| CONSTEXPR bool | utf8_bom () const |
| Whether or not this CSV has a UTF-8 byte order mark. | |
| void | set_output (RowCollection &rows) |
Protected Member Functions | |
| CONSTEXPR bool | no_chunk () const |
| Whether or not source needs to be read in chunks. | |
| size_t | parse () |
| Parse the current chunk of data *. | |
| void | reset_data_ptr () |
| Create a new RawCSVDataPtr for a new chunk of data. | |
Protected Attributes | |
Current Parser State | |
| CSVRow | current_row |
| RawCSVDataPtr | data_ptr = nullptr |
| ColNamesPtr | _col_names = nullptr |
| CSVFieldList * | fields = nullptr |
| int | field_start = UNINITIALIZED_FIELD |
| size_t | field_length = 0 |
| ParseFlagMap | _parse_flags |
| An array where the (i + 128)th slot gives the ParseFlags for ASCII character i. | |
Current Stream/File State | |
| bool | _eof = false |
| size_t | source_size = 0 |
| The size of the incoming CSV. | |
Abstract base class which provides CSV parsing logic.
Concrete implementations may customize this logic across different input sources, such as memory mapped files, stringstreams, etc...
Definition at line 90 of file basic_csv_parser.hpp.
| csv::internals::IBasicCSVParser::IBasicCSVParser | ( | const CSVFormat & | format, |
| const ColNamesPtr & | col_names | ||
| ) |
Definition at line 37 of file basic_csv_parser.cpp.
|
inline |
Definition at line 94 of file basic_csv_parser.hpp.
|
inlinevirtual |
Definition at line 97 of file basic_csv_parser.hpp.
|
inlinenoexcept |
Definition at line 112 of file basic_csv_parser.hpp.
| void csv::internals::IBasicCSVParser::end_feed | ( | ) |
Indicate the last block of data has been parsed.
Definition at line 53 of file basic_csv_parser.cpp.
|
inline |
Whether or not we have reached the end of source.
Definition at line 100 of file basic_csv_parser.hpp.
Parse the next block of data.
Implemented in csv::internals::MmapParser, and csv::internals::StreamParser< TStream >.
Whether or not source needs to be read in chunks.
Definition at line 144 of file basic_csv_parser.hpp.
|
protected |
Parse the current chunk of data *.
Definition at line 124 of file basic_csv_parser.cpp.
|
inlinenoexcept |
Definition at line 108 of file basic_csv_parser.hpp.
|
protected |
Create a new RawCSVDataPtr for a new chunk of data.
Definition at line 211 of file basic_csv_parser.cpp.
|
inline |
Definition at line 119 of file basic_csv_parser.hpp.
Whether or not this CSV has a UTF-8 byte order mark.
Definition at line 117 of file basic_csv_parser.hpp.
|
protected |
Definition at line 126 of file basic_csv_parser.hpp.
Definition at line 137 of file basic_csv_parser.hpp.
|
protected |
An array where the (i + 128)th slot gives the ParseFlags for ASCII character i.
Definition at line 132 of file basic_csv_parser.hpp.
|
protected |
Definition at line 124 of file basic_csv_parser.hpp.
|
protected |
Definition at line 125 of file basic_csv_parser.hpp.
|
protected |
Definition at line 129 of file basic_csv_parser.hpp.
|
protected |
Definition at line 128 of file basic_csv_parser.hpp.
|
protected |
Definition at line 127 of file basic_csv_parser.hpp.
|
protected |
The size of the incoming CSV.
Definition at line 140 of file basic_csv_parser.hpp.