Jpp
17.0.0
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
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
58
{
59
string
buffer =
MAKE_STRING
(
"hello world "
<< 1 <<
' '
<< 123.456);
60
61
cout << buffer << endl;
62
}
63
64
{
65
const
char
*
const
buffer =
MAKE_CSTRING
(
"hello world "
<< 1 <<
' '
<< 123.456);
66
67
cout << buffer << endl;
68
}
69
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
std::map< int, int >
MAKE_CSTRING
#define MAKE_CSTRING(A)
Make C-string.
Definition:
JPrint.hh:151
std::vector< int >
MAKE_STRING
#define MAKE_STRING(A)
Make string.
Definition:
JPrint.hh:142
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:66
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.
Generated by
1.8.5