Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
Jeep
examples/Jeep/JPrint.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
#include <vector>
5
#include <map>
6
7
#include "
Jeep/JPrint.hh
"
8
9
#include "
Jeep/JParser.hh
"
10
#include "
Jeep/JMessage.hh
"
11
12
/**
13
* \file
14
* Example program to test print auxiliaries.
15
* \author mdejong
16
*/
17
int
main
(
int
argc,
char
* argv[])
18
{
19
using namespace
std;
20
using namespace
JPP;
21
22
int
debug
;
23
24
try
{
25
26
JParser<>
zap;
27
28
zap[
'd'
] =
make_field
(
debug
) = 1;
29
30
zap(argc, argv);
31
}
32
catch
(
const
exception &error) {
33
FATAL
(error.what() << endl);
34
}
35
36
{
37
vector<int>
buffer;
38
39
for
(
int
i = 0; i != 10; ++i) {
40
buffer.push_back(i);
41
}
42
43
//cout << buffer << endl; // compiler error
44
cout <<
"JEEPZ "
<<
JEEPZ
() << buffer << endl;
45
}
46
47
{
48
map<int, int>
buffer;
49
50
for
(
int
i = 0; i != 10; ++i) {
51
buffer[i] = i*i;
52
}
53
54
//cout << buffer << endl; // compiler error
55
cout <<
"JEEPZ "
<<
JEEPZ
() << buffer << endl;
56
}
57
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
std::map< int, int >
std::vector< int >
JPrint.hh
I/O formatting auxiliaries.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
debug
int debug
debug level
Definition:
JSirene.cc:63
JEEPZ
Auxiliary data structure for streaming of STL containers.
Definition:
JPrint.hh:65
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5