GEOS
Public Member Functions | List of all members
geos::TableCSVFormatter Class Reference

class for CSV formatting More...

#include <TableFormatter.hpp>

Inheritance diagram for geos::TableCSVFormatter:
Inheritance graph
[legend]

Public Member Functions

 TableCSVFormatter ()
 Construct a new Table Formatter.
 
 TableCSVFormatter (TableLayout const &tableLayout)
 Construct a new Table Formatter from a tableLayout. More...
 
virtual ~TableCSVFormatter ()=default
 Destroy the TableCSVFormatter object.
 
string headerToString () const
 
string dataToString (TableData const &tableData) const
 Convert the table data to a CSV string. More...
 
template<typename DATASOURCE >
string toString (DATASOURCE const &tableData) const
 Convert a data source to a CSV string. More...
 
template<>
string toString (TableData const &tableData) const
 Convert the TableData to a CSV string. More...
 
template<>
string toString (TableFunction const &tableData) const
 Template specialisation to convert a TableFunction to a table string. More...
 

Additional Inherited Members

- Protected Member Functions inherited from geos::TableFormatter
 TableFormatter (TableLayout const &tableLayout)
 Construct a new Table Formatter from a tableLayout. More...
 
virtual ~TableFormatter ()=default
 Destroy the Table Formatter object.
 
- Protected Attributes inherited from geos::TableFormatter
TableLayout m_tableLayout
 Layout for a table.
 

Detailed Description

class for CSV formatting

Definition at line 57 of file TableFormatter.hpp.

Constructor & Destructor Documentation

◆ TableCSVFormatter()

geos::TableCSVFormatter::TableCSVFormatter ( TableLayout const &  tableLayout)

Construct a new Table Formatter from a tableLayout.

Parameters
tableLayoutContain all column names and optionnaly the table title

Member Function Documentation

◆ dataToString()

string geos::TableCSVFormatter::dataToString ( TableData const &  tableData) const

Convert the table data to a CSV string.

Parameters
tableDataThe 1D table data.
Returns
The CSV string representation of the table data.

◆ headerToString()

string geos::TableCSVFormatter::headerToString ( ) const
Returns
The string with all column names.

◆ toString() [1/3]

template<typename DATASOURCE >
string geos::TableCSVFormatter::toString ( DATASOURCE const &  tableData) const

Convert a data source to a CSV string.

Template Parameters
DATASOURCEThe source to convert
Parameters
tableDataThe data source to convert
Returns
The CSV string representation of a data source.

◆ toString() [2/3]

template<>
string geos::TableCSVFormatter::toString ( TableData const &  tableData) const

Convert the TableData to a CSV string.

Parameters
tableDataThe TableData to convert.
Returns
The CSV string representation of the TableData.

◆ toString() [3/3]

template<>
string geos::TableCSVFormatter::toString ( TableFunction const &  tableData) const

Template specialisation to convert a TableFunction to a table string.

Parameters
tableDataThe TableFunction object to convert.
Returns
The table string representation of the TableFunction.

The documentation for this class was generated from the following files: