20 #ifndef GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP
21 #define GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP
25 #include "TableTypes.hpp"
65 std::unique_ptr< geos::TableErrorListing >
m_errors = std::make_unique< geos::TableErrorListing >();
138 template<
typename DATASOURCE >
139 string toString( DATASOURCE
const & tableData )
const;
165 template<
typename DATASOURCE >
166 void toStream( std::ostream & outputStream, DATASOURCE
const & tableData )
const
174 { m_showErrors = cond; }
178 bool m_showErrors =
true;
188 string TableCSVFormatter::toString< TableData >(
TableData const & tableData )
const;
225 template<
typename DATASOURCE >
226 string toString( DATASOURCE
const & tableData )
const;
243 template<
typename DATASOURCE >
244 void toStream( std::ostream & outputStream, DATASOURCE
const & tableData )
const
272 size_t & tableTotalWidth,
309 bool hasData )
const;
321 std::ostream & tableOutput )
const;
331 std::ostream & tableOutput )
const;
342 size_t nbVisibleColumn )
const;
357 size_t nbVisibleColumn )
const;
367 size_t const nbVisibleColumn )
const;
409 bool const compress )
const;
429 void formatCell( std::ostream & tableOutput,
431 size_t idxLine )
const;
441 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.
Class for retrieving errors in the table classes.
View on cell data with information to display it in a table (content, type, alignment,...
Class for setup the table layout.
Class to format data in a formatted text format (for log output typically, expecting fixed character ...
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.
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.
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...
void toStream(std::ostream &outputStream) const
Output the formatted data to a stream. Adds appropriate messages to the error list when the operation...
static constexpr char m_horizontalLine
for the extremity of a row
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.
static constexpr char m_verticalLine
symbol for separator construction
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...
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.
string toString(DATASOURCE const &tableData) const
Convert a data source to a table string.
std::function< void(stdVector< size_t > &) > ColumnWidthModifier
A functor which allow to customize the columns width after their computation.
std::string_view string_view
String type.
internal::StdVectorWrapper< T, Allocator, USE_STD_CONTAINER_BOUNDS_CHECKING > stdVector