Jpp
18.2.0-rc.1
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
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:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
text
char text[TEXT_SIZE]
Definition:
elog.cc:72
std::map< int, int >
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:83
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
a
then JCalibrateToT a
Definition:
JTuneHV.sh:113
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
c
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
JParser.hh
Utility class to parse command line options.
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5