Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
Jeep
JParser.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <iomanip>
3
#include <string>
4
#include <map>
5
6
#include "
Jeep/JParser.hh
"
7
#include "
Jeep/JMessage.hh
"
8
9
10
/**
11
* \file
12
*
13
* Example program to test JPARSER::JParser.
14
* \author mdejong
15
*/
16
int
main
(
int
argc,
char
**argv)
17
{
18
using namespace
std;
19
20
string
text
;
21
bool
a
, b, c;
22
map<int, int>
buffer;
23
int
debug
;
24
25
try
{
26
27
JParser<>
zap(
"Example program to test command line parser."
);
28
29
zap[
'T'
] =
make_field
(
text
,
"this is some text"
);
30
zap[
'a'
] =
make_field
(
a
);
// default set to false; not mandatory to set
31
zap[
'b'
] =
make_field
(b);
// default set to false; not mandatory to set
32
zap[
'c'
] =
make_field
(c);
// default set to false; not mandatory to set
33
zap[
'!'
] =
make_field
(buffer) =
JPARSER::initialised
();
// not mandatory to set
34
zap[
'd'
] =
make_field
(
debug
) = 3, 0, 1, 2;
// default value, and possible values
35
36
zap(argc, argv);
37
}
38
catch
(
const
exception &error) {
39
FATAL
(error.what() << endl);
40
}
41
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
text
char text[TEXT_SIZE]
Definition:
elog.cc:72
std::map
Definition:
JSTDTypes.hh:16
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:63
a
fi JEventTimesliceWriter a
Definition:
JEventProcessor.sh:71
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
debug
int debug
debug level
Definition:
JSirene.cc:61
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