38{
41
42 string inputFile;
44 string application;
45 string option;
48
49 try {
50
51 JParser<> zap(
"Auxiliary program to print Jpp meta data.");
52
56 zap[
'O'] =
make_field(option) = plain_t, json_t;
65
66 zap(argc, argv);
67 }
68 catch(const exception &error) {
69 FATAL(error.what() << endl);
70 }
71
72
73 if (application != "") {
74
75 TFile* in = TFile::Open(inputFile.c_str(), "exists");
76
77 if (in != NULL && in->IsOpen()) {
78
79 const TRegexp regexp(application.c_str());
80
81 TIter iter(in->GetListOfKeys());
82
83 for (TKey* key; (
key = (TKey*) iter.Next()) != NULL; ) {
84
85 const TString tag(
key->GetName());
86
87 if (tag.Contains(regexp)) {
88
89 TNamed* named =
dynamic_cast<TNamed*
>(
key->ReadObj());
90
91 if (named != NULL) {
92 cout << named->GetName() <<
"[" <<
key->GetCycle() <<
"] " << named->GetTitle() << endl;
93 }
94 }
95 }
96
97 in->Close();
98
99 } else {
100
101 ERROR(
"Error opening file: " << inputFile << endl);
102 }
103
104 } else {
105
107 JObjectMultiplexer <JMetaTypes_t> abc(in);
108
110
111 while (abc.hasNext()) {
112
113 JMeta* meta = abc.next();
114
115 if (option == plain_t) {
116
118
119 cout << (*meta) << endl;
120
121 } else {
122
123 for (const auto& i : key) {
124 cout << ' ' << (*meta)[i];
125 }
126 cout << endl;
127 }
128
129 } else if (option == json_t) {
130
132 }
133 }
134
135 if (option == json_t) {
136 cout << setw(4) << js << endl;
137 }
138 }
139}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const char *const SVNrelease_t
SVN release.
static const char *const command_t
Linux command.
static const char *const GITrelease_t
GIT release.
static const char *const namespace_t
name space
static const char *const ROOTrelease_t
ROOT release.
static const char *const system_t
system information
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.