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

Auxiliary program to convert ASCII data from data base into ROOT format. More...

#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <memory>
#include "JDB/JSupport.hh"
#include "JDB/JDBincludes.hh"
#include "JDB/JDBDictionary.hh"
#include "JROOT/JRootStreamer.hh"
#include "JROOT/JRootDictionary.hh"
#include "JROOT/JROOTClassSelector.hh"
#include "JLang/JNullStream.hh"
#include "JSupport/JFileRecorder.hh"
#include "Jeep/JeepToolkit.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

Auxiliary program to convert ASCII data from data base into ROOT format.

Author
mdejong

Definition in file JRootDB.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 120 of file JRootDB.cc.

121 {
122  using namespace std;
123  using namespace JPP;
124 
125  typedef JDBTypes_t typelist;
126 
127  string inputFile;
128  string outputFile;
129  JROOTClassSelector selector;
130  int debug;
131 
132  try {
133 
134  JParser<> zap("Auxiliary program to convert ASCII data from data base into ROOT format.");
135 
136  zap['f'] = make_field(inputFile, "ASCII formatted input file."\
137  "\nFirst line should list data members of data structure given at option -C");
138  zap['o'] = make_field(outputFile);
139  zap['C'] = make_field(selector, "name of data structure") = getROOTClassSelection<typelist>();
140  zap['d'] = make_field(debug) = 1;
141 
142  zap['C'] = JPARSER::not_initialised();
143 
144  zap(argc, argv);
145  }
146  catch(const exception &error) {
147  FATAL(error.what() << endl);
148  }
149 
150  IO io;
151 
152  for_each(io, JType<typelist>());
153 
154  io[selector]->copy(inputFile, outputFile);
155 }
Utility class to parse command line options.
Definition: JParser.hh:1517
Auxiliary class to select ROOT class based on class name.
Auxiliary class for a type holder.
Definition: JType.hh:19
string outputFile
Type list.
Definition: JTypeList.hh:22
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1993
JObject_t & for_each(JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist)
For each data type method.
Definition: JTypeList.hh:415
#define FATAL(A)
Definition: JMessage.hh:67
Empty structure for specification of parser element that is not initialised (i.e. does require input)...
Definition: JParser.hh:89
int debug
debug level