Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JLang
JObjectReader.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
JLang/JObjectReader.hh
"
7
#include "
JLang/JASCIIFileReader.hh
"
8
9
#include "
Jeep/JParser.hh
"
10
#include "
Jeep/JMessage.hh
"
11
12
13
/**
14
* \file
15
*
16
* Example program to test JLANG::JObjectReader class.
17
* \author mdejong
18
*/
19
int
main
(
int
argc,
char
**argv)
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
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
in
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition:
JSirene.sh:45
JObjectReader.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
debug
int debug
debug level
Definition:
JSirene.cc:61
JASCIIFileReader.hh
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5