159 std::cerr <<
"TFolder dtor called for "<<
GetName() << std::endl;
167 if (obj ==
nullptr ||
fFolders ==
nullptr)
return;
183 if (strchr(
name,
'/')) {
184 ::Error(
"TFolder::TFolder",
"folder name cannot contain a slash: %s",
name);
188 ::Error(
"TFolder::TFolder",
"folder name cannot be \"\"");
236 if (strcmp(
gFolderD[0],
"root")==0) {
249 if (
name[0] ==
'/')
return nullptr;
255 while ((obj=next())) {
264 if (found)
return found;
277 Error(
"FindFullPathname",
"Not yet implemented");
286 Error(
"FindObject",
"Not yet implemented");
308 if (
name[0] ==
'/') {
309 if (
name[1] ==
'/') {
310 if (!strstr(
name,
"//root/"))
return nullptr;
311 return gROOT->GetRootFolder()->FindObject(
name+7);
313 return gROOT->GetRootFolder()->FindObject(
name+1);
318 char *cname = csname;
319 Int_t len =
sizeof(csname);
322 cname =
new char[len];
324 strlcpy(cname,
name, len);
326 char *
slash = strchr(cname,
'/');
348 if (
name[0] ==
'/')
return nullptr;
353 while ((obj=next())) {
358 if (found)
return found;
408 while ((obj = (
TObject *) nextobj())) {
432 while ((obj=next())) {
435 if (
n <=1)
return n-1;
438 while ((obj=next())) {
440 if (obj ==
object)
return n;
458 if (obj ==
nullptr ||
fFolders ==
nullptr)
return;
int Int_t
Signed integer 4 bytes (int).
int Ssiz_t
String size (currently int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
const char Option_t
Option string (const char).
static const char * gFolderD[64]
static Int_t gFolderLevel
static char gFolderPath[512]
Using a TBrowser one can browse all ROOT objects.
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Collection abstract base class.
static void EmptyGarbageCollection()
Do the garbage collection.
static void StartGarbageCollection()
Set up for garbage collection.
void RecursiveRemove(TObject *obj) override
Recursively remove object from a folder.
void Browse(TBrowser *b) override
Browse this folder.
TFolder()
Default constructor used by the Input functions.
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at this folder.
TFolder * AddFolder(const char *name, const char *title, TCollection *collection=nullptr)
Create a new folder and add it to the list of folders of this folder, return a pointer to the created...
virtual void Add(TObject *obj)
Add object to this folder. obj must be a TObject or a TFolder.
void Clear(Option_t *option="") override
Delete all objects from a folder list.
virtual ~TFolder()
Folder destructor.
TObject * FindObject(const char *name) const override
Search object identified by name in the tree of folders inside this folder.
void ls(Option_t *option="") const override
List folder contents.
void SaveAs(const char *filename="", Option_t *option="") const override
Save all objects in this folder in filename.
virtual const char * FindFullPathName(const char *name) const
Return the full pathname corresponding to subpath name if the node is gROOT->GetRootFolder() and retu...
virtual void SetOwner(Bool_t owner=kTRUE)
Set ownership.
Bool_t IsOwner() const
Folder ownership has been set via.
virtual Int_t Occurence(const TObject *obj) const
Return occurrence number of object in the list of objects of this folder.
TFolder(const TFolder &folder)=delete
virtual void Remove(TObject *obj)
Remove object from this folder. obj must be a TObject or a TFolder.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Wrapper around a TObject so it can be stored in a TList.
TObject * GetObject() const
Bool_t TestBit(UInt_t f) const
virtual const char * GetName() const
Returns name of object.
virtual void Dump() const
Dump contents of object on stdout.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TClass * IsA() const
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
TObject()
TObject constructor.
virtual void ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
@ kMustCleanup
if object destructor must call RecursiveRemove()
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
Regular expression class.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
TString & Remove(Ssiz_t pos)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const