bprinter::TablePrinter#
#include <TablePrinter.h>
How to reference this class#
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`bprinter::TablePrinter <class-bprinter-tableprinter>`
[bprinter::TablePrinter](#class-bprinter-tableprinter)
Detailed description#
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();
List of Public Methods#
List of Private Methods#
Complete Member Function Documentation#
AddColumn#
void bprinter::TablePrinter::AddColumn(const std::string &header_name, int column_width)
Add a column to our table.
Detailed description
Referenced By
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`void bprinter::TablePrinter::AddColumn(const std::string &header_name, int column_width) <bprinter-tableprinter-public-void-bprinter-tableprinter-addcolumn-const-std-string-ref-header-name-int-column-width>`
[void bprinter::TablePrinter::AddColumn(const std::string &header_name, int column_width)](#bprinter-tableprinter-public-void-bprinter-tableprinter-addcolumn-const-std-string-ref-header-name-int-column-width)
get_num_columns#
int bprinter::TablePrinter::get_num_columns() const
Detailed description
Referenced By
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`int bprinter::TablePrinter::get_num_columns() const <bprinter-tableprinter-public-int-bprinter-tableprinter-get-num-columns-const>`
[int bprinter::TablePrinter::get_num_columns() const](#bprinter-tableprinter-public-int-bprinter-tableprinter-get-num-columns-const)
get_table_width#
int bprinter::TablePrinter::get_table_width() const
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`int bprinter::TablePrinter::get_table_width() const <bprinter-tableprinter-public-int-bprinter-tableprinter-get-table-width-const>`
[int bprinter::TablePrinter::get_table_width() const](#bprinter-tableprinter-public-int-bprinter-tableprinter-get-table-width-const)
operator<<#
TablePrinter & bprinter::TablePrinter::operator<<(double input)
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`TablePrinter & bprinter::TablePrinter::operator<<(double input) <bprinter-tableprinter-public-tableprinter-ref-bprinter-tableprinter-operator-double-input>`
[TablePrinter & bprinter::TablePrinter::operator<<(double input)](#bprinter-tableprinter-public-tableprinter-ref-bprinter-tableprinter-operator-double-input)
operator<<#
TablePrinter & bprinter::TablePrinter::operator<<(endl input)
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`TablePrinter & bprinter::TablePrinter::operator<<(endl input) <bprinter-tableprinter-public-tableprinter-ref-bprinter-tableprinter-operator-endl-input>`
[TablePrinter & bprinter::TablePrinter::operator<<(endl input)](#bprinter-tableprinter-public-tableprinter-ref-bprinter-tableprinter-operator-endl-input)
operator<<#
TablePrinter & bprinter::TablePrinter::operator<<(float input)
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`TablePrinter & bprinter::TablePrinter::operator<<(float input) <bprinter-tableprinter-public-tableprinter-ref-bprinter-tableprinter-operator-float-input>`
[TablePrinter & bprinter::TablePrinter::operator<<(float input)](#bprinter-tableprinter-public-tableprinter-ref-bprinter-tableprinter-operator-float-input)
operator<<#
TablePrinter & bprinter::TablePrinter::operator<<(T input)
Detailed description
References
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`TablePrinter & bprinter::TablePrinter::operator<<(T input) <bprinter-tableprinter-public-tableprinter-ref-bprinter-tableprinter-operator-t-input>`
[TablePrinter & bprinter::TablePrinter::operator<<(T input)](#bprinter-tableprinter-public-tableprinter-ref-bprinter-tableprinter-operator-t-input)
PrintHeader#
void bprinter::TablePrinter::PrintHeader()
Detailed description
References
Referenced By
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`void bprinter::TablePrinter::PrintHeader() <bprinter-tableprinter-public-void-bprinter-tableprinter-printheader>`
[void bprinter::TablePrinter::PrintHeader()](#bprinter-tableprinter-public-void-bprinter-tableprinter-printheader)
set_flush_left#
void bprinter::TablePrinter::set_flush_left()
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`void bprinter::TablePrinter::set_flush_left() <bprinter-tableprinter-public-void-bprinter-tableprinter-set-flush-left>`
[void bprinter::TablePrinter::set_flush_left()](#bprinter-tableprinter-public-void-bprinter-tableprinter-set-flush-left)
set_flush_right#
void bprinter::TablePrinter::set_flush_right()
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`void bprinter::TablePrinter::set_flush_right() <bprinter-tableprinter-public-void-bprinter-tableprinter-set-flush-right>`
[void bprinter::TablePrinter::set_flush_right()](#bprinter-tableprinter-public-void-bprinter-tableprinter-set-flush-right)
set_separator#
void bprinter::TablePrinter::set_separator(const std::string &separator)
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`void bprinter::TablePrinter::set_separator(const std::string &separator) <bprinter-tableprinter-public-void-bprinter-tableprinter-set-separator-const-std-string-ref-separator>`
[void bprinter::TablePrinter::set_separator(const std::string &separator)](#bprinter-tableprinter-public-void-bprinter-tableprinter-set-separator-const-std-string-ref-separator)
TablePrinter#
bprinter::TablePrinter::TablePrinter(std::ostream *output, const std::string &separator="│")
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`bprinter::TablePrinter::TablePrinter(std::ostream *output, const std::string &separator="│") <bprinter-tableprinter-public-bprinter-tableprinter-tableprinter-std-ostream-ptr-output-const-std-string-ref-separator-equal-"│">`
[bprinter::TablePrinter::TablePrinter(std::ostream *output, const std::string &separator="│")](#bprinter-tableprinter-public-bprinter-tableprinter-tableprinter-std-ostream-ptr-output-const-std-string-ref-separator-equal-"│")
~TablePrinter#
bprinter::TablePrinter::~TablePrinter()
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`bprinter::TablePrinter::~TablePrinter() <bprinter-tableprinter-public-bprinter-tableprinter-dtor-tableprinter>`
[bprinter::TablePrinter::~TablePrinter()](#bprinter-tableprinter-public-bprinter-tableprinter-dtor-tableprinter)
OutputDecimalNumber#
void bprinter::TablePrinter::OutputDecimalNumber(T input)
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`void bprinter::TablePrinter::OutputDecimalNumber(T input) <bprinter-tableprinter-private-void-bprinter-tableprinter-outputdecimalnumber-t-input>`
[void bprinter::TablePrinter::OutputDecimalNumber(T input)](#bprinter-tableprinter-private-void-bprinter-tableprinter-outputdecimalnumber-t-input)
PrintHorizontalLine#
void bprinter::TablePrinter::PrintHorizontalLine(int updown=0)
Detailed description
How to reference this method:
Copy the following pieces of RST/Markdown code to cite this element in other parts of the sphinx documentation (there is a copy button on the top-right when hovering the code block):
:ref:`void bprinter::TablePrinter::PrintHorizontalLine(int updown=0) <bprinter-tableprinter-private-void-bprinter-tableprinter-printhorizontalline-int-updown-equal-0>`
[void bprinter::TablePrinter::PrintHorizontalLine(int updown=0)](#bprinter-tableprinter-private-void-bprinter-tableprinter-printhorizontalline-int-updown-equal-0)
Attributes Documentation#
std::vector<std::string> bprinter::TablePrinter::column_headers_
std::vector<int> bprinter::TablePrinter::column_widths_
bool bprinter::TablePrinter::flush_left_
int bprinter::TablePrinter::i_
int bprinter::TablePrinter::j_
std::ostream* bprinter::TablePrinter::out_stream_
std::string bprinter::TablePrinter::separator_
int bprinter::TablePrinter::table_width_ = - 10