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

Example program to test JLANG::JRedirectString class. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JLang/JRedirectString.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 JLANG::JRedirectString class.

Author
mdejong

Definition in file JRedirectString.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 18 of file JRedirectString.cc.

19 {
20  using namespace std;
21 
22  string message;
23  int debug;
24 
25  try {
26 
27  JParser<> zap("Example program to test redirection of I/O streams.");
28 
29  zap['m'] = make_field(message);
30  zap['d'] = make_field(debug) = 3;
31 
32  zap(argc, argv);
33  }
34  catch(const exception &error) {
35  FATAL(error.what() << endl);
36  }
37 
38 
39  using namespace JPP;
40 
41  string buffer;
42 
43  {
44  JRedirectString redirect(cin, message);
45 
46  getline(cin, buffer);
47  }
48 
49  DEBUG("Message " << message << endl);
50  DEBUG("Redirect " << buffer << endl);
51 
52  ASSERT(message == buffer);
53 }
Utility class to parse command line options.
Definition: JParser.hh:1500
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
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