Parses CSV file.
More...
#include <PartialCsvParser.hpp>
|
| CsvConfig (const char *const filepath, bool has_header_line=true, char field_terminator= ',', char line_terminator= '\n') throw (PCPError) |
| Constructor. More...
|
|
| ~CsvConfig () |
|
| CsvConfig (const char *const str_with_null_terminator, bool has_header_line=true, char field_terminator= ',', char line_terminator= '\n', bool _lazy_initialization=false) |
| Constructor to parse CSV from null-terminated C string. More...
|
|
| CsvConfig (size_t str_length, const char *const str, bool has_header_line=true, char field_terminator= ',', char line_terminator= '\n') |
| Constructor to parse CSV from string with length. More...
|
|
size_t | filesize () const |
| Return the size of CSV from file. More...
|
|
const char *const | content () const |
| Return the pointer of CSV content. More...
|
|
size_t | get_n_columns () const |
| Return the number of columns in first line. More...
|
|
size_t | body_offset () const |
| Return the offset where CSV body (excluding header line) starts from. More...
|
|
std::vector< std::string > | get_headers () const |
| Return header string array. More...
|
|
const char | get_field_terminator () const |
| Return a character to separate columns. More...
|
|
const char | get_line_terminator () const |
| Return a character to separate rows. More...
|
|
PCP::CsvConfig::CsvConfig |
( |
const char *const |
filepath, |
|
|
bool |
has_header_line = true , |
|
|
char |
field_terminator = ',' , |
|
|
char |
line_terminator = '\n' |
|
) |
| |
throw | ( | PCPError |
| ) | | |
|
inline |
Constructor.
- Parameters
-
filepath | Path to CSV file to read. |
has_header_line | If CSV file has header at first line, set true. |
field_terminator | Character to separate columns. For UTF-8 compatibility, only 0 ~ 127 are allowed. |
line_terminator | Character to separate rows. For UTF-8 compatibility, only 0 ~ 127 are allowed. |
PCP::CsvConfig::~CsvConfig |
( |
| ) |
|
|
inlinevirtual |
The documentation for this class was generated from the following file: