1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
6 #include "base/i2-base.hpp"
16 // bit 0-7: foreground
17 Console_ForegroundBlack = 1,
18 Console_ForegroundRed = 2,
19 Console_ForegroundGreen = 3,
20 Console_ForegroundYellow = 4,
21 Console_ForegroundBlue = 5,
22 Console_ForegroundMagenta = 6,
23 Console_ForegroundCyan = 7,
24 Console_ForegroundWhite = 8,
26 // bit 8-15: background
27 Console_BackgroundBlack = 256,
28 Console_BackgroundRed = 266,
29 Console_BackgroundGreen = 267,
30 Console_BackgroundYellow = 268,
31 Console_BackgroundBlue = 269,
32 Console_BackgroundMagenta = 270,
33 Console_BackgroundCyan = 271,
34 Console_BackgroundWhite = 272,
42 Console_Autodetect = -1,
55 ConsoleColorTag(int color, ConsoleType consoleType = Console_Autodetect);
57 friend std::ostream& operator<<(std::ostream& fp, const ConsoleColorTag& cct);
64 std::ostream& operator<<(std::ostream& fp, const ConsoleColorTag& cct);
74 static void DetectType();
76 static void SetType(std::ostream& fp, ConsoleType type);
77 static ConsoleType GetType(std::ostream& fp);
80 static void PrintVT100ColorCode(std::ostream& fp, int color);
82 static void SetWindowsConsoleColor(std::ostream& fp, int color);
91 #endif /* CONSOLE_H */