bprinter::TablePrinter#

#include <TablePrinter.h>

How to cite this class in this doc#

: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.

Referenced By
How to cite in this doc:
:ref:`void bprinter::TablePrinter::AddColumn(const std::string &header_name, int column_width) <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)](#public-void-bprinter-tableprinter-addcolumn-const-std-string-ref-header-name-int-column-width)
get_num_columns
int bprinter::TablePrinter::get_num_columns() const
Referenced By
How to cite in this doc:
:ref:`int bprinter::TablePrinter::get_num_columns() const <public-int-bprinter-tableprinter-get-num-columns-const>`
[int bprinter::TablePrinter::get_num_columns() const](#public-int-bprinter-tableprinter-get-num-columns-const)
get_table_width
int bprinter::TablePrinter::get_table_width() const
How to cite in this doc:
:ref:`int bprinter::TablePrinter::get_table_width() const <public-int-bprinter-tableprinter-get-table-width-const>`
[int bprinter::TablePrinter::get_table_width() const](#public-int-bprinter-tableprinter-get-table-width-const)
operator<<
TablePrinter & bprinter::TablePrinter::operator<<(double input)
How to cite in this doc:
:ref:`TablePrinter & bprinter::TablePrinter::operator<<(double input) <public-tableprinter-ref-bprinter-tableprinter-operator-double-input>`
[TablePrinter & bprinter::TablePrinter::operator<<(double input)](#public-tableprinter-ref-bprinter-tableprinter-operator-double-input)
operator<<
TablePrinter & bprinter::TablePrinter::operator<<(endl input)
How to cite in this doc:
:ref:`TablePrinter & bprinter::TablePrinter::operator<<(endl input) <public-tableprinter-ref-bprinter-tableprinter-operator-endl-input>`
[TablePrinter & bprinter::TablePrinter::operator<<(endl input)](#public-tableprinter-ref-bprinter-tableprinter-operator-endl-input)
operator<<
TablePrinter & bprinter::TablePrinter::operator<<(float input)
How to cite in this doc:
:ref:`TablePrinter & bprinter::TablePrinter::operator<<(float input) <public-tableprinter-ref-bprinter-tableprinter-operator-float-input>`
[TablePrinter & bprinter::TablePrinter::operator<<(float input)](#public-tableprinter-ref-bprinter-tableprinter-operator-float-input)
operator<<
TablePrinter & bprinter::TablePrinter::operator<<(T input)
References
How to cite in this doc:
:ref:`TablePrinter & bprinter::TablePrinter::operator<<(T input) <public-tableprinter-ref-bprinter-tableprinter-operator-t-input>`
[TablePrinter & bprinter::TablePrinter::operator<<(T input)](#public-tableprinter-ref-bprinter-tableprinter-operator-t-input)
PrintFooter
void bprinter::TablePrinter::PrintFooter()
How to cite in this doc:
:ref:`void bprinter::TablePrinter::PrintFooter() <public-void-bprinter-tableprinter-printfooter>`
[void bprinter::TablePrinter::PrintFooter()](#public-void-bprinter-tableprinter-printfooter)
PrintHeader
void bprinter::TablePrinter::PrintHeader()
References
Referenced By
How to cite in this doc:
:ref:`void bprinter::TablePrinter::PrintHeader() <public-void-bprinter-tableprinter-printheader>`
[void bprinter::TablePrinter::PrintHeader()](#public-void-bprinter-tableprinter-printheader)
set_flush_left
void bprinter::TablePrinter::set_flush_left()
How to cite in this doc:
:ref:`void bprinter::TablePrinter::set_flush_left() <public-void-bprinter-tableprinter-set-flush-left>`
[void bprinter::TablePrinter::set_flush_left()](#public-void-bprinter-tableprinter-set-flush-left)
set_flush_right
void bprinter::TablePrinter::set_flush_right()
How to cite in this doc:
:ref:`void bprinter::TablePrinter::set_flush_right() <public-void-bprinter-tableprinter-set-flush-right>`
[void bprinter::TablePrinter::set_flush_right()](#public-void-bprinter-tableprinter-set-flush-right)
set_separator
void bprinter::TablePrinter::set_separator(const std::string &separator)
How to cite in this doc:
:ref:`void bprinter::TablePrinter::set_separator(const std::string &separator) <public-void-bprinter-tableprinter-set-separator-const-std-string-ref-separator>`
[void bprinter::TablePrinter::set_separator(const std::string &separator)](#public-void-bprinter-tableprinter-set-separator-const-std-string-ref-separator)
TablePrinter
bprinter::TablePrinter::TablePrinter(std::ostream *output, const std::string &separator="│")
How to cite in this doc:
:ref:`bprinter::TablePrinter::TablePrinter(std::ostream *output, const std::string &separator="│") <public-bprinter-tableprinter-tableprinter-std-ostream-ptr-output-const-std-string-ref-separator-equal-"│">`
[bprinter::TablePrinter::TablePrinter(std::ostream *output, const std::string &separator="│")](#public-bprinter-tableprinter-tableprinter-std-ostream-ptr-output-const-std-string-ref-separator-equal-"│")
~TablePrinter
bprinter::TablePrinter::~TablePrinter()
How to cite in this doc:
:ref:`bprinter::TablePrinter::~TablePrinter() <public-bprinter-tableprinter-dtor-tableprinter>`
[bprinter::TablePrinter::~TablePrinter()](#public-bprinter-tableprinter-dtor-tableprinter)
OutputDecimalNumber
void bprinter::TablePrinter::OutputDecimalNumber(T input)
How to cite in this doc:
:ref:`void bprinter::TablePrinter::OutputDecimalNumber(T input) <private-void-bprinter-tableprinter-outputdecimalnumber-t-input>`
[void bprinter::TablePrinter::OutputDecimalNumber(T input)](#private-void-bprinter-tableprinter-outputdecimalnumber-t-input)
PrintHorizontalLine
void bprinter::TablePrinter::PrintHorizontalLine(int updown=0)
How to cite in this doc:
:ref:`void bprinter::TablePrinter::PrintHorizontalLine(int updown=0) <private-void-bprinter-tableprinter-printhorizontalline-int-updown-equal-0>`
[void bprinter::TablePrinter::PrintHorizontalLine(int updown=0)](#private-void-bprinter-tableprinter-printhorizontalline-int-updown-equal-0)

Attributes Documentation#

column_headers_ (private)
std::vector<std::string> bprinter::TablePrinter::column_headers_
column_widths_ (private)
std::vector<int> bprinter::TablePrinter::column_widths_
flush_left_ (private)
bool bprinter::TablePrinter::flush_left_
i_ (private)
int bprinter::TablePrinter::i_
j_ (private)
int bprinter::TablePrinter::j_
out_stream_ (private)
std::ostream* bprinter::TablePrinter::out_stream_
separator_ (private)
std::string bprinter::TablePrinter::separator_
table_width_ (private)
int bprinter::TablePrinter::table_width_ = - 10