|
TrioCFD 1.9.8
TrioCFD documentation
|
#include <TablePrinter.h>
Public Member Functions | |
| TablePrinter (std::ostream *output, const std::string &separator="│") | |
| ~TablePrinter () | |
| int | get_num_columns () const |
| int | get_table_width () const |
| void | set_separator (const std::string &separator) |
| void | set_flush_left () |
| void | set_flush_right () |
| void | AddColumn (const std::string &header_name, int column_width) |
| Add a column to our table. | |
| void | PrintHeader () |
| void | PrintFooter () |
| TablePrinter & | operator<< (endl input) |
| TablePrinter & | operator<< (float input) |
| TablePrinter & | operator<< (double input) |
| template<typename T> | |
| TablePrinter & | operator<< (T input) |
Print a pretty table into your output of choice.
Usage: TablePrinter tp(&std::cout); tp.AddColumn("Name", 25); tp.AddColumn("Age", 3); tp.AddColumn("Position", 30);
tp.PrintHeader(); tp << "Dat Chu" << 25 << "Research Assistant"; tp << "John Doe" << 26 << "Professional Anonymity"; tp << "Jane Doe" << tp.SkipToNextLine(); tp << "Tom Doe" << 7 << "Student"; tp.PrintFooter();
Definition at line 47 of file TablePrinter.h.
| bprinter::TablePrinter::TablePrinter | ( | std::ostream * | output, |
| const std::string & | separator = "│" ) |
Definition at line 22 of file TablePrinter.cpp.
Definition at line 30 of file TablePrinter.cpp.
| void bprinter::TablePrinter::AddColumn | ( | const std::string & | header_name, |
| int | column_width ) |
Add a column to our table.
| header_name | Name to be print for the header |
| column_width | the width of the column (has to be >=5) |
Definition at line 60 of file TablePrinter.cpp.
| int bprinter::TablePrinter::get_num_columns | ( | ) | const |
Definition at line 35 of file TablePrinter.cpp.
| int bprinter::TablePrinter::get_table_width | ( | ) | const |
| TablePrinter & bprinter::TablePrinter::operator<< | ( | double | input | ) |
Definition at line 118 of file TablePrinter.cpp.
|
inline |
Definition at line 63 of file TablePrinter.h.
| TablePrinter & bprinter::TablePrinter::operator<< | ( | float | input | ) |
Definition at line 112 of file TablePrinter.cpp.
|
inline |
Definition at line 76 of file TablePrinter.h.
| void bprinter::TablePrinter::PrintFooter | ( | ) |
Definition at line 107 of file TablePrinter.cpp.
| void bprinter::TablePrinter::PrintHeader | ( | ) |
Definition at line 83 of file TablePrinter.cpp.
Definition at line 45 of file TablePrinter.cpp.
Definition at line 50 of file TablePrinter.cpp.
| void bprinter::TablePrinter::set_separator | ( | const std::string & | separator | ) |
Definition at line 40 of file TablePrinter.cpp.