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

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

Detailed Description

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

Public Member Functions

 Table ()=default
 
 Table (Table const &)=default
 
 Table (Table &&)=default
 
 ~Table ()=default
 
Columnadd_column (std::string label="")
 Add a column to the table. More...
 
Tableappend (std::string value)
 
Tableappend (Style const &style, std::string value)
 
void clear ()
 Clears all columns and their data from the table. More...
 
void clear_content ()
 Clears the data contents of all columns. Their labels etc stay unchanged. More...
 
size_t length () const
 
Tableline_break ()
 Finish the currently line and move to the next one. More...
 
Tableoperator<< (std::string value)
 
Tableoperator= (Table const &)=default
 
Tableoperator= (Table &&)=default
 
std::string to_string () const
 
std::string to_string (TableLayout const &layout) const
 
void write (std::ostream &out) const
 
void write (std::ostream &out, TableLayout const &layout) const
 

Classes

class  Column
 

Friends

std::ostream & operator<< (std::ostream &out, Table const &table)
 

Constructor & Destructor Documentation

Table ( )
default
~Table ( )
default
Table ( Table const &  )
default
Table ( Table &&  )
default

Member Function Documentation

Table::Column & add_column ( std::string  label = "")

Add a column to the table.

If the table already contains columns with data, the new one is initialized with empty strings for the whole length of the table.

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

Table & append ( std::string  value)

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

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

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

void clear ( )

Clears all columns and their data from the table.

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

void clear_content ( )

Clears the data contents of all columns. Their labels etc stay unchanged.

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

size_t length ( ) const

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

Table & line_break ( )

Finish the currently line and move to the next one.

This function fills the columns of the current line with empty strings, so that the next append() call will add content to the first column of the next line. If we are currently at the beginning of a line, this function results in an empty line (useful for grouping of lines).

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

Table & operator<< ( std::string  value)

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

Table& operator= ( Table const &  )
default
Table& operator= ( Table &&  )
default
std::string to_string ( ) const

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

std::string to_string ( TableLayout const &  layout) const

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

void write ( std::ostream &  out) const

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

void write ( std::ostream &  out,
TableLayout const &  layout 
) const

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

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
Table const &  table 
)
friend

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


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