Colorized output.
More...
#include <Color.h>
|
| enum | C : unsigned {
BLACK = 30,
RED = 31,
GREEN = 32,
YELLOW = 33,
BLUE = 34,
MAGENTA = 35,
CYAN = 36,
WHITE = 37,
COL256 = 38,
DEFAULT = 39
} |
| | Predefined colors.
|
| |
| enum | Ctrl { NoNL,
NL
} |
| | Controls for Color.
|
| |
|
| | Color (enum C c=DEFAULT) noexcept |
| | New Color stream (stdout) using color c. More...
|
| |
| | Color (std::ostream &os, enum C c=DEFAULT) noexcept |
| | New Color stream (into os) using color c. More...
|
| |
| | Color (unsigned char r, unsigned char g, unsigned char b) noexcept |
| | New Color stream (stdout) using an RGB color. More...
|
| |
| | Color (std::ostream &os, unsigned char r, unsigned char g, unsigned char b) noexcept |
| | New Color stream (into os) using an RGB color. More...
|
| |
| std::ostream & | os () |
| | Return current output stream. More...
|
| |
| void | ctrl (Ctrl ctrl) |
| | Controls the stream behavior. More...
|
| |
Colorized output.
Use like:
Clr(std::cerr, Clr::RED) << "error";
◆ Color() [1/4]
| SlHelpers::Color::Color |
( |
enum C |
c = DEFAULT | ) |
|
|
inlineexplicitnoexcept |
New Color stream (stdout) using color c.
- Parameters
-
◆ Color() [2/4]
| SlHelpers::Color::Color |
( |
std::ostream & |
os, |
|
|
enum C |
c = DEFAULT |
|
) |
| |
|
inlineexplicitnoexcept |
New Color stream (into os) using color c.
- Parameters
-
| os | Output stream where to output |
| c | A color from C |
◆ Color() [3/4]
| SlHelpers::Color::Color |
( |
unsigned char |
r, |
|
|
unsigned char |
g, |
|
|
unsigned char |
b |
|
) |
| |
|
inlinenoexcept |
New Color stream (stdout) using an RGB color.
- Parameters
-
◆ Color() [4/4]
| SlHelpers::Color::Color |
( |
std::ostream & |
os, |
|
|
unsigned char |
r, |
|
|
unsigned char |
g, |
|
|
unsigned char |
b |
|
) |
| |
|
inlinenoexcept |
New Color stream (into os) using an RGB color.
- Parameters
-
| os | Output stream where to output |
| r | Red |
| g | Green |
| b | Blue |
◆ ctrl()
| void SlHelpers::Color::ctrl |
( |
Ctrl |
ctrl | ) |
|
|
inline |
Controls the stream behavior.
- Parameters
-
| ctrl | Control character (like NoNL to not automatically emit a newline at the end) |
◆ forceColor()
| static void SlHelpers::Color::forceColor |
( |
bool |
force | ) |
|
|
inlinestatic |
◆ forceColorValue()
| static void SlHelpers::Color::forceColorValue |
( |
bool |
value | ) |
|
|
inlinestatic |
If forceColor(true) was called, use of colors is bound to value.
- Parameters
-
| value | If colors should be used |
◆ os()
| std::ostream& SlHelpers::Color::os |
( |
| ) |
|
|
inline |
Return current output stream.
- Returns
- Output stream.
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/slhelpers-20260428.f233ce9/include/helpers/Color.h