Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JParser.cc File Reference

Example program to test JPARSER::JParser. More...

#include <iostream>
#include <iomanip>
#include <string>
#include <map>
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JPARSER::JParser.

Author
mdejong

Definition in file JParser.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 16 of file JParser.cc.

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 }
Utility class to parse command line options.
Definition: JParser.hh:1500
char text[TEXT_SIZE]
Definition: elog.cc:72
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:66
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
then JCalibrateToT a
Definition: JTuneHV.sh:116