#include <genesis/utils/text/table.hpp>
Definition at line 60 of file utils/text/table.hpp.
Public Member Functions | |
Table ()=default | |
Table (Table &&)=default | |
Table (Table const &)=default | |
~Table ()=default | |
Column & | add_column (std::string label="") |
Add a column to the table. More... | |
Table & | append (std::string value) |
Table & | append (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 |
Table & | line_break () |
Finish the currently line and move to the next one. More... | |
Table & | operator<< (std::string value) |
Table & | operator= (Table &&)=default |
Table & | operator= (Table const &)=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) |
|
default |
|
default |
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.
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.
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.
|
friend |
Definition at line 255 of file utils/text/table.cpp.