20 #ifndef GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP
21 #define GEOS_COMMON_FORMAT_TABLE_TABLEFORMATTER_HPP
97 template<
typename DATASOURCE >
98 string toString( DATASOURCE
const & tableData )
const;
108 string TableCSVFormatter::toString< TableData >(
TableData const & tableData )
const;
148 template<
typename DATASOURCE >
149 string toString( DATASOURCE
const & tableData )
const;
154 static constexpr
char m_verticalLine =
'|';
156 static constexpr
char m_horizontalLine =
'-';
163 void fillTableColumnsFromRows( std::vector< TableLayout::Column > & columns,
164 std::vector< std::vector< string > > & tableData )
const;
173 void outputLayout( std::ostringstream & tableOutput,
174 std::vector< TableLayout::Column > & columns,
175 std::vector< string >
const & msgTableError,
176 string & sectionSeparatingLine )
const;
185 void splitAndSetColumnNames( std::vector< TableLayout::Column > & columns,
186 size_t & largestHeaderVectorSize,
187 std::vector< std::vector< string > > & splitHeaders )
const;
193 void findAndSetMaxStringSize( std::vector< TableLayout::Column > & columns )
const;
200 void increaseColumnsSize( std::vector< TableLayout::Column > & columns,
201 integer const extraCharacters )
const;
209 void computeTableWidth( std::vector< TableLayout::Column > & columns,
210 std::vector< string >
const & msgTableError )
const;
218 void buildTableSeparators( std::vector< TableLayout::Column >
const & columns,
219 string & topSeparator,
220 string & sectionSeparatingLine )
const;
229 void outputTopRows( std::ostringstream & tableOutput,
230 std::vector< string >
const & msg,
243 void outputSectionRows( std::vector< TableLayout::Column >
const & columns,
245 std::ostringstream & rows,
256 string TableTextFormatter::toString< TableData >(
TableData const & tableData )
const;
Class for managing table data.
Class for setup the table layout.
Alignment
Type of aligment for a column.
Section
Enumeration for table sections.
TableTextFormatter()
Construct a new TableFormatter.
TableTextFormatter(TableLayout const &tableLayout)
Construct a new TableFormatter from a tableLayout.
string layoutToString() const
virtual ~TableTextFormatter()=default
Destroy the Table Text Formatter object.
string toString(DATASOURCE const &tableData) const
Convert a data source to a table string.
std::int32_t integer
Signed integer type.
std::string_view string_view
String type.