26 # define strcasecmp(arg1,arg2) stricmp(arg1,arg2) 52 fWorkingDataSet= fRootDataSet =link;
53 fMaxDepth = fDepth =1;
54 fDataSet= fgNullDataSet ;
55 fNext = link ?
new TIter(link->GetCollection() ,dir):0;
56 for(
UInt_t i = 0; i <
sizeof(fNextSet) /
sizeof(
TIter*); ++i) {
57 fNextSet[i] = (
TIter*)0;
94 for (
Int_t i = level;i>=0;i--) {
153 Error(
"Add",
"TDataSetIter.has been corrupted ;-!");
179 if (!dataset)
return 0;
181 if (path && strlen(path))
set =
Find(path);
182 return Add(dataset,
set);
203 if (strcmp(dirname,
".."))
232 while ( (nextSet = next()) )
247 if (dirname)
set =
Find(dirname);
262 if (nextset->
IsFolder()) std::cout << std::endl;
264 std::cout << std::setw(2) << next.
GetDepth() <<
". ";
267 std::cout << std::setw(10) <<
type;
268 std::cout <<
" : " << std::setw(10) << nextset->
GetTitle();
269 std::cout << std::endl;
307 if (!name || !name[0])
return 0;
308 if (strchr(name,
'/')) {
309 Error(
"FindDataSet",
"The name of the object <%s> can not contain any \"/\"",name);
317 if (path && strlen(path)) startset =
Find(path);
319 if (!startset)
return 0;
322 if ( !((opti && strcasecmp( optt ? set->GetTitle() :
set->GetName(),
name) == 0 ) ||
323 (strcmp(optt ? set->GetTitle() :
set->GetName(),
name) == 0)) )
326 while ((
set = next()))
327 if ( (opti && strcasecmp(optt ? set->GetTitle() :
set->GetName(),
name) == 0 ) ||
328 (strcmp(optt ? set->GetTitle() :
set->GetName(),
name) == 0) )
break;
348 if (path) startset =
Find(path);
350 if (!startset)
return 0;
354 while ( (nextSet = next()) )
355 if (
set == nextSet)
break;
391 if (path && path[0]) startset =
Find(path);
393 if (!startset)
return 0;
397 while ( (nextSet = next()) )
398 if (
set == nextSet)
break;
409 if (
set)
set->SetBit(flag,reset);
417 if (dataset) dataset->
SetBit(flag,reset);
435 if (!
set && dirname==0)
set=
Cwd();
436 if (
set)
set->ls(opt);
458 if (
set)
set->
ls(depth);
539 if (list && list->
GetSize() ) {
543 ,
" too many (%d) nested levels of your TDataSet has been detected",
fDepth);
596 return Find(path,rootset,mkdir);
623 TDataSet *dataset=0,*dsnext=0,*ds=0;
629 if (!name)
return rootset;
635 if (name[0] ==
'/') name++;
637 if (!strncmp(name,
".*/",3)) {anywhere=1998; name +=3;}
639 len = strcspn(name,
" /");
640 if (!len)
return dataset;
642 if (!dataset)
goto NOTFOUND;
648 nextlen = strlen(nextname);
649 if (nextlen==len && !strncmp(name,nextname,len))
650 return Find(name+len,dataset,mkdirflag,titleFlag);
658 nextname = titleFlag ? dataset->
GetTitle() : dsnext->GetName();
659 if (!nextname)
continue;
662 nextlen = strlen(nextname);
663 yes = (len == nextlen);
665 yes = !strncmp(name,nextname,len);
673 ds =
Find(name+len,dsnext,mkdirflag,titleFlag);
679 if (!anywhere)
continue;
680 ds =
Find(name,dsnext,mkdirflag,titleFlag);
687 if (mkdirflag && !titleFlag)
691 char buf[512];buf[0]=0; strncat(buf,name,len);
708 return Find(name,dataset,mkdirflag);
727 for (
int i = level;i>=0;i--) {
785 Error(
"Shunt",
"TDataSetIter.has been corrupted ;-!");
812 if (!dataset)
return 0;
814 if (path && strlen(path))
set =
Find(path);
815 return Shunt(dataset,
set);
834 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...
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
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