mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Static Public Member Functions | Data Fields
m::DSVReader::Config Struct Reference

Configuration parameters for importing a DSV file. More...

#include <Reader.hpp>

Collaboration diagram for m::DSVReader::Config:
[legend]

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 = ','
 

‍the delimiter separating cells


 
char quote = '"'
 

‍the quotation mark for strings


 
char escape = '\\'
 

‍the character to escape special characters within strings, e.g. \n


 
bool has_header = false
 

‍whether the first line of the file is a headline describing the columns


 
bool skip_header = false
 

‍whether to ignore the headline (requires has_header = true)


 
std::size_t 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)


 

Detailed Description

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.

Member Function Documentation

◆ CSV()

static Config m::DSVReader::Config::CSV ( )
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().

Field Documentation

◆ delimiter

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()().

◆ escape

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().

◆ has_header

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().

◆ num_rows

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().

◆ quote

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().

◆ skip_header

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().


The documentation for this struct was generated from the following file: