![]() |
mutable
A Database System for Research and Fast Prototyping
|
Configuration parameters for importing a DSV file. More...
#include <Reader.hpp>
Static Public Member Functions | |
static Config | CSV () |
Creates a Config for CSV files, with delimiter , escape , and quote set accordingly to RFC 4180 (see https://www.rfc-editor.org/rfc/rfc4180 ). | |
Data Fields | |
char | delimiter = ',' |
| |
char | quote = '"' |
| |
char | escape = '\\' |
| |
bool | has_header = false |
| |
bool | skip_header = false |
| |
std::size_t | num_rows = std::numeric_limits<decltype(num_rows)>::max() |
| |
Configuration parameters for importing a DSV file.
By deault, the Config
uses the following settings:
Type | Symbol |
---|---|
delimiter | , (comma) |
quote | " (double quote) |
escape | \\ (backslash) |
These settings can be overwritten manually after construction of a Config
instance. Alternatively, Config
provides factory methods for common file formats, e.g. CSV()
.
Definition at line 44 of file Reader.hpp.
|
inlinestatic |
Creates a Config
for CSV files, with delimiter
, escape
, and quote
set accordingly to RFC 4180 (see https://www.rfc-editor.org/rfc/rfc4180 ).
Definition at line 61 of file Reader.hpp.
References delimiter, escape, and quote.
Referenced by m::load_from_CSV().
char m::DSVReader::Config::delimiter = ',' |
the delimiter separating cells
Definition at line 47 of file Reader.hpp.
Referenced by CSV(), m::DSVReader::delimiter(), m::execute_statement(), and m::DSVReader::operator()().
char m::DSVReader::Config::escape = '\\' |
the character to escape special characters within strings, e.g.
\n
Definition at line 51 of file Reader.hpp.
Referenced by CSV(), m::DSVReader::escape(), and m::execute_statement().
bool m::DSVReader::Config::has_header = false |
whether the first line of the file is a headline describing the columns
Definition at line 53 of file Reader.hpp.
Referenced by m::execute_statement(), and m::DSVReader::has_header().
std::size_t m::DSVReader::Config::num_rows = std::numeric_limits<decltype(num_rows)>::max() |
the maximum number of rows to read from the file (may exceed actual number of rows)
Definition at line 57 of file Reader.hpp.
Referenced by m::execute_statement(), and m::DSVReader::num_rows().
char m::DSVReader::Config::quote = '"' |
the quotation mark for strings
Definition at line 49 of file Reader.hpp.
Referenced by CSV(), m::execute_statement(), m::DSVReader::operator()(), and m::DSVReader::quote().
bool m::DSVReader::Config::skip_header = false |
whether to ignore the headline (requires
has_header = true
)
Definition at line 55 of file Reader.hpp.
Referenced by m::execute_statement(), and m::DSVReader::skip_header().