Class to format data in a formatted text format (for log output typically, expecting fixed character size).
More...
#include <TableFormatter.hpp>
|
| void | initalizeTableGrids (PreparedTableLayout const &tableLayout, TableData const &tableData, CellLayoutRows &dataCellsLayout, CellLayoutRows &headerCellsLayout, CellLayoutRows &errorCellsLayout, size_t &tableTotalWidth, ColumnWidthModifier columnWidthModifier) const |
| | Initializes the table layout with the given table data and prepares necessary layouts for headers and data cells. More...
|
| |
| void | outputTableHeader (std::ostream &tableOutput, PreparedTableLayout const &tableLayout, CellLayoutRows const &headerCellsLayout, string_view separatorLine) const |
| | Outputs the top part of the formatted table to the provided output stream. More...
|
| |
| void | outputTableData (std::ostream &tableOutput, PreparedTableLayout const &tableLayout, CellLayoutRows const &dataCellsLayout) const |
| | Outputs the data part of the formatted table to the provided output stream. More...
|
| |
| void | outputTableFooter (std::ostream &tableOutput, PreparedTableLayout const &tableLayout, CellLayoutRows &errorCellsLayout, string_view separatorLine, bool hasData) const |
| | Outputs the bottom part of the formatted table to the provided output stream. More...
|
| |
|
| 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...
|
| |
Class to format data in a formatted text format (for log output typically, expecting fixed character size).
Definition at line 195 of file TableFormatter.hpp.
◆ TableTextFormatter()
| geos::TableTextFormatter::TableTextFormatter |
( |
TableLayout const & |
tableLayout | ) |
|
Construct a new TableFormatter from a tableLayout.
- Parameters
-
| tableLayout | Contain all tableColumnData names and optionnaly the table title |
◆ initalizeTableGrids()
Initializes the table layout with the given table data and prepares necessary layouts for headers and data cells.
- Parameters
-
| tableLayout | A reference to the TableLayout object. |
| tableData | A constant reference to the TableData object, which contains the actual data for the table. |
| headerCellsLayout | A reference to a CellLayoutRows where the header cells will be populated. |
| dataCellsLayout | A reference to a CellLayoutRows where the data cells will be populated. |
| errorCellsLayout | A reference to a CellLayoutRows where the error cells will be populated. |
| tableTotalWidth | A string that will be used as the table separator line |
| columnWidthModifier | A functor which allow to customize the columns width after their computation. |
◆ outputTableData()
Outputs the data part of the formatted table to the provided output stream.
- Parameters
-
| tableOutput | A reference to an std::ostream where the formatted table will be written. |
| tableLayout | The layout of the table |
| dataCellsLayout | The data rows in a grid layout |
◆ outputTableFooter()
Outputs the bottom part of the formatted table to the provided output stream.
- Parameters
-
| tableOutput | A reference to an std::ostream where the formatted table will be written. |
| tableLayout | The layout of the table |
| separatorLine | A string that will be used as the table separator line |
| errorCellsLayout | The layout of the error rows |
| hasData | Indicates whether there is data in the table TableData. |
◆ outputTableHeader()
Outputs the top part of the formatted table to the provided output stream.
- Parameters
-
| tableOutput | A reference to an std::ostream where the formatted table will be written. |
| tableLayout | The layout of the table |
| headerCellsLayout | The header rows in a grid layout |
| separatorLine | A string that will be used as the table separator line |
◆ 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
-
| outputStream | The stream to write the content to. |
Definition at line 233 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
-
| DATASOURCE | The type of the source to convert |
- Parameters
-
| tableData | The data source to convert. |
| outputStream | The stream to write the content to. |
Definition at line 244 of file TableFormatter.hpp.
◆ toString() [1/4]
| string geos::TableTextFormatter::toString |
( |
| ) |
const |
◆ toString() [2/4]
template<typename DATASOURCE >
| string geos::TableTextFormatter::toString |
( |
DATASOURCE const & |
tableData | ) |
const |
Convert a data source to a table string.
- Template Parameters
-
| DATASOURCE | The type of the source to convert |
- Parameters
-
| tableData | The 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
-
- Returns
- The table string representation of the TableData.
◆ toString() [4/4]
Template specialisation to convert a TableFunction to a CSV string.
- Parameters
-
- Returns
- The CSV string representation of the TableFunction.
The documentation for this class was generated from the following files: