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

Example program to test JPROPERTIES::JProperties class. More...

#include <iostream>
#include <iomanip>
#include "JLang/JCategory.hh"
#include "Jeep/JProperties.hh"
#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 JPROPERTIES::JProperties class.

Author
mdejong

Definition in file JProperties-sed.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 125 of file JProperties-sed.cc.

126 {
127  using namespace std;
128 
129  string buffer;
130  string format;
131  int debug;
132 
133  try {
134 
135  JParser<> zap;
136 
137  zap['f'] = make_field(buffer);
138  zap['F'] = make_field(format);
139  zap['d'] = make_field(debug) = 3;
140 
141  zap(argc, argv);
142  }
143  catch(const exception &error) {
144  FATAL(error.what() << endl);
145  }
146 
147 
148  JABC test(10, 20, 30, 40, 50);
149 
150  ASSERT(buffer != "");
151  ASSERT(format != "");
152 
153  DEBUG("test: " << endl);
154  DEBUG(getProperties(test));
155 
156  DEBUG("processing " << buffer << endl);
157 
158  istringstream is(buffer);
159 
160  is >> getProperties(test);
161 
162  DEBUG("test: " << endl);
163  DEBUG(getProperties(test));
164 
165  DEBUG("format " << format << endl);
166 
167  JProperties properties = getProperties(test);
168 
169  DEBUG("--> " << properties.sed(format, "%") << endl);
170 
171  // output for test
172 
173  cout << properties.sed(format, "%") << flush;
174 
175  return 0;
176 }
Utility class to parse command line options.
Definition: JParser.hh:1500
JProperties & getProperties(T &object, const JEquationParameters &parameters=JEquationParameters(), const int debug=1)
Get properties of a given object.
Utility class to parse parameter values.
Definition: JProperties.hh:496
is
Definition: JDAQCHSM.chsm:167
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#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 usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG