A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Table::Column Class Reference

#include <genesis/utils/text/table.hpp>

Detailed Description

Definition at line 140 of file utils/text/table.hpp.

Public Member Functions

 Column ()=default
 
 Column (std::string label, Justification justify=Justification::kLeft)
 
 Column (Column const &)=default
 
 Column (Column &&)=default
 
 ~Column ()=default
 
void append (std::string value)
 
void append (Style const &style, std::string value)
 
void clear_content ()
 
void justify (Justification value)
 
Justification justify () const
 
void label (std::string value)
 
std::string label () const
 
size_t length () const
 
Columnoperator= (Column const &)=default
 
Columnoperator= (Column &&)=default
 
std::string row (size_t i) const
 
void shrink_width ()
 Shrinks the column width to the minmal width that suffices to fit in all values of the column (i.e., both data and label). More...
 
void width (size_t value)
 Set the width of this column. More...
 
size_t width () const
 
void write_label (std::ostream &stream) const
 
void write_row (std::ostream &stream, size_t row) const
 

Public Types

enum  Justification { kLeft, kRight, kCentered }
 

Constructor & Destructor Documentation

Column ( )
default
Column ( std::string  label,
Justification  justify = Justification::kLeft 
)
inlineexplicit

Definition at line 163 of file utils/text/table.hpp.

~Column ( )
default
Column ( Column const &  )
default
Column ( Column &&  )
default

Member Function Documentation

void append ( std::string  value)

Definition at line 351 of file utils/text/table.cpp.

void append ( Style const &  style,
std::string  value 
)

Definition at line 357 of file utils/text/table.cpp.

void clear_content ( )

Definition at line 345 of file utils/text/table.cpp.

void justify ( Justification  value)

Definition at line 280 of file utils/text/table.cpp.

Table::Column::Justification justify ( ) const

Definition at line 285 of file utils/text/table.cpp.

void label ( std::string  value)

Definition at line 269 of file utils/text/table.cpp.

std::string label ( ) const

Definition at line 275 of file utils/text/table.cpp.

size_t length ( ) const

Definition at line 330 of file utils/text/table.cpp.

Column& operator= ( Column const &  )
default
Column& operator= ( Column &&  )
default
std::string row ( size_t  i) const

Definition at line 335 of file utils/text/table.cpp.

void shrink_width ( )

Shrinks the column width to the minmal width that suffices to fit in all values of the column (i.e., both data and label).

The column keeps track of its needed minimal width when just adding data. Thus, this function is only neccessary to call once the width was changed manually or if the label or a data value have been changed after being added.

Definition at line 317 of file utils/text/table.cpp.

void width ( size_t  value)

Set the width of this column.

If the new value is smaller than the current one, nothing happens. The width can only grow, or be set to the minimal possible value using shrink_width(). This ensures that all text fits within the column.

Definition at line 297 of file utils/text/table.cpp.

size_t width ( ) const

Definition at line 304 of file utils/text/table.cpp.

void write_label ( std::ostream &  stream) const

Definition at line 374 of file utils/text/table.cpp.

void write_row ( std::ostream &  stream,
size_t  row 
) const

Definition at line 367 of file utils/text/table.cpp.

Member Enumeration Documentation

enum Justification
strong
Enumerator
kLeft 
kRight 
kCentered 

Definition at line 148 of file utils/text/table.hpp.


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