25 # define strcasecmp(arg1,arg2) stricmp(arg1,arg2) 93 for (
Int_t i = level;i>=0;i--) {
152 Error(
"Add",
"TDataSetIter.has been corrupted ;-!");
178 if (!dataset)
return 0;
180 if (path && strlen(path))
set =
Find(path);
181 return Add(dataset,
set);
202 if (strcmp(dirname,
".."))
231 while ( (nextSet = next()) )
246 if (dirname)
set =
Find(dirname);
261 if (nextset->
IsFolder()) std::cout << std::endl;
263 std::cout << std::setw(2) << next.
GetDepth() <<
". ";
266 std::cout << std::setw(10) <<
type;
267 std::cout <<
" : " << std::setw(10) << nextset->
GetTitle();
268 std::cout << std::endl;
306 if (!name || !name[0])
return 0;
307 if (strchr(name,
'/')) {
308 Error(
"FindDataSet",
"The name of the object <%s> can not contain any \"/\"",name);
316 if (path && strlen(path)) startset =
Find(path);
318 if (!startset)
return 0;
321 if ( !((opti && strcasecmp( optt ? set->GetTitle() :
set->GetName(),
name) == 0 ) ||
322 (strcmp(optt ? set->GetTitle() :
set->GetName(),
name) == 0)) )
325 while ((
set = next()))
326 if ( (opti && strcasecmp(optt ? set->GetTitle() :
set->GetName(),
name) == 0 ) ||
327 (strcmp(optt ? set->GetTitle() :
set->GetName(),
name) == 0) )
break;
347 if (path) startset =
Find(path);
349 if (!startset)
return 0;
353 while ( (nextSet = next()) )
354 if (
set == nextSet)
break;
390 if (path && path[0]) startset =
Find(path);
392 if (!startset)
return 0;
396 while ( (nextSet = next()) )
397 if (
set == nextSet)
break;
408 if (
set)
set->SetBit(flag,reset);
416 if (dataset) dataset->
SetBit(flag,reset);
434 if (!
set && dirname==0)
set=
Cwd();
435 if (
set)
set->ls(opt);
457 if (
set)
set->
ls(depth);
538 if (list && list->
GetSize() ) {
542 ,
" too many (%d) nested levels of your TDataSet has been detected",
fDepth);
595 return Find(path,rootset,mkdir);
622 TDataSet *dataset=0,*dsnext=0,*ds=0;
628 if (!name)
return rootset;
634 if (name[0] ==
'/') name++;
636 if (!strncmp(name,
".*/",3)) {anywhere=1998; name +=3;}
638 len = strcspn(name,
" /");
639 if (!len)
return dataset;
641 if (!dataset)
goto NOTFOUND;
647 nextlen = strlen(nextname);
648 if (nextlen==len && !strncmp(name,nextname,len))
649 return Find(name+len,dataset,mkdirflag,titleFlag);
657 nextname = titleFlag ? dataset->
GetTitle() : dsnext->GetName();
658 if (!nextname)
continue;
661 nextlen = strlen(nextname);
662 yes = (len == nextlen);
664 yes = !strncmp(name,nextname,len);
672 ds =
Find(name+len,dsnext,mkdirflag,titleFlag);
678 if (!anywhere)
continue;
679 ds =
Find(name,dsnext,mkdirflag,titleFlag);
686 if (mkdirflag && !titleFlag)
690 char buf[512];buf[0]=0; strncat(buf,name,len);
707 return Find(name,dataset,mkdirflag);
726 for (
int i = level;i>=0;i--) {
784 Error(
"Shunt",
"TDataSetIter.has been corrupted ;-!");
811 if (!dataset)
return 0;
813 if (path && strlen(path))
set =
Find(path);
814 return Shunt(dataset,
set);
833 if (dataSet && dataSet->
HasData())
return dataSet;
virtual Bool_t Notify()
This method must be overridden to handle object notification.
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetDepth() const
virtual void Add(TDataSet *dataset)
TDataSet(const char *name, const char *title)
virtual TDataSet * Mkdir(const Char_t *dirname)
to be documented
TDataSetIter(const TDataSetIter &)
virtual TDataSet * FindByTitle(const Char_t *title, const Char_t *path="", Option_t *opt="")
to be documented
virtual Int_t Flag(UInt_t flag=TDataSet::kMark, TDataSet::EBitOpt reset=TDataSet::kSet)
virtual TDataSet * Shunt(TDataSet *set)
virtual void ls(Option_t *option="") const
// ls(Option_t <em>option) // // option - defines the path to be listed // = "</em>" - means print al...
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual TDataSet * Cd(const Char_t *dirname)
// TDataSet *TDataSetIter::Cd(const Char_t *dirname) // // Change the current working directory to di...
virtual TDataSet * Next(TDataSet::EDataSetPass mode=TDataSet::kContinue)
returns the pointer the "next" TDataSet object = 0 if all objects have been returned.
virtual TDataSet * FindByPath(const Char_t *path, TDataSet *rootset=0, Bool_t mkdir=kFALSE)
to be documented
virtual TDataSet * Dir(Char_t *dirname)
Print the names of the TDataSet objects for the datatset named with "dirname" apart of TDataSet::Ls()...
virtual TDataSet * FindByPointer(TDataSet *set, const Char_t *path=0, Option_t *opt="")
Check whether the object does belong the TDataSet defined with "path" opt = "-l" - check the "referen...
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
TDataSet * NextDataSet(TIter &next)
to be documented
TDataSet * fWorkingDataSet
virtual TDataSet * Instance() const
apply the class default ctor to instantiate a new object of the same kind.
Sequenceable collection abstract base class.
static TDataSet * fgNullDataSet
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
virtual TDataSet * operator[](const Char_t *path)
operator [] returns the pointer to the TDataSet if it does contain any data (TTable for example) ...
virtual void Reset(TDataSet *l=0, Int_t depth=0)
TDataSet *l != 0 means the new start pointer depth != 0 means the new value for the depth otherwise t...
virtual Int_t Du() const
summarize dataset usage by Herb Ward proposal
virtual ~TDataSetIter()
to be documented
virtual TDataSet * FindByName(const Char_t *name, const Char_t *path="", Option_t *opt="")
to be documented
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TDataSet * Find(const char *path) const
Full description see: TDataSetIter::Find.
virtual TString Path() const
return the full path of this data set
TDataSet * GetNullSet()
return a fake pointer == -1 casted to (TDataSet *)
virtual TDataSet * Rmdir(TDataSet *dataset, Option_t *option="")
Remove the TDataSet *dataset from the current dataset If the current dataset is the deleted dataset t...
static constexpr double s
virtual TDataSet * FindDataSet(const Char_t *name, const Char_t *path="", Option_t *opt="")
FindDataSet looks for the object with the name supplied across dataset.
virtual void Shunt(TDataSet *newParent=0)
Remove the object from the original and add it to dataset TDataSet dataset != 0 - Make this object th...
virtual TDataSet * Add(TDataSet *set)
Mother of all ROOT objects.
virtual TDataSet * Find(const Char_t *path, TDataSet *rootset=0, Bool_t mkdir=kFALSE, Bool_t titleFlag=kFALSE)
// titleFlag = kFALSE; use object name as key (by default) // kTRUE; use object title as key and igno...
Short_t Max(Short_t a, Short_t b)
virtual TDataSet * Ls(const Char_t *dirname="", Option_t *opt="") const
Ls(const Char_t *dirname,Option_t)
virtual Long_t HasData() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual TDataSet * Cwd() const
virtual TObject * FindObject(const Char_t *name) const
This method is not recommended.
virtual TSeqCollection * GetCollection() const
virtual TDataSet * operator*() const
operator *
virtual const char * GetTitle() const
Returns title of object.
virtual TDataSet * GetParent() const
const char * Data() const