20 #ifndef GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP
21 #define GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP
25 #include "TableTypes.hpp"
71 std::unique_ptr< geos::TableErrorListing >
m_errors = std::make_unique< geos::TableErrorListing >();
144 template<
typename DATASOURCE >
145 string toString( DATASOURCE
const & tableData )
const;
171 template<
typename DATASOURCE >
172 void toStream( std::ostream & outputStream, DATASOURCE
const & tableData )
const
180 { m_showErrors = cond; }
184 bool m_showErrors =
true;
194 string TableCSVFormatter::toString< TableData >(
TableData const & tableData )
const;
231 template<
typename DATASOURCE >
232 string toString( DATASOURCE
const & tableData )
const;
249 template<
typename DATASOURCE >
250 void toStream( std::ostream & outputStream, DATASOURCE
const & tableData )
const
278 size_t & tableTotalWidth,
315 bool hasData )
const;
327 std::ostream & tableOutput )
const;
337 std::ostream & tableOutput )
const;
348 size_t nbVisibleColumn )
const;
363 size_t nbVisibleColumn )
const;
373 size_t const nbVisibleColumn )
const;
415 bool const compress )
const;
435 void formatCell( std::ostream & tableOutput,
437 size_t idxLine )
const;
447 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