CppBenchmark  1.0.4.0
C++ Benchmark Library
console.h
Go to the documentation of this file.
1 
9 #ifndef CPPBENCHMARK_CONSOLE_H
10 #define CPPBENCHMARK_CONSOLE_H
11 
12 #include <ostream>
13 
14 namespace CppBenchmark {
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 
60 class Console
61 {
62 public:
63  Console() = delete;
64  Console(const Console&) = delete;
65  Console(Console&&) = delete;
66  ~Console() = delete;
67 
68  Console& operator=(const Console&) = delete;
69  Console& operator=(Console&&) = delete;
70 
72 
76  static void SetColor(Color color, Color background = Color::BLACK);
77 };
78 
79 } // namespace CppBenchmark
80 
81 #include "console.inl"
82 
83 #endif // CPPBENCHMARK_CONSOLE_H
Console management static class.
Definition: console.h:61
Console & operator=(const Console &)=delete
Console(const Console &)=delete
Console(Console &&)=delete
Console & operator=(Console &&)=delete
static void SetColor(Color color, Color background=Color::BLACK)
Set console text color.
Definition: console.cpp:19
Console management inline implementation.
C++ Benchmark project definitions.
Definition: barrier.h:15
TOutputStream & operator<<(TOutputStream &stream, Color color)
Stream manipulator: change console text color.
Definition: console.inl:12
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.
@ LIGHTGREEN
Light green color.
@ WHITE
White color.
@ MAGENTA
Magenta color.