SNode.C
Loading...
Searching...
No Matches
Color Namespace Reference

Enumerations

enum class  Code {
  FG_DEFAULT = 39 , FG_BLACK = 30 , FG_RED = 31 , FG_GREEN = 32 ,
  FG_YELLOW = 33 , FG_BLUE = 34 , FG_MAGENTA = 35 , FG_CYAN = 36 ,
  FG_LIGHT_GRAY = 37 , FG_DARK_GRAY = 90 , FG_LIGHT_RED = 91 , FG_LIGHT_GREEN = 92 ,
  FG_LIGHT_YELLOW = 93 , FG_LIGHT_BLUE = 94 , FG_LIGHT_MAGENTA = 95 , FG_LIGHT_CYAN = 96 ,
  FG_WHITE = 97 , BG_RED = 41 , BG_GREEN = 42 , BG_BLUE = 44 ,
  BG_DEFAULT = 49
}

Functions

std::ostream & operator<< (std::ostream &os, const Code &code)
std::string operator+ (const std::string &string, const Code &code)
std::string operator+ (const Code &code, const std::string &string)

Enumeration Type Documentation

◆ Code

enum class Color::Code
strong
Enumerator
FG_DEFAULT 
FG_BLACK 
FG_RED 
FG_GREEN 
FG_YELLOW 
FG_BLUE 
FG_MAGENTA 
FG_CYAN 
FG_LIGHT_GRAY 
FG_DARK_GRAY 
FG_LIGHT_RED 
FG_LIGHT_GREEN 
FG_LIGHT_YELLOW 
FG_LIGHT_BLUE 
FG_LIGHT_MAGENTA 
FG_LIGHT_CYAN 
FG_WHITE 
BG_RED 
BG_GREEN 
BG_BLUE 
BG_DEFAULT 

Definition at line 57 of file Logger.h.

57 {
58 FG_DEFAULT = 39,
59 FG_BLACK = 30,
60 FG_RED = 31,
61 FG_GREEN = 32,
62 FG_YELLOW = 33,
63 FG_BLUE = 34,
64 FG_MAGENTA = 35,
65 FG_CYAN = 36,
66 FG_LIGHT_GRAY = 37,
67 FG_DARK_GRAY = 90,
68 FG_LIGHT_RED = 91,
69 FG_LIGHT_GREEN = 92,
70 FG_LIGHT_YELLOW = 93,
71 FG_LIGHT_BLUE = 94,
73 FG_LIGHT_CYAN = 96,
74 FG_WHITE = 97,
75 BG_RED = 41,
76 BG_GREEN = 42,
77 BG_BLUE = 44,
78 BG_DEFAULT = 49
79 };
@ FG_LIGHT_CYAN
Definition Logger.h:73
@ BG_DEFAULT
Definition Logger.h:78
@ FG_LIGHT_YELLOW
Definition Logger.h:70
@ FG_LIGHT_GREEN
Definition Logger.h:69
@ FG_DARK_GRAY
Definition Logger.h:67
@ FG_LIGHT_RED
Definition Logger.h:68
@ FG_LIGHT_GRAY
Definition Logger.h:66
@ FG_LIGHT_MAGENTA
Definition Logger.h:72
@ FG_LIGHT_BLUE
Definition Logger.h:71
@ FG_YELLOW
Definition Logger.h:62
@ FG_DEFAULT
Definition Logger.h:58
@ FG_MAGENTA
Definition Logger.h:64

Function Documentation

◆ operator+() [1/2]

std::string Color::operator+ ( const Code & code,
const std::string & string )

Definition at line 308 of file Logger.cpp.

308 {
309 return (!logger::Logger::disableColorLog ? ("\033[" + std::to_string(static_cast<int>(code)) + "m") : "") + string;
310}
static bool disableColorLog
Definition Logger.h:113

References logger::Logger::disableColorLog.

Referenced by anonymous_namespace{Logger.cpp}::colorizeLevel().

Here is the caller graph for this function:

◆ operator+() [2/2]

std::string Color::operator+ ( const std::string & string,
const Code & code )

Definition at line 304 of file Logger.cpp.

304 {
305 return string + (!logger::Logger::disableColorLog ? ("\033[" + std::to_string(static_cast<int>(code)) + "m") : "");
306}

References logger::Logger::disableColorLog.

Referenced by anonymous_namespace{Logger.cpp}::colorizeLevel(), utils::createCommandLineOptions(), and CLI::ConfigFormatter::to_config().

Here is the caller graph for this function:

◆ operator<<()

std::ostream & Color::operator<< ( std::ostream & os,
const Code & code )

Definition at line 300 of file Logger.cpp.

300 {
301 return os << (!logger::Logger::disableColorLog ? ("\033[" + std::to_string(static_cast<int>(code)) + "m") : "");
302}

References logger::Logger::disableColorLog.