Parses CSV from memory.
More...
#include <PartialCsvParser.hpp>
|
| | 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...
|
| |
| virtual | ~CsvConfig () |
| |
| 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::Memory::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 |
|
) |
| |
|
inline |
Constructor to parse CSV from null-terminated C string.
- Parameters
-
| str_with_null_terminator | CSV string terminated with '\0'. |
| 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. |
| _lazy_initialization | Always set false. |
| PCP::Memory::CsvConfig::CsvConfig |
( |
size_t |
str_length, |
|
|
const char *const |
str, |
|
|
bool |
has_header_line = true, |
|
|
char |
field_terminator = ',', |
|
|
char |
line_terminator = '\n' |
|
) |
| |
|
inline |
Constructor to parse CSV from string with length.
- Parameters
-
| str_length | Length of str. |
| str | CSV string, which is not necessarily terminated with '\0'. |
| 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. |
| virtual PCP::Memory::CsvConfig::~CsvConfig |
( |
| ) |
|
|
inlinevirtual |
| size_t PCP::Memory::CsvConfig::body_offset |
( |
| ) |
const |
|
inline |
Return the offset where CSV body (excluding header line) starts from.
| const char* const PCP::Memory::CsvConfig::content |
( |
| ) |
const |
|
inline |
Return the pointer of CSV content.
| size_t PCP::Memory::CsvConfig::filesize |
( |
| ) |
const |
|
inline |
Return the size of CSV from file.
| const char PCP::Memory::CsvConfig::get_field_terminator |
( |
| ) |
const |
|
inline |
Return a character to separate columns.
| std::vector<std::string> PCP::Memory::CsvConfig::get_headers |
( |
| ) |
const |
|
inline |
Return header string array.
has_header_line flag must be set true in constructor.
| const char PCP::Memory::CsvConfig::get_line_terminator |
( |
| ) |
const |
|
inline |
Return a character to separate rows.
| size_t PCP::Memory::CsvConfig::get_n_columns |
( |
| ) |
const |
|
inline |
Return the number of columns in first line.
| void PCP::Memory::CsvConfig::init |
( |
| ) |
|
|
inlineprotected |
| size_t PCP::Memory::CsvConfig::csv_size |
|
protected |
| const char* PCP::Memory::CsvConfig::csv_text |
|
protected |
| const char PCP::Memory::CsvConfig::field_terminator |
|
protected |
| const bool PCP::Memory::CsvConfig::has_header_line |
|
protected |
| size_t PCP::Memory::CsvConfig::header_length |
|
protected |
| std::vector<std::string> PCP::Memory::CsvConfig::headers |
|
protected |
| const char PCP::Memory::CsvConfig::line_terminator |
|
protected |
| size_t PCP::Memory::CsvConfig::n_columns |
|
protected |
The documentation for this class was generated from the following file: