CppCommon  1.0.4.1
C++ Common Library
console.h
Go to the documentation of this file.
1 
9 #ifndef CPPCOMMON_SYSTEM_CONSOLE_H
10 #define CPPCOMMON_SYSTEM_CONSOLE_H
11 
12 #include <ostream>
13 
14 namespace CppCommon {
15 
17 enum class Color
18 {
19  BLACK,
20  BLUE,
21  GREEN,
22  CYAN,
23  RED,
24  MAGENTA,
25  BROWN,
26  GREY,
27  DARKGREY,
28  LIGHTBLUE,
29  LIGHTGREEN,
30  LIGHTCYAN,
31  LIGHTRED,
32  LIGHTMAGENTA,
33  YELLOW,
34  WHITE
35 };
36 
38 
43 template <class TOutputStream>
44 TOutputStream& operator<<(TOutputStream& stream, Color color);
45 
47 
52 template <class TOutputStream>
53 TOutputStream& operator<<(TOutputStream& stream, std::pair<Color, Color> colors);
54 
56 
62 class Console
63 {
64 public:
65  Console() = delete;
66  Console(const Console&) = delete;
67  Console(Console&&) = delete;
68  ~Console() = delete;
69 
70  Console& operator=(const Console&) = delete;
71  Console& operator=(Console&&) = delete;
72 
74 
78  static void SetColor(Color color, Color background = Color::BLACK);
79 };
80 
83 } // namespace CppCommon
84 
85 #include "console.inl"
86 
87 #endif // CPPCOMMON_SYSTEM_CONSOLE_H
Console management static class.
Definition: console.h:63
static void SetColor(Color color, Color background=Color::BLACK)
Set console text color.
Definition: console.cpp:19
Console & operator=(Console &&)=delete
Console(const Console &)=delete
Console & operator=(const Console &)=delete
Console(Console &&)=delete
Console management inline implementation.
C++ Common project definitions.
Definition: token_bucket.h:15
std::ostream & operator<<(std::ostream &os, const uint128_t &value)
Definition: uint128.inl:155
Color
Supported console colors.
Definition: console.h:18
@ LIGHTMAGENTA
Light magenta color.
@ BLACK
Black color.
@ BLUE
Blue color.
@ LIGHTCYAN
Light cyan color.
@ CYAN
Cyan color.
@ GREY
Grey color.
@ BROWN
Brown color.
@ DARKGREY
Dark grey color.
@ LIGHTRED
Light red color.
@ YELLOW
Yellow color.
@ LIGHTBLUE
Light blue color.
@ GREEN
Green color.
@ RED
Red color.
@ LIGHTGREEN
Light green color.
@ WHITE
White color.
@ MAGENTA
Magenta color.