Facet class to specify text color for ASCII.
More...
#include <JColorFacet.hh>
|
static const char * | getName () |
| Get name of facet.
|
|
static bool | is_color (const int color) |
| Check color.
|
|
static bool | is_bold (const int color) |
| Check bold.
|
|
static bool | is_reset (const int color) |
| Check reset.
|
|
|
static std::locale::id | id |
|
Facet class to specify text color for ASCII.
Definition at line 123 of file JColorFacet.hh.
◆ JColorFacetASCII()
JLANG::JColorFacetASCII::JColorFacetASCII |
( |
std::size_t | refs = 0 | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 142 of file JColorFacet.hh.
142 :
144 {}
JColorFacet(std::size_t refs=0)
Constructor.
◆ getName()
static const char * JLANG::JColorFacetASCII::getName |
( |
| ) |
|
|
inlinestatic |
Get name of facet.
- Returns
- name
Definition at line 131 of file JColorFacet.hh.
132 {
133 return "ASCII";
134 }
◆ c_str()
virtual const char * JLANG::JColorFacetASCII::c_str |
( |
const JColor_t | color | ) |
const |
|
inlineoverridevirtual |
Print color.
- Parameters
-
- Returns
- text
Implements JLANG::JColorFacet.
Definition at line 153 of file JColorFacet.hh.
154 {
155 switch (color) {
156 case RED:
return "\033[91m";
157 case GREEN:
return "\033[92m";
158 case BLUE:
return "\033[94m";
159 case WHITE:
return "\033[97m";
160 case CYAN:
return "\033[96m";
161 case PURPLE:
return "\033[95m";
162 case YELLOW:
return "\033[93m";
163 case BOLD:
return "\033[1m";
164 case RESET:
return "\033[0m";
165 default: return "";
166 }
167 }
◆ clone()
Clone this facet.
- Returns
- pointer to newly created facet
Implements JLANG::JColorFacet.
Definition at line 175 of file JColorFacet.hh.
176 {
178 }
JColorFacetASCII(std::size_t refs=0)
Constructor.
◆ is_color()
static bool JLANG::JColorFacet::is_color |
( |
const int | color | ) |
|
|
inlinestaticinherited |
Check color.
- Parameters
-
- Returns
- true if color; else false
Definition at line 85 of file JColorFacet.hh.
86 {
88 }
static bool is_reset(const int color)
Check reset.
static bool is_bold(const int color)
Check bold.
◆ is_bold()
static bool JLANG::JColorFacet::is_bold |
( |
const int | color | ) |
|
|
inlinestaticinherited |
Check bold.
- Parameters
-
- Returns
- true if bold; else false
Definition at line 97 of file JColorFacet.hh.
◆ is_reset()
static bool JLANG::JColorFacet::is_reset |
( |
const int | color | ) |
|
|
inlinestaticinherited |
Check reset.
- Parameters
-
- Returns
- true if reset; else false
Definition at line 109 of file JColorFacet.hh.
110 {
111 return color ==
RESET;
112 }
◆ id
std::locale::id JLANG::JColorFacet::id |
|
staticinherited |
The documentation for this struct was generated from the following file: