|
| | TextTable (int width=0, int height=0, int maxCellWidth=20) |
| | creates a new table with optionally given dimensions More...
|
| |
| std::string & | operator() (int xCell, int yCell) |
| | returns a reference to the entry at given cell coordinates More...
|
| |
| void | ensureSize (int width, int height) |
| | allocates at least as much memory for given amount of rows and columns More...
|
| |
| int | getMaxCellWidth () const |
| | returns the maximum cell width More...
|
| |
| void | setMaxCellWidth (int maxCellWidth) |
| | returns the current maxCellWidth value More...
|
| |
| const Size & | getSize () const |
| | returns the current table size More...
|
| |
| const std::vector< std::string > & | getData () const |
| | returns the internal data vector More...
|
| |
| RowAssigner | operator[] (int row) |
| | gives access to the table row (this can be assigned directly if needed) More...
|
| |
| std::string | toString () const |
| | serializes the table to a std::string More...
|
| |
| void | clear () |
| | clears all current existing table cells More...
|
| |
Utility class for pretty console output.
The text table implements a simple tabular structure (rows x colums cells that have string content). The TextTable structure can always be serialized as a pretty printed. The table's size is automatically expanded if new data is set. Optionally, the table can be created with a given row- and column count. The table data can be set using the (x,y)-function- call operator.
Example (Image Convolution)
#inclue <iostream>
int main(int n, char **ppc){
t(0,0) = "name";
t(1,0) = "forename";
t(2,0) = "age";
t(3,0) = "address";
t[1] =
tok(
"elbrechter,christof,34,Some Street in Oerlinghausen (close to Bielefeld)",
",");
t[2] =
tok(
"gotting,michael,??,Somewhere else",
",");
std::cout << t << std::endl;
}