Builder for simple terminal reports with headings, status lines, fields, and tables.
More...
#include <presentation.hpp>
|
| report_builder & | field (std::string key, std::string value) |
| | Add a labeled field to the report header.
|
| |
| template<typename Value > |
| report_builder & | field (std::string key, Value const &value) |
| | Add a labeled field after formatting the value with fmt.
|
| |
| std::vector< std::pair< std::string, std::string > > const & | fields () const noexcept |
| | Return the report fields.
|
| |
| | report_builder (std::string title={}) |
| | Construct a report with an optional title.
|
| |
| report_builder & | status (semantic_glyph glyph, std::string label) |
| | Add a semantic status line such as ✓ converged.
|
| |
| std::vector< std::pair< semantic_glyph, std::string > > const & | statuses () const noexcept |
| | Return the status lines.
|
| |
| report_table & | table (std::string title) |
| | Add a titled table and return it for population.
|
| |
| std::deque< report_table > const & | tables () const noexcept |
| | Return the report tables.
|
| |
| std::string const & | title () const noexcept |
| | Return the report title.
|
| |
Builder for simple terminal reports with headings, status lines, fields, and tables.
◆ report_builder()
| uni20::presentation::report_builder::report_builder |
( |
std::string |
title = {} | ) |
|
|
explicit |
Construct a report with an optional title.
- Parameters
-
◆ field() [1/2]
| report_builder & uni20::presentation::report_builder::field |
( |
std::string |
key, |
|
|
std::string |
value |
|
) |
| |
Add a labeled field to the report header.
Rendering with a wrap width breaks values at whitespace and aligns continuation lines below the value. Indivisible tokens may exceed the width.
- Parameters
-
| key | Field label. |
| value | Already formatted field value. |
- Returns
- Reference to this report for chaining.
◆ field() [2/2]
template<typename Value >
| report_builder & uni20::presentation::report_builder::field |
( |
std::string |
key, |
|
|
Value const & |
value |
|
) |
| |
|
inline |
Add a labeled field after formatting the value with fmt.
- Template Parameters
-
- Parameters
-
| key | Field label. |
| value | Field value. |
- Returns
- Reference to this report for chaining.
◆ fields()
| std::vector< std::pair< std::string, std::string > > const & uni20::presentation::report_builder::fields |
( |
| ) |
const |
|
noexcept |
Return the report fields.
- Returns
- Immutable field vector.
◆ status()
Add a semantic status line such as ✓ converged.
- Parameters
-
| glyph | Semantic status glyph. |
| label | Status label text. |
- Returns
- Reference to this report for chaining.
◆ statuses()
| std::vector< std::pair< semantic_glyph, std::string > > const & uni20::presentation::report_builder::statuses |
( |
| ) |
const |
|
noexcept |
Return the status lines.
- Returns
- Immutable status vector.
◆ table()
| report_table & uni20::presentation::report_builder::table |
( |
std::string |
title | ) |
|
Add a titled table and return it for population.
- Parameters
-
- Returns
- Mutable table reference.
◆ tables()
| std::deque< report_table > const & uni20::presentation::report_builder::tables |
( |
| ) |
const |
|
noexcept |
Return the report tables.
- Returns
- Immutable table sequence.
◆ title()
| std::string const & uni20::presentation::report_builder::title |
( |
| ) |
const |
|
noexcept |
Return the report title.
- Returns
- Report title text.
The documentation for this class was generated from the following files: