|
Uni20
Asynchronous tensor and runtime library.
|
A small report table builder for command-line examples and diagnostics. More...
#include <presentation.hpp>
Public Member Functions | |
| table_border_options const & | border_options () const noexcept |
| Return table border and rule options. | |
| report_table & | border_style (table_rule_style style) |
| Set the rule style used by automatic borders and separators. | |
| report_table & | borders (table_border_options options) |
| Set table border and rule options. | |
| report_table & | column (std::string heading, table_alignment alignment=table_alignment::right) |
| Add a column to the table. | |
| report_table & | column_separators (bool enabled=true) |
| Enable or disable vertical rules between columns. | |
| std::vector< table_column > const & | columns () const noexcept |
| Return the column specifications. | |
| std::vector< table_entry > const & | entries () const noexcept |
| Return table entries, including row and separator entries. | |
| report_table & | grid (bool enabled=true) |
| Enable or disable a full table grid. | |
| report_table & | grid (table_rule_style style) |
| Enable a full table grid with a specific rule style. | |
| report_table & | header_separator (bool enabled=true) |
| Enable or disable a horizontal rule after the heading row. | |
| report_table & | outer_border (bool enabled=true) |
| Enable or disable an outer border around the table. | |
| report_table & | preserve_tokens (bool enabled=true) |
| Wrap only at whitespace, allowing the table to exceed the requested width to preserve tokens. | |
| bool | preserves_tokens () const noexcept |
| Whether column fitting must keep whitespace-delimited tokens intact. | |
| report_table (std::string title={}) | |
| Construct a titled report table. | |
| report_table & | row (std::initializer_list< table_cell > cells) |
| Add a row from table cell specifications. | |
| report_table & | row (std::vector< std::string > cells) |
| Add a row from already formatted cell strings. | |
| report_table & | row (std::vector< table_cell > cells) |
| Add a row from table cell specifications. | |
| template<typename... Values> | |
| report_table & | row (Values const &... values) |
Add a row by formatting each value with fmt. | |
| report_table & | row_separators (bool enabled=true) |
| Enable or disable horizontal rules between rows. | |
| report_table & | separator (table_rule_style style=table_rule_style::single) |
| Insert a separator at the current body position. | |
| std::string const & | title () const noexcept |
| Return the table title. | |
| report_table & | top_separator (table_rule_style style=table_rule_style::single) |
| Insert a separator before the generated heading row. | |
| std::vector< table_rule_style > const & | top_separators () const noexcept |
| Return explicit separators rendered before the heading row. | |
A small report table builder for command-line examples and diagnostics.
|
explicit |
Construct a titled report table.
| title | Human-readable table title. |
|
noexcept |
Return table border and rule options.
| report_table & uni20::presentation::report_table::border_style | ( | table_rule_style | style | ) |
Set the rule style used by automatic borders and separators.
| style | Rule glyph style to use. |
| report_table & uni20::presentation::report_table::borders | ( | table_border_options | options | ) |
Set table border and rule options.
| options | Border and rule controls to apply. |
| report_table & uni20::presentation::report_table::column | ( | std::string | heading, |
| table_alignment | alignment = table_alignment::right |
||
| ) |
Add a column to the table.
| heading | Column heading text. |
| alignment | Cell alignment for this column. |
| report_table & uni20::presentation::report_table::column_separators | ( | bool | enabled = true | ) |
Enable or disable vertical rules between columns.
| enabled | Whether to draw column separators. |
|
noexcept |
Return the column specifications.
|
noexcept |
Return table entries, including row and separator entries.
| report_table & uni20::presentation::report_table::grid | ( | bool | enabled = true | ) |
Enable or disable a full table grid.
| enabled | Whether to draw outer, column, row, and heading rules. |
| report_table & uni20::presentation::report_table::grid | ( | table_rule_style | style | ) |
Enable a full table grid with a specific rule style.
| style | Rule glyph style to use. |
| report_table & uni20::presentation::report_table::header_separator | ( | bool | enabled = true | ) |
Enable or disable a horizontal rule after the heading row.
| enabled | Whether to draw the heading separator. |
| report_table & uni20::presentation::report_table::outer_border | ( | bool | enabled = true | ) |
Enable or disable an outer border around the table.
| enabled | Whether to draw the border. |
| report_table & uni20::presentation::report_table::preserve_tokens | ( | bool | enabled = true | ) |
Wrap only at whitespace, allowing the table to exceed the requested width to preserve tokens.
Disabled by default. Applies to headings and cells, including cells spanning multiple columns.
|
noexcept |
Whether column fitting must keep whitespace-delimited tokens intact.
| report_table & uni20::presentation::report_table::row | ( | std::initializer_list< table_cell > | cells | ) |
Add a row from table cell specifications.
| cells | Cell specifications in column order. |
| report_table & uni20::presentation::report_table::row | ( | std::vector< std::string > | cells | ) |
Add a row from already formatted cell strings.
| cells | Cell text in column order. |
| report_table & uni20::presentation::report_table::row | ( | std::vector< table_cell > | cells | ) |
Add a row from table cell specifications.
| cells | Cell specifications in column order. |
|
inline |
Add a row by formatting each value with fmt.
| Values | Cell value types. |
| values | Values to format into cell text. |
| report_table & uni20::presentation::report_table::row_separators | ( | bool | enabled = true | ) |
Enable or disable horizontal rules between rows.
| enabled | Whether to draw row separators. |
| report_table & uni20::presentation::report_table::separator | ( | table_rule_style | style = table_rule_style::single | ) |
Insert a separator at the current body position.
| style | Rule glyph style to use. |
|
noexcept |
Return the table title.
| report_table & uni20::presentation::report_table::top_separator | ( | table_rule_style | style = table_rule_style::single | ) |
Insert a separator before the generated heading row.
| style | Rule glyph style to use. |
|
noexcept |
Return explicit separators rendered before the heading row.