Jpp  18.2.1-ARCA-DF-PATCH
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
JColorFacet.hh File Reference
#include <locale>
#include <ostream>
#include <string>
#include <vector>
#include <map>
#include "JLang/JType.hh"
#include "JLang/JTypeList.hh"
#include "JLang/JSinglePointer.hh"
#include "JLang/JException.hh"

Go to the source code of this file.

Classes

struct  JLANG::JColorFacet
 Facet interface to specify text color. More...
 
struct  JLANG::JColorFacetASCII
 Facet class to specify text color for ASCII. More...
 
struct  JLANG::JColorFacetELcode
 Facet class to specify text color for ELcode. More...
 
struct  JLANG::JColorFacetMap_t
 Auxiliary map for color facets. More...
 

Namespaces

 JLANG
 Auxiliary classes and methods for language specific functionality.
 
 JPP
 This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 

Typedefs

typedef JTYPELIST
< JColorFacetASCII,
JColorFacetELcode >::typelist 
JLANG::JColorFacetTypes_t
 Typelist of color facets. More...
 

Enumerations

enum  JLANG::JColor_t {
  JLANG::RED, JLANG::GREEN, JLANG::BLUE, JLANG::WHITE,
  JLANG::CYAN, JLANG::PURPLE, JLANG::YELLOW, JLANG::RESET,
  JLANG::BOLD
}
 Enumeration of text colors. More...
 

Functions

std::ostream & operator<< (std::ostream &out, const JLANG::JColor_t color)
 Print color. More...
 

Variables

static const JColorFacetMap_t JLANG::color_facets
 Color facets. More...
 

Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const JLANG::JColor_t  color 
)
inline

Print color.

Parameters
outoutput stream
colorcolor
Returns
output stream

Definition at line 343 of file JColorFacet.hh.

344 {
345  using namespace std;
346  using namespace JPP;
347 
348  const locale& loc = out.getloc();
349 
350  if (has_facet<JColorFacetASCII>(loc))
351  return out << use_facet<JColorFacetASCII> (loc).c_str(color);
352  else if (has_facet<JColorFacetELcode>(loc))
353  return out << use_facet<JColorFacetELcode>(loc).c_str(color);
354  else
355  return out << JColorFacetASCII().c_str(color);
356 }
virtual const char * c_str(const JColor_t color) const override
Print color.
Definition: JColorFacet.hh:153
char * loc(char *orig)
Facet class to specify text color for ASCII.
Definition: JColorFacet.hh:123