Jpp  18.0.0-rc.4
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 "JROOT/JASCIIFileStreamer.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 86 of file JRootDB.cc.

87 {
88  using namespace std;
89  using namespace JPP;
90 
91  typedef JDBTypes_t typelist;
92 
93  string inputFile;
94  string outputFile;
95  JROOTClassSelector selector;
96  int debug;
97 
98  try {
99 
100  JParser<> zap("Auxiliary program to convert ASCII data from data base into ROOT format.");
101 
102  zap['f'] = make_field(inputFile, "ASCII formatted input file."\
103  "\nFirst line should list data members of data structure given at option -C");
104  zap['o'] = make_field(outputFile);
105  zap['C'] = make_field(selector, "name of data structure") = getROOTClassSelection<typelist>();
106  zap['d'] = make_field(debug) = 1;
107 
108  zap['C'] = JPARSER::not_initialised();
109 
110  zap(argc, argv);
111  }
112  catch(const exception &error) {
113  FATAL(error.what() << endl);
114  }
115 
116  IO io;
117 
118  for_each<typelist>(io);
119 
120  io[selector]->copy(inputFile, outputFile);
121 }
Utility class to parse command line options.
Definition: JParser.hh:1514
Auxiliary class to select ROOT class based on class name.
string outputFile
Type list.
Definition: JTypeList.hh:22
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#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