Jpp
15.0.2
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JLang
JColor.cc
Go to the documentation of this file.
1
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
JLang/JColorFacet.hh
"
6
#include "
JLang/JVectorize.hh
"
7
8
#include "
Jeep/JParser.hh
"
9
#include "
Jeep/JMessage.hh
"
10
11
12
/**
13
* \file
14
*
15
* Example program to test JLANG::JColor class.
16
* \author mdejong
17
*/
18
int
main
(
int
argc,
char
**argv)
19
{
20
using namespace
std;
21
using namespace
JPP;
22
23
string
facet;
24
int
debug
;
25
26
try
{
27
28
JParser<>
zap(
"Example program to test color printing."
);
29
30
zap[
'F'
] =
make_field
(facet) =
get_keys
(
color_facets
);
31
zap[
'd'
] =
make_field
(
debug
) = 0;
32
33
zap(argc, argv);
34
}
35
catch
(
const
exception &error) {
36
FATAL
(error.what() << endl);
37
}
38
39
cout.imbue(locale(cout.getloc(),
color_facets
[facet]->clone()));
40
41
cout <<
RED
<<
"red"
<<
RESET
<< endl;
42
cout <<
GREEN
<<
"green"
<<
RESET
<< endl;
43
cout <<
BLUE
<<
"blue"
<<
RESET
<< endl;
44
cout <<
WHITE
<<
"white"
<<
RESET
<< endl;
45
cout <<
CYAN
<<
"cyan"
<<
RESET
<< endl;
46
cout <<
PURPLE
<<
"purple"
<<
RESET
<< endl;
47
cout <<
YELLOW
<<
"yellow"
<<
RESET
<< endl;
48
cout <<
BOLD
<<
"bold"
<<
RESET
<< endl;
49
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
JLANG::GREEN
green
Definition:
JColorFacet.hh:31
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JLANG::RESET
reset
Definition:
JColorFacet.hh:37
JColorFacet.hh
JLANG::BOLD
bold
Definition:
JColorFacet.hh:38
JLANG::color_facets
static const JColorFacetMap_t color_facets
Color facets.
Definition:
JColorFacet.hh:332
JLANG::PURPLE
purple
Definition:
JColorFacet.hh:35
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
JLANG::WHITE
white
Definition:
JColorFacet.hh:33
debug
int debug
debug level
Definition:
JSirene.cc:63
JVectorize.hh
Auxiliary methods to convert data members or return values of member methods of a set of objects to a...
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JLANG::RED
red
Definition:
JColorFacet.hh:30
JParser.hh
Utility class to parse command line options.
JLANG::YELLOW
yellow
Definition:
JColorFacet.hh:36
JLANG::get_keys
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
Definition:
JVectorize.hh:139
JLANG::CYAN
cyan
Definition:
JColorFacet.hh:34
JLANG::BLUE
blue
Definition:
JColorFacet.hh:32
Generated by
1.8.5