20 #ifndef GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP
21 #define GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP
25 #include "TableTypes.hpp"
38 using RowsCellInput = std::vector< std::vector< TableData::CellData > >;
44 std::vector< TableLayout::CellLayout >
cells;
111 template<
typename DATASOURCE >
112 string toString( DATASOURCE
const & tableData )
const;
122 string TableCSVFormatter::toString< TableData >(
TableData const & tableData )
const;
157 template<
typename DATASOURCE >
158 string toString( DATASOURCE
const & tableData )
const;
163 static constexpr
char m_verticalLine =
'|';
165 static constexpr
char m_horizontalLine =
'-';
180 size_t & tableTotalWidth )
const;
191 std::ostringstream & tableOutput,
194 size_t tableTotalWidth )
const;
218 size_t inputDataColumnsCount )
const;
239 size_t nbVisibleColumn )
const;
246 void stretchColumnsByCellsWidth( std::vector< size_t > & columnsWidth,
258 void stretchColumnsByMergedCellsWidth( std::vector< size_t > & columnsWidth,
261 bool const compress )
const;
269 void applyColumnsWidth( std::vector< size_t >
const & columnsWidth,
281 void formatCell( std::ostringstream & tableOutput,
283 size_t idxLine )
const;
296 std::ostringstream & tableOutput )
const;
305 string TableTextFormatter::toString< TableData >(
TableData const & tableData )
const;
Variation of the TableLayout to store precomputed layout information, ready to be formatted.
Class for managing table data.
View on cell data with information to display it in a table (content, type, alignment,...
Class for setup the table layout.
TableTextFormatter()
Construct a default Table Formatter without layout specification (to only insert data in it,...
TableTextFormatter(TableLayout const &tableLayout)
Construct a new TableFormatter from a tableLayout.
string toString(DATASOURCE const &tableData) const
Convert a data source to a table string.