21 #include "TObjString.h" 44 ThrowError(66,0,
"!!! ERROR: Cannot open source %s!!!", GetName());
61 ThrowError(66,0,
"!!! ERROR: Cannot open source %s!!!", GetName());
91 if (!mask || (strlen(mask) == 0))
return nullptr;
93 TString dirname, basename(mask);
95 if (!basename.MaybeWildcard()) {
101 TList *lst =
new TList();
102 lst->SetOwner(kTRUE);
103 lst->Add(
new TObjString(basename));
107 Bool_t withdir = kFALSE;
108 Int_t slash = basename.Last(
'/');
111 if (slash < 0) slash = basename.Last(
'\\');
115 dirname = basename(0, slash);
116 basename.Remove(0, slash+1);
119 dirname = gSystem->WorkingDirectory();
122 void *dir = gSystem->OpenDirectory(gSystem->ExpandPathName(dirname.Data()));
124 if (!dir)
return nullptr;
126 TList *lst =
nullptr;
128 TRegexp re(basename, kTRUE);
129 const char *file =
nullptr;
130 while ((file = gSystem->GetDirEntry(dir)) !=
nullptr) {
131 if (!strcmp(file,
".") || !strcmp(file,
".."))
continue;
133 if ((basename != s) && (s.Index(re) == kNPOS))
continue;
136 lst->SetOwner(kTRUE);
139 lst->Add(
new TObjString(dirname +
"/" + file));
141 lst->Add(
new TObjString(file));
143 gSystem->FreeDirectory(dir);
145 if (lst) lst->Sort();
165 TIter iter(
fxFile->GetListOfKeys());
166 while (
auto kee = dynamic_cast<TKey *>(iter())) {
167 fxTree =
dynamic_cast<TTree *
>(kee->ReadObj());
171 ThrowError(77,0,
"!!! ERROR: Tree not found !!!");
201 if(!dest)
ThrowError(0,22,
"!!! ERROR BuildEvent: no destination event!!!");
void ThrowEOF(Int_t creastat, Int_t errstat, const char *message,...)
Bool_t BuildEvent(TGo4EventElement *dest) override
static void Info(const char *text,...) GO4_PRINTF_ARGS
virtual ~TGo4FileSource()
void SetCreateStatus(Int_t status)
TGo4EventElement * fxTopEvent
virtual void synchronizeWithTree(TTree *tree, TGo4EventElement **var_ptr=nullptr)
void ThrowError(Int_t creastat, Int_t errstat, const char *message,...)
TString fxCurrentFileName
Bool_t CloseCurrentFile()
static TList * ProducesFilesList(const char *mask)
static const char * fgcFILESUF