|
ROOT
Reference Guide |
|
Go to the documentation of this file.
94 if (!initMotherDir) initMotherDir =
gDirectory;
96 if (strchr(
name,
'/')) {
97 ::Error(
"TDirectoryFile",
"directory name (%s) cannot contain a slash",
name);
102 ::Error(
"TDirectoryFile",
"directory name cannot be \"\"");
112 if (!motherdir || !
f)
return;
113 if (!
f->IsWritable())
return;
115 Error(
"TDirectoryFile",
"An object with name %s exists already",
name);
122 Error(
"TDirectoryFile",
"Invalid class name: %s",classname);
126 cl = TDirectoryFile::IsA();
200 Info(
"~TDirectoryFile",
"dtor called for %s",
GetName());
212 if (!obj || !
fList)
return;
229 Error(
"AppendKey",
"TDirectoryFile not initialized yet.");
268 TKey *key =
nullptr, *keyo =
nullptr;
274 while ((obj = nextin())) {
280 while ((key = (
TKey *) next())) {
282 if (!keyo || (keyo && strcmp(keyo->GetName(), key->
GetName()))) {
312 if (motherDir && strlen(
GetName()) != 0) motherDir->
Append(
this);
377 char *pobj = (
char*)obj->IsA()->New();
378 if (!pobj)
return nullptr;
381 if (baseOffset==-1) {
385 Fatal(
"CloneObject",
"Incorrect detection of the inheritance from TObject for class %s.\n",
397 const Int_t bufsize = 10000;
404 ((
TObject*)obj)->Streamer(buffer);
414 newobj->Streamer(buffer);
437 while ((
f = (
TFile*)next())) {
460 Bool_t printError,
const char *funcname)
463 if (apath) nch = strlen(apath);
468 if (funcname==0 || strlen(funcname)==0) funcname =
"GetDirectory";
472 char *path =
new char[nch+1]; path[0] = 0;
473 if (nch) strlcpy(path,apath,nch+1);
474 char *
s = (
char*)strchr(path,
':');
483 if (
f && 0 == url->Compare(
f->GetFile()->GetEndpointUrl())) {
493 if (
s && *(
s+1)) result =
f->GetDirectory(
s+1,printError,funcname);
494 delete [] path;
return result;
496 if (printError)
Error(funcname,
"No such file %s", path);
497 delete [] path;
return nullptr;
502 if (path[0] ==
'/') {
506 delete [] path;
return result;
510 char *
slash = (
char*)strchr(path,
'/');
512 if (!strcmp(path,
"..")) {
514 delete [] path;
return result;
518 if (printError)
Error(funcname,
"Unknown directory %s", path);
519 delete [] path;
return nullptr;
522 delete [] path;
return obj;
526 slash = (
char*)strchr(subdir.
Data(),
'/');
529 if (!strcmp(subdir,
"..")) {
533 delete [] path;
return result;
537 if (printError)
Error(funcname,
"Unknown directory %s", subdir.
Data());
538 delete [] path;
return nullptr;
542 delete [] path;
return result;
622 Info(
"Delete",
"Call for this = %s namecycle = %s",
623 GetName(), (namecycle ? namecycle :
"null"));
628 const char *nmcy = (namecycle) ? namecycle :
"";
632 Int_t deletetree = 0;
633 if(strcmp(
name,
"*") == 0) deleteall = 1;
634 if(strcmp(
name,
"*T") == 0){ deleteall = 1; deletetree = 1;}
635 if(strcmp(
name,
"T*") == 0){ deleteall = 1; deletetree = 1;}
636 if(namecycle==0 || !namecycle[0]){ deleteall = 1; deletetree = 1;}
643 if (cycle >= 9999 ) {
646 while ((idcur = (
TNamed *) next())) {
649 if (deleteall ||
s.Index(re) !=
kNPOS) {
653 if (!deletetree && deleteall) deleteOK = 0;
662 idcur->
Delete(deletetree ?
"T*;*" :
"*");
675 if (cycle != 9999 ) {
679 while ((key = (
TKey *) nextkey())) {
682 if (deleteall ||
s.Index(re) !=
kNPOS) {
683 if (cycle == key->
GetCycle()) deleteOK = 1;
684 if (cycle > 9999) deleteOK = 1;
688 if (!deletetree && deleteall) deleteOK = 0;
689 if (cycle == key->
GetCycle()) deleteOK = 2;
725 Version_t version = TDirectoryFile::Class_Version();
736 tobuf(buffer, version);
747 if (version > 1000) {
793 while ((key = (
TKey *) next())) {
795 if ((cycle == 9999) || (cycle >= key->
GetCycle())) {
802 while ((key = (
TKey *) next())) {
811 if (dirsav) dirsav->
cd();
838 while ((key = (
TKey *) next())) {
840 if (cycle == 9999)
return key->
ReadObj();
846 while ((key = (
TKey *) next())) {
852 if (k) {
if (dirsav) dirsav->
cd();
return k->
ReadObj();}
855 if (dirsav) dirsav->
cd();
917 for (
Int_t i = nch-1; i > 0; i--) {
918 if (
name[i] ==
'/') {
921 const char *subnamecycle = namecycle + i + 1;
923 return dirToSearch?dirToSearch->
Get(subnamecycle):0;
926 const char *namobj =
name;
932 if (idcur==
this && strlen(namobj)!=0) {
937 }
else if (cycle == 9999) {
951 while ((key = (
TKey *) nextkey())) {
952 if (strcmp(namobj,key->
GetName()) == 0) {
953 if ((cycle == 9999) || (cycle == key->
GetCycle())) {
1018 if (!namecycle ||
'\0' == namecycle[0]) {
1019 Error(
"GetObjectChecked",
"The provided key name is invalid.");
1028 for (
Int_t i = nch-1; i > 0; i--) {
1029 if (
name[i] ==
'/') {
1032 const char *subnamecycle = namecycle + i + 1;
1041 const char *namobj =
name;
1045 if (expectedClass==0 || expectedClass->
IsTObject()) {
1048 if (objcur==
this && strlen(namobj)!=0) {
1053 }
else if (cycle == 9999) {
1055 if (expectedClass && objcur->IsA()->GetBaseClassOffset(expectedClass) == -1)
return nullptr;
1068 void *idcur =
nullptr;
1071 while ((key = (
TKey *) nextkey())) {
1072 if (strcmp(namobj,key->
GetName()) == 0) {
1073 if ((cycle == 9999) || (cycle == key->
GetCycle())) {
1104 if (!
fKeys)
return nullptr;
1110 while (( key = (
TKey *)next() )) {
1112 if ((cycle == 9999) || (cycle >= key->
GetCycle()))
1147 reg = opt(2,opt.
Length());
1151 reg = opt(2,opt.
Length());
1152 }
else if (!opt.
IsNull())
1160 while ((obj = (
TObject *) nextobj())) {
1162 if (
s.Index(re) ==
kNPOS)
continue;
1167 if (diskobj &&
fKeys) {
1173 if (
s.Index(re) ==
kNPOS)
continue;
1210 if (!
name || !title || !
name[0])
return nullptr;
1211 if (!title[0]) title =
name;
1213 if (returnExistingDirectory)
1216 Error(
"mkdir",
"An object with name %s exists already",
name);
1221 if (
const char *
slash = strchr(
name,
'/')) {
1227 if (!tmpdir)
return nullptr;
1229 if (!newdir) newdir = tmpdir;
1258 while ((key = (
TKey*)prev())) {
1260 if (!keyprev)
break;
1292 Bool_t readdirs = ((opt!=0) && ((strcmp(opt,
"dirs")==0) || (strcmp(opt,
"dirs*")==0)));
1295 while ((key = (
TKey *) next())) {
1298 if (strstr(key->
GetClassName(),
"TDirectory")==0)
continue;
1302 if ((dir!=0) && (strcmp(opt,
"dirs*")==0)) dir->
ReadAll(
"dirs*");
1305 while ((key = (
TKey *) next())) {
1307 if (thing) {
delete thing; }
1353 char *header =
new char[nbytes];
1368 if (versiondir > 1000) {
1373 Int_t sdir,sparent,skeys;
1391 for (
Int_t i = 0; i < nkeys; i++) {
1392 key =
new TKey(
this);
1395 Error(
"ReadKeys",
"reading illegal key, exiting after %d keys",i);
1401 Error(
"ReadKeys",
"reading illegal key, exiting after %d keys",i);
1426 if (!
fFile) {
Error(
"Read",
"No file open");
return 0; }
1427 TKey *key =
nullptr;
1429 while ((key = (
TKey *) nextkey())) {
1430 if (strcmp(keyname,key->
GetName()) == 0) {
1431 return key->
Read(obj);
1434 Error(
"Read",
"Key not found");
1477 while ((idcur = next())) {
1514 TObject *idcur = lnk->GetObject();
1519 lnk = lnk->NextSP();
1542 if (!filename || !filename[0]) {
1546 if (fname.
Index(
".json") > 0) {
1550 if (!local)
return 0;
1551 nbytes = obj->
Write();
1553 if (dirsav) dirsav->
cd();
1586 if (dirsav !=
this)
cd();
1589 if (dirsav && dirsav !=
this) dirsav->
cd();
1616 Int_t offset = (
char*)ref - (
char*)parent;
1617 TClass *cl = parent->IsA();
1623 if (element->
GetOffset() != offset)
continue;
1625 if (execid > 0) ref->
SetBit(execid << 8);
1643 while ((idcur = next())) {
1672 void TDirectoryFile::Streamer(
TBuffer &
b)
1675 if (
b.IsReading()) {
1684 b.ClassBegin(dirclass, R__v);
1688 b.ClassMember(
"CreateTime",
"TString");
1693 b.ClassMember(
"ModifyTime",
"TString");
1698 b.ClassMember(
"UUID",
"TString");
1703 b.ClassEnd(dirclass);
1712 if (version > 1000) {
1718 Int_t sdir,sparent,skeys;
1742 b.ClassMember(
"CreateTime",
"TString");
1746 b.ClassMember(
"ModifyTime",
"TString");
1751 b.ClassMember(
"UUID",
"TString");
1757 version = TDirectoryFile::Class_Version();
1764 if (version > 1000) {
1774 if (version <=1000)
for (
Int_t i=0;i<3;i++)
b <<
Int_t(0);
1796 while ((obj=next())) {
1797 nbytes += obj->
Write(0,opt,bufsize);
1809 Error(
"Write const",
"A const TDirectory object should not be saved. We try to proceed anyway.");
1862 const char *objname =
"no name specified";
1864 else if (obj) objname = obj->
GetName();
1865 Error(
"WriteTObject",
"The current directory (%s) is not associated with a file. The object (%s) has not been written.",
GetName(),objname);
1882 TKey *key=0, *oldkey=0;
1884 if (bufsize > 0) bsize = bufsize;
1893 Int_t nch = strlen(oname);
1894 char *newName =
nullptr;
1895 if (nch && oname[nch-1] ==
' ') {
1896 newName =
new char[nch+1];
1897 strlcpy(newName,oname,nch+1);
1898 for (
Int_t i=0;i<nch;i++) {
1899 if (newName[nch-i-1] !=
' ')
break;
1900 newName[nch-i-1] = 0;
1918 if (newName)
delete [] newName;
1977 Error(
"WriteObjectAny",
"Unknown class: %s",classname);
2001 if (!
fFile)
return 0;
2004 Error(
"WriteObject",
"Unknown type for %s, it can not be written.",
name);
2018 const char *className = cl->
GetName();
2026 Error(
"WriteObjectAny",
2027 "The class requested (%s) for the key name \"%s\""
2028 " is an instance of an stl collection and does not have a compiled CollectionProxy."
2029 " Please generate the dictionary for this collection (%s). No data will be written.",
2030 className, oname, className);
2034 TKey *key, *oldkey =
nullptr;
2036 if (bufsize > 0) bsize = bufsize;
2042 Int_t nch = strlen(oname);
2043 char *newName =
nullptr;
2044 if (nch && oname[nch-1] ==
' ') {
2045 newName =
new char[nch+1];
2046 strlcpy(newName,oname,nch+1);
2047 for (
Int_t i=0;i<nch;i++) {
2048 if (newName[nch-i-1] !=
' ')
break;
2049 newName[nch-i-1] = 0;
2067 if (newName)
delete [] newName;
2094 if (!
f->IsBinary()) {
2096 f->DirWriteHeader(
this);
2101 char *header =
new char[nbytes];
2102 char *buffer = header;
2108 f->WriteBuffer(header, nbytes);
2109 if (
f->MustFlush())
f->Flush();
2123 if (!
f->IsBinary()) {
2124 f->DirWriteKeys(
this);
2136 Int_t nbytes =
sizeof nkeys;
2138 while ((key = (
TKey*)next())) {
2148 tobuf(buffer, nkeys);
2149 while ((key = (
TKey*)next())) {
Int_t ReadKeys(Bool_t forceRead=kTRUE) override
Read the linked list of keys.
virtual void ReadAll(Option_t *="")
void * GetObjectChecked(const char *namecycle, const char *classname) override
See documentation of TDirectoryFile::GetObjectCheck(const char *namecycle, const TClass *cl)
void FillBuffer(char *&buffer)
Stream UUID into output buffer.
This class implements a shared memory region mapped to a file.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Using a TBrowser one can browse all ROOT objects.
void Delete(const char *namecycle="") override
Delete Objects or/and keys in a directory.
virtual TList * GetList() const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void CleanTargets()
Clean the pointers to this object (gDirectory, TContext, etc.)
virtual TKey * GetKey(const char *, Short_t=9999) const
virtual void ls(Bool_t current) const
List Key contents.
TDirectory * GetMotherDir() const
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
virtual TClass * GetClass() const =0
virtual void Seek(Long64_t offset, ERelativeTo pos=kBeg)
Seek to a specific position in the file. Pos it either kBeg, kCur or kEnd.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
void Add(const TObject *obj, const char *name="")
Add an object to the list of objects to be stored in shared memory.
Short_t GetKeep() const
Returns the "KEEP" status.
static void DecodeNameCycle(const char *namecycle, char *name, Short_t &cycle, const size_t namesize=0)
Decode a namecycle "aap;2" into name "aap" and cycle "2".
Int_t GetBestBuffer() const
Return the best buffer size of objects on this file.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
void Save() override
Save recursively all directory keys and headers.
void ResetMap() override
Delete existing fMap and reset map counter.
const char * Data() const
void GetObject(const char *namecycle, T *&ptr)
Get an object with proper type checking.
virtual void * ReadObjectAny(const TClass *expectedClass)
To read an object (non deriving from TObject) from the file.
TKey * GetKey(const char *name, Short_t cycle=9999) const override
Return pointer to key with name,cycle.
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset the TDirectory after its content has been merged into another Directory.
void ReadBuffer(char *&buffer)
Decode Date/Time from output buffer, used by I/O system.
void SetTRefAction(TObject *ref, TObject *parent) override
Find the action to be executed in the dictionary of the parent class and store the corresponding exec...
virtual char * GetBuffer() const
virtual const char * GetTitle() const
Returns title of object.
TDatime fDatimeM
Date and time of last modification.
void tobuf(char *&buf, Bool_t x)
void Append(TObject *obj, Bool_t replace=kFALSE) override
Append object to this directory.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TKey * CreateKey(TDirectory *mother, const TObject *obj, const char *name, Int_t bufsize)
Creates key for object and converts data to buffer.
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsize=0) override
Write all objects in memory to disk.
static Int_t ExportToFile(const char *filename, const TObject *obj, const char *option=nullptr)
Convert object into JSON and store in text file Returns size of the produce file Used in TObject::Sav...
Int_t fNbytesName
Number of bytes in TNamed at creation time.
static constexpr double s
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Bool_t cd(const char *path=nullptr) override
Change current directory to "this" directory.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TDatime fDatimeC
Date and time when directory is created.
virtual Int_t WriteFile(Int_t cycle=1, TFile *f=0)
Write the encoded object supported by this key.
Small helper to keep current directory context.
void MapObject(const TObject *obj, UInt_t offset=1) override
Add object to the fMap container.
void SaveSelf(Bool_t force=kFALSE) override
Save Directory keys and header.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
virtual Bool_t cd(const char *path=nullptr)
Change current directory to "this" directory.
Buffer base class used for serializing objects.
virtual void FillBuffer(char *&buffer)
Encode key header into output buffer.
TFile * fFile
Pointer to current file in memory.
void SetBufferSize(Int_t bufsize) override
Set the default buffer size when creating new TKeys.
virtual Long64_t GetSeekPdir() const
virtual Bool_t ReadBuffer(char *buf, Int_t len)
Read a buffer from the file.
TFile * OpenFile(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0) override
Interface to TFile::Open.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual Bool_t ReadFile()
Read the key structure from the file.
void Delete(const char *namecycle="") override
Delete Objects or/and keys in a directory.
void SetBufferOffset(Int_t offset=0)
Int_t Sizeof() const override
Return the size in bytes of the directory header.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
Abstract Interface class describing Streamer information for one class.
Bool_t fModified
True if directory has been modified.
void Set()
Set Date/Time to current time as reported by the system.
const Bool_t kIterBackward
void(* DirAutoAdd_t)(void *, TDirectory *)
virtual TKey * FindKeyAny(const char *) const
TFile * GetFile() const override
virtual Int_t Sizeof() const
Return the size in bytes of the key header structure.
void * GetObjectUnchecked(const char *namecycle) override
Return pointer to object identified by namecycle.
virtual void ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
Int_t WriteTObject(const TObject *obj, const char *name=nullptr, Option_t *option="", Int_t bufsize=0) override
Write object obj to this directory.
void SetMotherDir(TDirectory *dir)
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
void Close(Option_t *option="") override
Delete all objects from memory and directory structure itself.
virtual const char * GetName() const
Returns name of object.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
TList * GetListOfKeys() const override
virtual ~TDirectoryFile()
Destructor.
void SumBuffer(Int_t bufsize)
Increment statistics for buffer sizes of objects in this file.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
TKey * FindKeyAny(const char *keyname) const override
Find key with name keyname in the current directory or its subdirectories.
TList * fKeys
Pointer to keys list in memory.
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
virtual bool UseRWLock()
Set this collection to use a RW lock upon access, making it thread safe.
void Browse(TBrowser *b) override
Browse the content of the directory.
void SetReadMode()
Set buffer in read mode.
virtual TObjLink * FirstLink() const
TObject * CloneObject(const TObject *obj, Bool_t autoadd=kTRUE) override
Make a clone of an object using the Streamer facility.
Int_t fBufferSize
Default buffer size to create new TKeys.
virtual const char * GetClassName() const
TObjArray * GetElements() const
Describe Streamer information for one class version.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
R__EXTERN TVirtualMutex * gROOTMutex
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
Int_t WriteObjectAny(const void *obj, const char *classname, const char *name, Option_t *option="", Int_t bufsize=0) override
Write object from pointer of class classname in this directory.
Streamer around an arbitrary STL like container, which implements basic container functionality.
Int_t AppendKey(TKey *key) override
Insert key in the linked list of keys of this directory.
The TNamed class is the base class for all named ROOT classes.
virtual void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
virtual Int_t AppendKey(TKey *)
TDirectoryFile()
Default TDirectoryFile constructor.
virtual void * GetObjectChecked(const char *namecycle, const char *classname)
See documentation of TDirectory::GetObjectCheck(const char *namecycle, const TClass *cl)
virtual void Delete(Option_t *option="")
Delete an object from the file.
virtual Long64_t GetSize() const
Returns the current file size.
Int_t SaveObjectAs(const TObject *obj, const char *filename="", Option_t *option="") const override
Save object in filename.
#define R__LOCKGUARD(mutex)
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
static TFile *& CurrentFile()
Return the current ROOT file if any.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
void Purge(Short_t nkeep=1) override
Purge lowest key cycles in a directory.
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
Int_t ReadTObject(TObject *obj, const char *keyname) override
Read object with keyname from the current directory.
Long64_t fSeekKeys
Location of Keys record on file.
Bool_t IsWritable() const override
TKey * FindKey(const char *keyname) const override
Find key with name keyname in the current directory.
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
@ kCanDelete
if object in a list can be deleted
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
void ls(Option_t *option="") const override
List Directory contents.
Regular expression class.
void StreamerV1(TBuffer &b)
Stream UUID from input buffer.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
R__EXTERN TSystem * gSystem
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual Long64_t GetSeekKey() const
virtual TObject * ReadObj()
To read a TObject* from the file.
TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory") override
Find a directory named "apath".
Long64_t fSeekParent
Location of parent directory on file.
TObject * FindObjectAny(const char *name) const override
Find object by name in the list of memory objects of the current directory or its sub-directories.
TObject * FindObjectAnyFile(const char *name) const override
Scan the memory lists of all files for an object with name.
void FillBuffer(char *&buffer)
Encode Date/Time into buffer, used by I/O system.
@ kIsReferenced
if object is referenced by a TRef or TRefArray
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual Int_t DirReadKeys(TDirectory *)
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t fWritable
True if directory is writable.
void frombuf(char *&buf, Bool_t *x)
void FillBuffer(char *&buffer) override
Encode directory header into output buffer.
void WriteDirHeader() override
Overwrite the Directory header record.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Int_t fNbytesKeys
Number of bytes for the keys.
virtual void Add(TObject *obj)
TObject * GetObject() const
Mother of all ROOT objects.
Short_t GetCycle() const
Return cycle number associated to this key.
void rmdir(const char *name) override
Removes subdirectory from the directory.
virtual TFile * GetFile() const
virtual void Delete(Option_t *option="")
Delete this object.
Describe directory structure in memory.
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
void SetWritable(Bool_t writable=kTRUE) override
Set the new value of fWritable recursively.
virtual Long64_t GetEND() const
void CleanTargets()
Clean the pointers to this object (gDirectory, TContext, etc.).
Int_t GetBufferSize() const override
Return the buffer size to create new TKeys.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Long64_t fSeekDir
Location of directory on file.
virtual TObject * FindObjectAny(const char *name) const
Find object by name in the list of memory objects of the current directory or its sub-directories.
Wrapper around a TObject so it can be stored in a TList.
virtual const char * GetName() const
Returns name of object.
void BuildDirectoryFile(TFile *motherFile, TDirectory *motherDir)
Initialise directory to defaults.
TList * GetListOfFree() const
virtual Int_t Read(const char *name)
Read contents of object with specified name from the current directory.
void ToLower()
Change string to lower-case.
A ROOT file is structured in Directories (like a file system).
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void InitDirectoryFile(TClass *cl=nullptr)
Initialize the key associated with this directory (and the related data members.
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
void ReadKeyBuffer(char *&buffer)
Decode input buffer.
virtual const TUrl * GetEndpointUrl() const
void WriteKeys() override
Write Keys linked list on the file.
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
virtual Int_t GetExecID() const
Returns the TExec id for the EXEC instruction in the comment field of a TRef data member.
void ReadAll(Option_t *option="") override
Read objects from a ROOT file directory into memory.