ATLAS Offline Software
Loading...
Searching...
No Matches
BSFilePeeker.cxx File Reference
#include <iostream>
#include <string>
#include <string_view>
#include <unistd.h>
#include "EventStorage/pickDataReader.h"
#include "FileMetaData.h"
#include "CxxUtils/checker_macros.h"
Include dependency graph for BSFilePeeker.cxx:

Go to the source code of this file.

Classes

class  BSFilePeeker

Functions

int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv)

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

int main ATLAS_NOT_THREAD_SAFE ( int argc,
char ** argv )

Definition at line 104 of file BSFilePeeker.cxx.

104 {
105
106 bool verbose=false;
107 bool kvDump=false;
108 int c;
109
110 while ((c = getopt (argc, argv, "vk")) != -1) {
111 switch (c) {
112 case 'v':
113 verbose=true;
114 break;
115 case 'k':
116 kvDump=true;
117 break;
118 default:
119 std::cerr << "Unkown command line option" << std::endl;
120 return -1;
121 }
122 }
123
124
125 const int nfiles=argc-optind;
126 if (nfiles<=0) {
127 std::cerr << "Expected at least one file name as parameter" << std::endl;
128 return -1;
129 }
130
131
132 std::vector<FileMetaData> output;
133
134 for (int iFile=optind;iFile<argc;++iFile) {
135 const std::string filename(argv[iFile]);
136 if (verbose) std::cout << "Checking file " << filename << std::endl;
137
138 BSFilePeeker bsfp(filename);
139
140 output.push_back(bsfp.get());
141 }//end loop over input file names
142
143
144 if (kvDump) {
145 for (const auto& o : output) o.keyValueDump();
146 }
147 else {
148 for (const auto& o : output) o.dump();
149 }
150
151 return 0;
152}
bool verbose
Definition hcg.cxx:75
output
Definition merge.py:16