Jpp  18.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
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. More...
 
virtual const char * c_str (const JColor_t color) const =0
 Print color. More...
 
virtual JColorFacetclone () const =0
 Clone this facet. More...
 

Static Public Member Functions

static bool is_color (const int color)
 Check color. More...
 
static bool is_bold (const int color)
 Check bold. More...
 
static bool is_reset (const int color)
 Check reset. More...
 

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

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  {}
JLANG::JColorFacet::JColorFacet ( const JColorFacet )
private

Member Function Documentation

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

Print color.

Parameters
colorcode
Returns
text

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

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

Clone this facet.

Returns
pointer to newly created facet

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

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_bold(const int color)
Check bold.
Definition: JColorFacet.hh:97
static bool is_reset(const int color)
Check reset.
Definition: JColorFacet.hh:109
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  }
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  }
void JLANG::JColorFacet::operator= ( const JColorFacet )
private

Member Data Documentation

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: