GEOS
Classes | Public Types | Public Member Functions | List of all members
geos::TableLayout Class Reference

Class for setup the table layout. More...

#include <TableLayout.hpp>

Classes

struct  Column
 Struct for a column. More...
 
struct  ColumnParam
 Structure to set up each colum parameters. More...
 

Public Types

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.
 

Public Member Functions

 TableLayout (std::vector< string > const &columnNames, string const &title="")
 Construct a new Table object, all values in the table are centered by default. More...
 
 TableLayout (std::vector< ColumnParam > const &columnParameters, string const &title="")
 Construct a new Table object by specifying value alignment and optionally their displays based to log levels level. More...
 
std::vector< Column > const & getColumns () const
 
string_view getTitle () const
 
integer const & getBorderMargin () const
 
integer const & getColumnMargin () const
 
integer const & getMarginTitle () const
 
void setMargin (MarginValue marginValue)
 Set the minimal margin width between cell content and borders. More...
 

Detailed Description

Class for setup the table layout.

Definition at line 31 of file TableLayout.hpp.

Constructor & Destructor Documentation

◆ TableLayout() [1/2]

geos::TableLayout::TableLayout ( std::vector< string > const &  columnNames,
string const &  title = "" 
)

Construct a new Table object, all values in the table are centered by default.

Parameters
columnNamesThe names of the columns
titleThe table name

◆ TableLayout() [2/2]

geos::TableLayout::TableLayout ( std::vector< ColumnParam > const &  columnParameters,
string const &  title = "" 
)

Construct a new Table object by specifying value alignment and optionally their displays based to log levels level.

Parameters
columnParametersList of structures to set up each colum parameters.
titleThe table name

Member Function Documentation

◆ getBorderMargin()

integer const& geos::TableLayout::getBorderMargin ( ) const
Returns
The border margin, number of spaces at both left and right table sides

◆ getColumnMargin()

integer const& geos::TableLayout::getColumnMargin ( ) const
Returns
The column margin, numbers of spaces separating both left and right side from each column content

◆ getColumns()

std::vector< Column > const& geos::TableLayout::getColumns ( ) const
Returns
The columns vector

◆ getMarginTitle()

integer const& geos::TableLayout::getMarginTitle ( ) const
Returns
The margin title

◆ getTitle()

string_view geos::TableLayout::getTitle ( ) const
Returns
The table name

◆ setMargin()

void geos::TableLayout::setMargin ( MarginValue  marginValue)

Set the minimal margin width between cell content and borders.

Parameters
marginValueThe margin value

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