Skip to content
Snippets Groups Projects
Commit fe9c3a8b authored by Rene Brun's avatar Rene Brun
Browse files

From Matevz:

I put the self-printing and indent control to TCollection::ls().


git-svn-id: http://root.cern.ch/svn/root/trunk@21834 27541ba8-7e3a-0410-8455-c3a389f83636
parent 80e1853b
No related branches found
No related tags found
No related merge requests found
......@@ -242,12 +242,15 @@ void TCollection::ls(Option_t *option) const
// Wildcarding supported, eg option="xxx*" lists only objects
// with names xxx*.
TObject::ls(option);
TRegexp re(option,kTRUE);
TIter next(this);
TObject *object;
char *star = 0;
if (option) star = (char*)strchr(option,'*');
TROOT::IncreaseDirLevel();
while ((object = next())) {
if (star) {
TString s = object->GetName();
......@@ -255,6 +258,7 @@ void TCollection::ls(Option_t *option) const
}
object->ls(option);
}
TROOT::DecreaseDirLevel();
}
//______________________________________________________________________________
......@@ -272,6 +276,8 @@ void TCollection::Print(Option_t *wildcard) const
// Wildcarding is supported, e.g. wildcard="xxx*" prints only objects
// with names matching xxx*.
TObject::Print(wildcard);
if (!wildcard) wildcard = "";
TRegexp re(wildcard, kTRUE);
Int_t nch = strlen(wildcard);
......@@ -281,7 +287,7 @@ void TCollection::Print(Option_t *wildcard) const
while ((object = next())) {
TString s = object->GetName();
if (nch && s != wildcard && s.Index(re) == kNPOS) continue;
object->Print();
object->Print(wildcard);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment