|
XBotInterface
2.4.1
XBotInterface provides a generic API to model and control a robot.
|
#include <table_printer.h>
Collaboration diagram for bprinter::TablePrinter: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. More... | |
| 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();
| bprinter::TablePrinter::TablePrinter | ( | std::ostream * | output, |
| const std::string & | separator = "|" |
||
| ) |
| bprinter::TablePrinter::~TablePrinter | ( | ) |
| 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) |
| int bprinter::TablePrinter::get_num_columns | ( | ) | const |
| int bprinter::TablePrinter::get_table_width | ( | ) | const |
| TablePrinter & bprinter::TablePrinter::operator<< | ( | double | input | ) |
|
inline |
| TablePrinter & bprinter::TablePrinter::operator<< | ( | float | input | ) |
|
inline |
| void bprinter::TablePrinter::PrintFooter | ( | ) |
| void bprinter::TablePrinter::PrintHeader | ( | ) |
| void bprinter::TablePrinter::set_flush_left | ( | ) |
| void bprinter::TablePrinter::set_flush_right | ( | ) |
| void bprinter::TablePrinter::set_separator | ( | const std::string & | separator | ) |
1.8.17