GEOS
Public Member Functions | List of all members
geos::PreparedTableLayout Class Reference

Variation of the TableLayout to store precomputed layout information, ready to be formatted. More...

#include <TableLayout.hpp>

Inheritance diagram for geos::PreparedTableLayout:
Inheritance graph
[legend]

Public Member Functions

 PreparedTableLayout ()
 Construct a default Table Formatter without layout specification (to only insert data in it, without any column / title). Feature is not tested.
 
 PreparedTableLayout (TableLayout const &other)
 Precompute various information for formatting from a configurated TableLayout: More...
 
 PreparedTableLayout (PreparedTableLayout const &)=delete
 As prepared CellLayout & Column types have internal pointers, we cannot copy this class.
 
 PreparedTableLayout (PreparedTableLayout &&)=delete
 as prepared CellLayout & Column types have internal pointers, we cannot move this class (SSO breaks string<-string_view move).
 
size_t getColumnLayersCount () const
 
size_t getVisibleLowermostColumnCount () const
 
size_t getTotalLowermostColumnCount () const
 
string_view getIndentationStr () const
 
- Public Member Functions inherited from geos::TableLayout
DeepFirstIterator beginDeepFirst () const
 
DeepFirstIterator endDeepFirst () const
 
 TableLayout (string_view title, stdVector< TableLayout::Column > const &columns)
 Construct a new Table Layout object. More...
 
 TableLayout (string_view title, TableLayoutArgs args)
 Construct a new Table Layout object. More...
 
 TableLayout (TableLayoutArgs args)
 Construct a new Table Layout object. More...
 
 TableLayout (string_view title, stdVector< string > const &args)
 Construct a new Table Layout object. More...
 
ColumnsList const & getColumns () const
 
ColumnsListgetColumns ()
 
CellLayout const & getTitleLayout () const
 
CellLayoutgetTitleLayout ()
 
string_view getTitleStr () const
 
Alignment getDefaultHeaderAlignment () const
 
Alignment getDefaultValueAlignment () const
 
TableLayoutsetTitle (string_view title)
 
TableLayoutenableLineBreak (bool value)
 Remove the return line at the end & begenning of the table. More...
 
TableLayoutsetMargin (MarginValue marginValue)
 Set the minimal margin width between cell content and borders. More...
 
TableLayoutsetMaxColumnWidth (size_t width)
 Set the maximal width for each column. More...
 
TableLayoutsetIndentation (size_t spacesCount)
 Set the indentation of the whole table. More...
 
TableLayoutsetDefaultHeaderAlignment (Alignment alignment)
 Sets the default value for columns header cells alignement. Used with column-free layout. More...
 
TableLayoutsetDefaultValueAlignment (Alignment alignment)
 Sets the default value for data cells alignement. Used with column-free layout. More...
 
bool isMaxColumnWidthSet ()
 check if a column max width has been set More...
 
bool isLineBreakEnabled () const
 
integer const & getBorderMargin () const
 
integer const & getColumnMargin () const
 
integer const & getMarginValue () const
 
size_t const & getMaxColumnWidth () const
 
size_t const & getIndentation () const
 
TableLayoutaddColumns (stdVector< Column > const &columnNames)
 Create and add columns to the columns vector given a string vector. More...
 
TableLayoutaddColumns (stdVector< string > const &columns)
 Create and add columns to the columns vector given a string vector. More...
 
TableLayoutaddColumns (TableLayoutArgs columns)
 Create and add columns to the columns vector given a string and/or columns. More...
 
TableLayoutaddColumn (string_view columnName)
 Create and add a column to the columns vector given a string. More...
 
TableLayoutaddColumn (Column const &column)
 Create and add a column to the columns vector given a Column. More...
 

Additional Inherited Members

- Public Types inherited from geos::TableLayout
enum  Alignment { right , left , center }
 Type of aligment for a column.
 
enum  MarginValue : integer { tiny = 0 , small = 1 , medium = 2 , large = 3 }
 Space to apply between all data and border.
 
enum  Section { header , values }
 Enumeration for table sections.
 
using TableLayoutArgs = std::initializer_list< std::variant< string_view, TableLayout::Column > >
 Alias for an initializer list of variants that can contain either a string or a layout column.
 
using ColumnsList = Column::ColumnsList
 Alias for the list of columns.
 
- Static Public Attributes inherited from geos::TableLayout
static constexpr size_t noColumnMaxWidth = std::numeric_limits< size_t >::max()
 default value for m_maxColumnWidth when it is not set
 
- Protected Member Functions inherited from geos::TableLayout
void processArguments (TableLayoutArgs args)
 Add a column to the table given an initializer_list of string & Column. More...
 
template<typename ... Ts>
void processArguments (Ts &... args)
 
- Protected Attributes inherited from geos::TableLayout
ColumnsList m_tableColumns
 Columns settings hierarchy.
 
bool m_lineBreakAtBegin = true
 Indicate if we have a line break a the beginning of the table.
 
string m_tableTitleStr
 Table title text.
 
CellLayout m_tableTitleLayout = CellLayout( CellType::Header, Alignment::center )
 Table title cell layout settings.
 
size_t m_maxColumnWidth = noColumnMaxWidth
 Max width for each column.
 
integer m_borderMargin
 The number of spaces at each table sides.
 
integer m_columnMargin
 The number of character between two columns (spaces + the separacting character).
 
integer m_marginValue
 The number of margin spaces around contents.
 
size_t m_indentation = 0
 The number of spaces at the left of the table.
 
Alignment m_defaultHeaderAlignment = Alignment::center
 default value for columns header cells alignement.
 
Alignment m_defaultValueAlignment = Alignment::right
 default value for data cells alignement.
 

Detailed Description

Variation of the TableLayout to store precomputed layout information, ready to be formatted.

Definition at line 817 of file TableLayout.hpp.

Constructor & Destructor Documentation

◆ PreparedTableLayout()

geos::PreparedTableLayout::PreparedTableLayout ( TableLayout const &  other)

Precompute various information for formatting from a configurated TableLayout:

  • parent-child relationships between columns and sub-columns,
  • layout elements size,
  • line wrapping. For now, called automatically at TableFormatter construction.
    Note
    If an error happen while this process, it must output the table name and the error message in a GEOS_WARNING().
    Parameters
    otherThe table layout configuration.

Member Function Documentation

◆ getColumnLayersCount()

size_t geos::PreparedTableLayout::getColumnLayersCount ( ) const
inline
Returns
The count of column layers

Definition at line 853 of file TableLayout.hpp.

◆ getIndentationStr()

string_view geos::PreparedTableLayout::getIndentationStr ( ) const
inline
Returns
A string with the correct indentation space count to precede each lines of the formatted table.

Definition at line 873 of file TableLayout.hpp.

◆ getTotalLowermostColumnCount()

size_t geos::PreparedTableLayout::getTotalLowermostColumnCount ( ) const
inline
Returns
The number columns that does not contain child (useful to know the maximum number of column to show in a given row).

Definition at line 867 of file TableLayout.hpp.

◆ getVisibleLowermostColumnCount()

size_t geos::PreparedTableLayout::getVisibleLowermostColumnCount ( ) const
inline
Returns
The number of visible columns that does not contain child (useful to know the maximum number of column to show in a given row).

Definition at line 860 of file TableLayout.hpp.


The documentation for this class was generated from the following file: