31 cout <<
"Invalid file name (0)" << endl;
46 m_file =
new TFile(filename);
48 cout <<
"Cannot open "<<filename << endl;
56 cout <<
"Cannot change to directory " <<
rootDir << endl;
78 cout <<
"Skipping " << s << endl;
82 if (
m_verbose) cout <<
"Reading directory "<< dir.GetPath() << endl;
85 TList* dirList = dir.GetListOfKeys();
90 while ((key = (TKey*)next())) {
93 TString className(key->GetClassName());
94 if (className==
"TDirectoryFile" || className==
"TDirectory") {
95 dir.cd(key->GetName());
112 cout <<
"--- processKey: " << key.GetName()
113 <<
" in directory " << dir.GetPath() << endl;
120 if (
m_skipDirs.Contains(dir.GetName()))
return kTRUE;
131 Bool_t failMatch(kFALSE);
132 Bool_t passMatch(kFALSE);
135 if (
re.Match(name)>0) {
143 if (
re.Match(name)>0) {
151 else result = (failMatch && !passMatch);
180 TString s(dir.GetPath());
181 if (s.Index(
"../")==0) s.Remove(0,3);
182 s.ReplaceAll(
":",
"");
190 TString s(dir.GetPath()+TString(
"/")+key.GetName());
192 s.Replace(0,s.First(
":")+2,0);
const boost::regex re(r_e)
void addFailRegexp(const char *regexp)
Skip keys that match this regexp.
void addPassRegexp(const char *regexp)
Never skip keys that match this regexp.
TString rootDir() const
Current directory.
std::vector< std::string > m_skippedObjects
void processDir(TDirectory &dir)
std::vector< TPRegexp > m_failRE
TString getKeyPath(const TDirectory &dir, const TKey &key)
virtual void beforeFile()
virtual Int_t run(const char *filename, const char *rootDir=0)
Start processing.
std::vector< TPRegexp > m_passRE
Bool_t skipObject(const char *name)
Bool_t skipDir(const TDirectory &dir)
TString getPathFromDir(const TDirectory &dir)
void processFile(const char *filename, const char *rootDir=0)
virtual void processKey(TDirectory &dir, TKey &key)
Method called for every key.