Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JColorFacet Struct Referenceabstract

Facet interface to specify text color. More...

#include <JColorFacet.hh>

Inheritance diagram for JLANG::JColorFacet:
JLANG::JColorFacetASCII JLANG::JColorFacetELcode

Public Member Functions

 JColorFacet (std::size_t refs=0)
 Constructor.
 
virtual const char * c_str (const JColor_t color) const =0
 Print color.
 
virtual JColorFacetclone () const =0
 Clone this facet.
 

Static Public Member Functions

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 Public Attributes

static std::locale::id id
 

Private Member Functions

 JColorFacet (const JColorFacet &)
 
void operator= (const JColorFacet &)
 

Detailed Description

Facet interface to specify text color.

This class extends the std::locale::facet class.

Definition at line 46 of file JColorFacet.hh.

Constructor & Destructor Documentation

◆ JColorFacet() [1/2]

JLANG::JColorFacet::JColorFacet ( std::size_t refs = 0)
inline

Constructor.

Parameters
refsreference count

Definition at line 57 of file JColorFacet.hh.

57 :
58 std::locale::facet(refs)
59 {}

◆ JColorFacet() [2/2]

JLANG::JColorFacet::JColorFacet ( const JColorFacet & )
private

Member Function Documentation

◆ c_str()

virtual const char * JLANG::JColorFacet::c_str ( const JColor_t color) const
pure virtual

Print color.

Parameters
colorcode
Returns
text

Implemented in JLANG::JColorFacetASCII, and JLANG::JColorFacetELcode.

◆ clone()

virtual JColorFacet * JLANG::JColorFacet::clone ( ) const
pure virtual

Clone this facet.

Returns
pointer to newly created facet

Implemented in JLANG::JColorFacetASCII, and JLANG::JColorFacetELcode.

◆ is_color()

static bool JLANG::JColorFacet::is_color ( const int color)
inlinestatic

Check color.

Parameters
colorcode
Returns
true if color; else false

Definition at line 85 of file JColorFacet.hh.

86 {
87 return !is_bold(color) && !is_reset(color);
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)
inlinestatic

Check bold.

Parameters
colorcode
Returns
true if bold; else false

Definition at line 97 of file JColorFacet.hh.

98 {
99 return color == BOLD;
100 }
@ BOLD
bold

◆ is_reset()

static bool JLANG::JColorFacet::is_reset ( const int color)
inlinestatic

Check reset.

Parameters
colorcode
Returns
true if reset; else false

Definition at line 109 of file JColorFacet.hh.

110 {
111 return color == RESET;
112 }
@ RESET
reset

◆ operator=()

void JLANG::JColorFacet::operator= ( const JColorFacet & )
private

Member Data Documentation

◆ id

std::locale::id JLANG::JColorFacet::id
static
Author
mdejong

Definition at line 49 of file JColorFacet.hh.


The documentation for this struct was generated from the following files: