Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
CSVData Struct Reference

#include "lib/stat/csv.hpp"

Description

Wrapper to simplify notation in tests.

Accepts data suitable for representation as CSV

  • either as an std::initializer_list<string> for pre-formatted rows
  • or as a sequence of strings (words) to form a single header line
  • or a list of strings for the header, and then a list of data tuples, which will be rendered into data rows in CSV format Since this wrapper is-a vector<string>, the rows can be retrieved directly and then rendered, or the operator string() can be used to retrieve the complete data set in a single string of data lines.

Definition at line 140 of file csv.hpp.

Public Types

using VecCSV = std::vector< CSVLine >
 

Public Member Functions

 CSVData (std::initializer_list< string > lines)
 
 CSVData (std::initializer_list< string > header, std::initializer_list< CSVLine > data)
 
 operator string () const
 

Static Private Member Functions

static bool containsCSV (string const &line)
 
static void appendHeaderLine (VecCSV &data, std::initializer_list< string > const &input)
 
static VecCSV detectHeader (std::initializer_list< string > input)
 

Constructor & Destructor Documentation

◆ CSVData() [1/2]

CSVData ( std::initializer_list< string >  lines)
inline

Definition at line 145 of file csv.hpp.

◆ CSVData() [2/2]

CSVData ( std::initializer_list< string >  header,
std::initializer_list< CSVLine data 
)
inline

Definition at line 149 of file csv.hpp.

Member Typedef Documentation

◆ VecCSV

using VecCSV = std::vector<CSVLine>

Definition at line 143 of file csv.hpp.

Member Function Documentation

◆ operator string()

operator string ( ) const
inline

Definition at line 161 of file csv.hpp.

◆ containsCSV()

static bool containsCSV ( string const &  line)
inlinestaticprivate

Definition at line 172 of file csv.hpp.

◆ appendHeaderLine()

static void appendHeaderLine ( VecCSV data,
std::initializer_list< string > const &  input 
)
inlinestaticprivate

Definition at line 178 of file csv.hpp.

◆ detectHeader()

static VecCSV detectHeader ( std::initializer_list< string >  input)
inlinestaticprivate

Definition at line 187 of file csv.hpp.

+ Inheritance diagram for CSVData:
+ Collaboration diagram for CSVData:

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