GEOS
Public Member Functions | List of all members
geos::TableTextFormatter Class Referencefinal

class for log formatting More...

#include <TableFormatter.hpp>

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

Public Member Functions

 TableTextFormatter ()
 Construct a default Table Formatter without layout specification (to only insert data in it, without any column / title). Feature is not tested.
 
 TableTextFormatter (TableLayout const &tableLayout)
 Construct a new TableFormatter from a tableLayout. More...
 
string toString () const
 
template<typename DATASOURCE >
string toString (DATASOURCE const &tableData) const
 Convert a data source to a table string. More...
 
void toStream (std::ostream &outputStream) const
 Output the formatted data to a stream. Adds appropriate messages to the error list when the operation fails. More...
 
template<typename DATASOURCE >
void toStream (std::ostream &outputStream, DATASOURCE const &tableData) const
 Output the formatted data to a stream. Adds appropriate messages to the error list when the operation fails. More...
 
template<>
string toString (TableData const &tableData) const
 Convert a TableData to a table string. More...
 
template<>
string toString (TableFunction const &tableData) const
 Template specialisation to convert a TableFunction to a CSV string. More...
 
- Public Member Functions inherited from geos::TableFormatter
TableErrorListinggetErrorsList () const
 

Additional Inherited Members

- Public Types inherited from geos::TableFormatter
using RowsCellInput = stdVector< stdVector< TableData::CellData > >
 Represent the TableData values.
 
using CellLayoutRows = stdVector< CellLayoutRow >
 Represent a table section (title + header or values) layout: view on the data and its layout settings.
 
- Protected Member Functions inherited from geos::TableFormatter
 TableFormatter ()
 Construct a default Table Formatter without layout specification (to only insert data in it, without any column / title). Feature is not tested.
 
 TableFormatter (TableLayout const &tableLayout)
 Construct a new Table Formatter from a tableLayout. More...
 
void toStreamImpl (std::ostream &outputStream, string_view content) const
 Implements the actual writing of content to an output stream. Adds appropriate messages to the error list when the operation fails. More...
 
- Protected Attributes inherited from geos::TableFormatter
PreparedTableLayout const m_tableLayout
 Layout for a table.
 
std::unique_ptr< geos::TableErrorListingm_errors = std::make_unique< geos::TableErrorListing >()
 Class used for listing all errors that may have occured during table generation.
 

Detailed Description

class for log formatting

Definition at line 194 of file TableFormatter.hpp.

Constructor & Destructor Documentation

◆ TableTextFormatter()

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

Construct a new TableFormatter from a tableLayout.

Parameters
tableLayoutContain all tableColumnData names and optionnaly the table title

Member Function Documentation

◆ toStream() [1/2]

void geos::TableTextFormatter::toStream ( std::ostream &  outputStream) const
inline

Output the formatted data to a stream. Adds appropriate messages to the error list when the operation fails.

See also
toString()
Parameters
outputStreamThe stream to write the content to.

Definition at line 232 of file TableFormatter.hpp.

◆ toStream() [2/2]

template<typename DATASOURCE >
void geos::TableTextFormatter::toStream ( std::ostream &  outputStream,
DATASOURCE const &  tableData 
) const
inline

Output the formatted data to a stream. Adds appropriate messages to the error list when the operation fails.

See also
toString( DATASOURCE const & tableData )
Template Parameters
DATASOURCEThe type of the source to convert
Parameters
tableDataThe data source to convert.
outputStreamThe stream to write the content to.

Definition at line 243 of file TableFormatter.hpp.

◆ toString() [1/4]

string geos::TableTextFormatter::toString ( ) const
Returns
A TableLayout string representation, The TableTextFormatter receives hasn't received any data, so only the header part is returned.

◆ toString() [2/4]

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

Convert a data source to a table string.

Template Parameters
DATASOURCEThe type of the source to convert
Parameters
tableDataThe data source to convert.
Returns
The table string representation of the TableData.

◆ toString() [3/4]

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

Convert a TableData to a table string.

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

◆ toString() [4/4]

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

Template specialisation to convert a TableFunction to a CSV string.

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

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