Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Encoding and decoding of data into CSV format.
The sequence of values transformed here is part of a data table, with columns holding data of various primitive value types; persisted CSV data is human readable, can be checked into Git and loaded into various spreadsheet and statistics applications.
Even while there is a standard defined in RFC 4180, a plethora of format variations can be found in the wild. Since the primary purpose of this implementation is to read back our own data, by deliberate choice only one single form of CSV is accepted.
Definition in file csv.hpp.
#include "lib/error.hpp"
#include "lib/null-value.hpp"
#include "lib/meta/tuple-helper.hpp"
#include "lib/format-string.hpp"
#include "lib/regex.hpp"
#include <limits>
#include <string>
#include <vector>
Classes | |
struct | CSVData |
Wrapper to simplify notation in tests. More... | |
struct | CSVLine |
A string with the ability to construct or append the CSV-rendering of data fields. More... | |
class | CsvParser |
Parser to split one line of CSV data into fields. More... | |
Functions | |
template<typename VAL > | |
void | appendCsvField (string &csv, VAL const &val) |
Format and append a data value to a CSV string representation. | |
template<typename VAL > | |
string | format4Csv (VAL const &val) |
template<typename TAR > | |
TAR | parseAs (string const &encodedVal) |
parse string representation into typed value | |
template<> | |
bool | parseAs (string const &encodedBool) |
template<> | |
string | parseAs (string const &string) |
Namespaces | |
lib | |
Implementation namespace for support and library code. | |