![]() |
TSDuck v3.46-4964
MPEG Transport Stream Toolkit
|
#include <tsGrid.h>
Classes | |
| class | ColumnLayout |
| class | ColumnText |
Public Member Functions | |
| Grid (std::ostream &output) | |
| ~Grid () | |
| ColumnLayout | border () const |
| ColumnLayout | both (size_t width=0, UChar pad=SPACE) const |
| ColumnLayout | bothTruncateLeft (size_t width=0, UChar pad=SPACE) const |
| ColumnLayout | bothTruncateRight (size_t width=0, UChar pad=SPACE) const |
| void | closeTable () |
| ColumnLayout | left (size_t width=0, UChar pad=SPACE) const |
| size_t | lineCount () const |
| size_t | lineWidth () const |
| size_t | marginWidth () const |
| void | openTable () |
| void | putLayout (const std::initializer_list< ColumnText > text) |
| void | putLine (const UString &left, const UString &right, bool one_line=true) |
| void | putLine (const UString &line=UString()) |
| void | putMultiLine (const UString &text=UString()) |
| ColumnLayout | right (size_t width=0, UChar pad=SPACE) const |
| void | section () |
| void | setLayout (const std::initializer_list< ColumnLayout > layout) |
| void | setLineWidth (size_t lineWidth=DEFAULT_LINE_WIDTH, size_t marginWidth=DEFAULT_MARGIN_WIDTH) |
| std::ostream & | stream () const |
| void | subSection () |
| bool | tableIsOpen () const |
Static Public Attributes | |
| static constexpr size_t | DEFAULT_LINE_WIDTH = 80 |
| static constexpr size_t | DEFAULT_MARGIN_WIDTH = 2 |
This class produces a report in a grid format with tables and sections.
| ts::Grid::Grid | ( | std::ostream & | output | ) |
Constructor.
| [in,out] | output | Reference to the output text device. |
| ts::Grid::~Grid | ( | ) |
Destructor.
|
inline |
Get a reference to the output stream.
| void ts::Grid::setLineWidth | ( | size_t | lineWidth = DEFAULT_LINE_WIDTH, |
| size_t | marginWidth = DEFAULT_MARGIN_WIDTH ) |
Set the report display line width.
| [in] | lineWidth | New line width. |
| [in] | marginWidth | New margin width. |
|
inline |
Get the report display line width.
|
inline |
Get the report display margin width.
|
inline |
Get the number of displayed lines.
| void ts::Grid::openTable | ( | ) |
Open a table, if not already done.
|
inline |
Check if a table is open.
| void ts::Grid::closeTable | ( | ) |
Close a table, if not already done.
| void ts::Grid::section | ( | ) |
Draw section delimiter.
| void ts::Grid::subSection | ( | ) |
Draw sub-section delimiter.
Write a line with one field, truncated.
| [in] | line | Line content. |
Write a text, wrap on multiple lines when necessary.
| [in] | text | Text to display. |
Write a line with two fields, possibly on two lines.
| [in] | left | Left-side content. |
| [in] | right | Right-side content. |
| [in] | one_line | If true, force the packing on one line. If false, allow two lines, one for each text, in case of overflow. |
|
inline |
Build a ColumnLayout with one text field, left-justified.
| [in] | width | Requested width in characters. |
| [in] | pad | Padding character. |
|
inline |
Build a ColumnLayout with one text field, right-justified.
| [in] | width | Requested width in characters. |
| [in] | pad | Padding character. |
|
inline |
Build a ColumnLayout with two text field, left-justified and right-justified. In case of overflow, both are truncated.
| [in] | width | Requested width in characters. |
| [in] | pad | Padding character. |
|
inline |
Build a ColumnLayout with two text field, left-justified and right-justified, truncate left one on overflow.
| [in] | width | Requested width in characters. |
| [in] | pad | Padding character. |
|
inline |
Build a ColumnLayout with two text field, left-justified and right-justified, truncate right one on overflow.
| [in] | width | Requested width in characters. |
| [in] | pad | Padding character. |
|
inline |
Build a ColumnLayout creating a vertical border between the two adjacent columns.
| void ts::Grid::setLayout | ( | const std::initializer_list< ColumnLayout > | layout | ) |
Define the current column layout.
| [in] | layout | List of columns layouts. Depending on the width of the grid, the layout may be rearranged. |
| void ts::Grid::putLayout | ( | const std::initializer_list< ColumnText > | text | ) |
Write one line of text in the columns layout.
| [in] | text | Content of the columns. There should be no element for Border() columns. For Left() and Right() column, only one text shall be set. For Both() layout, the two texts shall be set. |
|
staticconstexpr |
Default report line width.
|
staticconstexpr |
Default margin width.