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

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

#include <string>
#include <iostream>
#include <iomanip>
#include "JLang/JObjectReader.hh"
#include "JLang/JASCIIFileReader.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::JObjectReader class.

Author
mdejong

Definition in file JObjectReader.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 19 of file JObjectReader.cc.

20 {
21  using namespace std;
22 
23  string inputFile;
24  int debug;
25 
26  try {
27 
28  JParser<> zap("Example program to test object reading.");
29 
30  zap['f'] = make_field(inputFile);
31  zap['d'] = make_field(debug) = 0;
32 
33  zap(argc, argv);
34  }
35  catch(const exception &error) {
36  FATAL(error.what() << endl);
37  }
38 
39 
40  using namespace JPP;
41 
42  typedef std::string JType_t;
43 
44  JAccessibleObjectReader<JType_t> in;
45 
46  in.reset(new JASCIIFileReader<JType_t>());
47 
48  in.open(inputFile.c_str());
49 
50  while (in.hasNext()) {
51  cout << *(in.next()) << endl;
52  }
53 
54  in.close();
55 }
Utility class to parse command line options.
Definition: JParser.hh:1517
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1993
then awk string
#define FATAL(A)
Definition: JMessage.hh:67
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
int debug
debug level