Console formatter.
More...
#include <formatter.hpp>
Console formatter.
Console formatter utility in fluent API
- Author
- Vincent Lachenal
◆ Formatter()
anch::cli::Formatter::Formatter |
( |
| ) |
|
◆ ~Formatter()
virtual anch::cli::Formatter::~Formatter |
( |
| ) |
|
|
virtual |
◆ bgColor() [1/2]
Formatter & anch::cli::Formatter::bgColor |
( |
const Color & | color | ) |
|
Set background color
- Parameters
-
color | the predefined color to use |
- Returns
this
◆ bgColor() [2/2]
Formatter & anch::cli::Formatter::bgColor |
( |
const std::array< uint8_t, 3 > & | color | ) |
|
Set background color
- Parameters
-
color | the RGB color to use |
- Returns
this
◆ blink()
Formatter & anch::cli::Formatter::blink |
( |
bool | state = true | ) |
|
Set blink/unblink
- Parameters
-
state | the flag (default to true ) |
- Returns
this
◆ bold()
Formatter & anch::cli::Formatter::bold |
( |
bool | state = true | ) |
|
Set bold/unbold
- Parameters
-
state | the flag (default to true ) |
- Returns
this
◆ fgColor() [1/2]
Formatter & anch::cli::Formatter::fgColor |
( |
const Color & | color | ) |
|
Set text color
- Parameters
-
color | the predefined color to use |
- Returns
this
◆ fgColor() [2/2]
Formatter & anch::cli::Formatter::fgColor |
( |
const std::array< uint8_t, 3 > & | color | ) |
|
Set text color
- Parameters
-
color | the RGB color to use |
- Returns
this
◆ format()
Initialize formatter for fluent API usage
- Returns
- the new
Formatter
◆ reset()
Set reset flag to true
. Every other flag will be ignored.
- Returns
this
◆ underline()
Formatter & anch::cli::Formatter::underline |
( |
bool | state = true | ) |
|
Set underline/ununderline
- Parameters
-
state | the flag (default to true ) |
- Returns
this
◆ _bg_color
std::optional<Color> anch::cli::Formatter::_bg_color |
Background color (with predefined colors)
◆ _blink
std::optional<bool> anch::cli::Formatter::_blink = false |
◆ _bold
std::optional<bool> anch::cli::Formatter::_bold = false |
◆ _fg_color
std::optional<Color> anch::cli::Formatter::_fg_color |
Text color (with predefined colors)
◆ _reset
bool anch::cli::Formatter::_reset = false |
◆ _rgb_bg_color
std::optional<std::array<uint8_t,3> > anch::cli::Formatter::_rgb_bg_color |
Background color (with RGB colors)
◆ _rgb_fg_color
std::optional<std::array<uint8_t,3> > anch::cli::Formatter::_rgb_fg_color |
Text color (with RGB colors)
◆ _underline
std::optional<bool> anch::cli::Formatter::_underline = false |
◆ DISABLED
bool anch::cli::Formatter::DISABLED |
|
static |
Disable console formatter globally
The documentation for this struct was generated from the following file: