93 if (!initMotherDir) initMotherDir =
gDirectory;
95 if (strchr(
name,
'/')) {
96 ::Error(
"TDirectoryFile",
"directory name (%s) cannot contain a slash",
name);
101 ::Error(
"TDirectoryFile",
"directory name cannot be \"\"");
111 if (!motherdir || !
f)
return;
112 if (!
f->IsWritable())
return;
114 Error(
"TDirectoryFile",
"An object with name %s exists already",
name);
117 TClass *cl =
nullptr;
121 Error(
"TDirectoryFile",
"Invalid class name: %s",classname);
157 TKey *key =
new TKey(
fName,
fTitle,cl,nbytes,motherdir);
180 fKeys->Delete(
"slow");
194 fList->Delete(
"slow");
199 Info(
"~TDirectoryFile",
"dtor called for %s",
GetName());
211 if (!obj || !
fList)
return;
217 TMapFile *mfile = (TMapFile*)
fMother;
228 Error(
"AppendKey",
"TDirectoryFile not initialized yet.");
237 TKey *oldkey = (TKey*)
fKeys->FindObject(key->
GetName());
245 TObjLink *lnk =
fKeys->FirstLink();
253 fKeys->AddBefore(lnk, key);
267 TKey *key =
nullptr, *keyo =
nullptr;
273 while ((obj = nextin())) {
279 while ((key = (TKey *) next())) {
281 if (!keyo || (keyo && strcmp(keyo->GetName(), key->
GetName()))) {
311 if (motherDir && strlen(
GetName()) != 0) motherDir->
Append(
this);
321 fList =
new THashList(100,50);
322 fKeys =
new THashList(100,50);
389 char *pobj = (
char*)obj->
IsA()->
New();
390 if (!pobj)
return nullptr;
393 if (baseOffset==-1) {
397 Fatal(
"CloneObject",
"Incorrect detection of the inheritance from TObject for class %s.\n",
407 TFile *filsav =
gFile;
409 const Int_t bufsize = 10000;
411 buffer.MapObject(obj);
416 ((
TObject*)obj)->Streamer(buffer);
422 buffer.SetReadMode();
424 buffer.SetBufferOffset(0);
425 buffer.MapObject(newobj);
448 TIter next(
gROOT->GetListOfFiles());
449 while ((
f = (TFile*)next())) {
472 Bool_t printError,
const char *funcname)
475 if (apath) nch = strlen(apath);
480 if (funcname==0 || strlen(funcname)==0) funcname =
"GetDirectory";
484 char *path =
new char[nch+1]; path[0] = 0;
485 if (nch) strlcpy(path,apath,nch+1);
486 char *s = (
char*)strchr(path,
':');
495 if (
f && 0 == url->Compare(
f->GetFile()->GetEndpointUrl())) {
505 if (s && *(s+1)) result =
f->
GetDirectory(s+1,printError,funcname);
506 delete [] path;
return result;
508 if (printError)
Error(funcname,
"No such file %s", path);
509 delete [] path;
return nullptr;
514 if (path[0] ==
'/') {
518 delete [] path;
return result;
522 char *
slash = (
char*)strchr(path,
'/');
524 if (!strcmp(path,
"..")) {
526 delete [] path;
return result;
530 if (printError)
Error(funcname,
"Unknown directory %s", path);
531 delete [] path;
return nullptr;
534 delete [] path;
return obj;
537 TString subdir(path);
538 slash = (
char*)strchr(subdir.Data(),
'/');
541 if (!strcmp(subdir,
"..")) {
545 delete [] path;
return result;
549 if (printError)
Error(funcname,
"Unknown directory %s", subdir.Data());
550 delete [] path;
return nullptr;
554 delete [] path;
return result;
573 TObjLink *lnk =
fList->FirstLink();
584 if (fast)
fList->Delete();
585 else fList->Delete(
"slow");
591 fKeys->Delete(
"slow");
647 Info(
"Delete",
"Call for this = %s namecycle = %s",
648 GetName(), (namecycle ? namecycle :
"null"));
653 const char *nmcy = (namecycle) ? namecycle :
"";
657 Int_t deletetree = 0;
658 if(strcmp(
name,
"*") == 0) deleteall = 1;
659 if(strcmp(
name,
"*T") == 0){ deleteall = 1; deletetree = 1;}
660 if(strcmp(
name,
"T*") == 0){ deleteall = 1; deletetree = 1;}
661 if(namecycle==0 || !namecycle[0]){ deleteall = 1; deletetree = 1;}
668 if (cycle >= 9999 ) {
671 while ((idcur = (
TNamed *) next())) {
678 if (!deletetree && deleteall) deleteOK = 0;
682 fList->Remove(idcur);
687 idcur->
Delete(deletetree ?
"T*;*" :
"*");
700 if (cycle != 9999 ) {
704 while ((key = (TKey *) nextkey())) {
708 if (cycle == key->
GetCycle()) deleteOK = 1;
709 if (cycle > 9999) deleteOK = 1;
713 if (!deletetree && deleteall) deleteOK = 0;
714 if (cycle == key->
GetCycle()) deleteOK = 2;
761 tobuf(buffer, version);
764 TDatime((
UInt_t) 1).FillBuffer(buffer);
765 TDatime((
UInt_t) 1).FillBuffer(buffer);
772 if (version > 1000) {
782 TUUID(
"00000000-0000-0000-0000-000000000000").FillBuffer(buffer);
784 fUUID.FillBuffer(buffer);
785 if (
fFile &&
fFile->GetVersion() < 40000)
return;
820 auto listOfKeys =
dynamic_cast<THashList *
>(
GetListOfKeys());
822 Error(
"FindKeyAny",
"Unexpected type of TDirectoryFile::fKeys!");
826 if (
const TList *keyList = listOfKeys->GetListForObject(
name)) {
829 && (cycle == 9999 || cycle >= key->
GetCycle())) {
839 while ((key = (TKey *) next())) {
844 TKey *k = subdir ? subdir->
FindKeyAny(keyname) :
nullptr;
848 if (dirsav) dirsav->
cd();
872 auto listOfKeys =
dynamic_cast<THashList *
>(
GetListOfKeys());
874 Error(
"FindObjectAny",
"Unexpected type of TDirectoryFile::fKeys!");
878 if (
const TList *keyList = listOfKeys->GetListForObject(
name)) {
881 && (cycle == 9999 || cycle >= key->
GetCycle())) {
890 while ((key = (TKey *) next())) {
895 TKey *k = subdir ? subdir->
FindKeyAny(aname) :
nullptr;
896 if (k) {
if (dirsav) dirsav->
cd();
return k->
ReadObj();}
899 if (dirsav) dirsav->
cd();
961 for (
Int_t i = nch-1; i > 0; i--) {
962 if (
name[i] ==
'/') {
965 const char *subnamecycle = namecycle + i + 1;
967 return dirToSearch?dirToSearch->
Get(subnamecycle):0;
970 const char *namobj =
name;
976 if (idcur==
this && strlen(namobj)!=0) {
981 }
else if (cycle == 9999) {
993 auto listOfKeys =
dynamic_cast<THashList *
>(
GetListOfKeys());
995 Error(
"Get",
"Unexpected type of TDirectoryFile::fKeys!");
999 if (
const TList *keyList = listOfKeys->GetListForObject(namobj)) {
1001 if (key && !strcmp(key->
GetName(), namobj)
1002 && (cycle == 9999 || cycle == key->
GetCycle())) {
1066 if (!namecycle ||
'\0' == namecycle[0]) {
1067 Error(
"GetObjectChecked",
"The provided key name is invalid.");
1076 for (
Int_t i = nch-1; i > 0; i--) {
1077 if (
name[i] ==
'/') {
1080 const char *subnamecycle = namecycle + i + 1;
1089 const char *namobj =
name;
1093 if (expectedClass==0 || expectedClass->
IsTObject()) {
1096 if (objcur==
this && strlen(namobj)!=0) {
1101 }
else if (cycle == 9999) {
1116 auto listOfKeys =
dynamic_cast<THashList *
>(
GetListOfKeys());
1118 Error(
"GetObjectChecked",
"Unexpected type of TDirectoryFile::fKeys!");
1122 if (
const TList *keyList = listOfKeys->GetListForObject(namobj)) {
1124 if (key && !strcmp(key->
GetName(), namobj)
1125 && (cycle == 9999 || cycle == key->
GetCycle())) {
1156 if (!
fKeys)
return nullptr;
1158 auto listOfKeys =
dynamic_cast<THashList *
>(
GetListOfKeys());
1160 Error(
"GetKey",
"Unexpected type of TDirectoryFile::fKeys!");
1164 if (
const TList *keyList = listOfKeys->GetListForObject(
name)) {
1167 && (cycle == 9999 || cycle >= key->
GetCycle())) {
1195 TString opta = option;
1203 reg = opt(2,opt.
Length());
1208 reg = opt(2,opt.
Length());
1210 }
else if (!opt.
IsNull()) {
1214 TRegexp re(reg,
kTRUE);
1218 TIter nextobj(
fList);
1219 while ((obj = (
TObject *) nextobj())) {
1227 if (diskobj &&
fKeys) {
1229 for (TObjLink *lnk =
fKeys->FirstLink(); lnk !=
nullptr; lnk = lnk->
Next()) {
1274 if (!
name || !title || !
name[0])
return nullptr;
1275 if (!title[0]) title =
name;
1277 if (returnExistingDirectory)
1280 Error(
"mkdir",
"An object with name %s exists already",
name);
1284 if (
const char *
slash = strchr(
name,
'/')) {
1291 if (!tmpdir)
return nullptr;
1293 return tmpdir->
mkdir(
slash + 1, title, returnExistingDirectory);
1318 while ((key = (TKey*)prev())) {
1320 if (!keyprev)
break;
1352 Bool_t readdirs = ((opt!=0) && ((strcmp(opt,
"dirs")==0) || (strcmp(opt,
"dirs*")==0)));
1355 while ((key = (TKey *) next())) {
1358 if (strstr(key->
GetClassName(),
"TDirectory")==0)
continue;
1362 if ((dir!=0) && (strcmp(opt,
"dirs*")==0)) dir->
ReadAll(
"dirs*");
1365 while ((key = (TKey *) next())) {
1367 if (thing) {
delete thing; }
1402 if (!
fFile->IsBinary())
1403 return fFile->DirReadKeys(
this);
1413 char *header =
new char[nbytes];
1416 if (
fFile->ReadBuffer(buffer,nbytes) ) {
1428 if (versiondir > 1000) {
1433 Int_t sdir,sparent,skeys;
1451 for (
Int_t i = 0; i < nkeys; i++) {
1452 key =
new TKey(
this);
1455 Error(
"ReadKeys",
"reading illegal key, exiting after %d keys",i);
1461 Error(
"ReadKeys",
"reading illegal key, exiting after %d keys",i);
1486 if (!
fFile) {
Error(
"ReadTObject",
"No file open");
return 0; }
1487 auto listOfKeys =
dynamic_cast<THashList *
>(
GetListOfKeys());
1489 Error(
"ReadTObject",
"Unexpected type of TDirectoryFile::fKeys!");
1493 if (
const TList *keyList = listOfKeys->GetListForObject(keyname)) {
1495 if (key && !strcmp(key->
GetName(), keyname) ) {
1496 return key->
Read(obj);
1501 Error(
"ReadTObject",
"Key not found");
1536 fKeys->Delete(
"slow");
1544 while ((idcur = next())) {
1579 auto lnk =
fList->FirstLink()->shared_from_this();
1610 TString fname, opt = option;
1611 if (filename && *filename)
1618 if (fname.
Index(
".json") > 0) {
1623 if (!local)
return 0;
1624 nbytes = obj->
Write();
1628 obj->
Info(
"SaveAs",
"ROOT file %s has been created", fname.
Data());
1651 if (
fFile->GetListOfFree())
1652 dowrite =
fFile->GetListOfFree()->First() !=
nullptr;
1655 if (dirsav !=
this)
cd();
1658 if (dirsav && dirsav !=
this) dirsav->
cd();
1685 Int_t offset = (
char*)ref - (
char*)parent;
1686 TClass *cl = parent->
IsA();
1690 TStreamerElement *element;
1691 while((element = (TStreamerElement*)next())) {
1692 if (element->
GetOffset() != offset)
continue;
1694 if (execid > 0) ref->
SetBit(execid << 8);
1712 while ((idcur = next())) {
1731 nbytes +=
fUUID.Sizeof();
1733 if (
fFile &&
fFile->GetVersion() >= 40000) nbytes += 12;
1744 if (
b.IsReading()) {
1753 b.ClassBegin(dirclass, R__v);
1757 b.ClassMember(
"CreateTime",
"TString");
1759 TDatime timeC(sbuf.
Data());
1762 b.ClassMember(
"ModifyTime",
"TString");
1764 TDatime timeM(sbuf.
Data());
1767 b.ClassMember(
"UUID",
"TString");
1772 b.ClassEnd(dirclass);
1781 if (version > 1000) {
1787 Int_t sdir,sparent,skeys;
1811 b.ClassMember(
"CreateTime",
"TString");
1815 b.ClassMember(
"ModifyTime",
"TString");
1820 b.ClassMember(
"UUID",
"TString");
1821 sbuf =
fUUID.AsString();
1833 if (version > 1000) {
1843 if (version <=1000)
for (
Int_t i=0;i<3;i++)
b <<
Int_t(0);
1865 while ((obj=next())) {
1866 nbytes += obj->
Write(0,opt,bufsize);
1879 Error(
"Write const",
"A const TDirectory object should not be saved. We try to proceed anyway.");
1932 const char *objname =
"no name specified";
1934 else if (obj) objname = obj->
GetName();
1935 Error(
"WriteTObject",
"The current directory (%s) is not associated with a file. The object (%s) has not been written.",
GetName(),objname);
1939 if (!
fFile->IsWritable()) {
1942 Error(
"WriteTObject",
"Directory %s is not writable",
fFile->GetName());
1949 TString opt = option;
1952 TKey *key=0, *oldkey=0;
1954 if (bufsize > 0) bsize = bufsize;
1963 Int_t nch = strlen(oname);
1964 char *newName =
nullptr;
1965 if (nch && oname[nch-1] ==
' ') {
1966 Warning(
"WriteTObject",
"The key name '%s' will be stored in file without the trailing blanks.", obj->
GetName());
1968 newName =
new char[nch+1];
1969 strlcpy(newName,oname,nch+1);
1970 for (
Int_t i=0;i<nch;i++) {
1971 if (newName[nch-i-1] !=
' ')
break;
1972 newName[nch-i-1] = 0;
1989 key =
fFile->CreateKey(
this, obj, oname, bsize);
1990 if (newName)
delete [] newName;
1995 if (bufsize)
fFile->SetBufferSize(bufsize);
2001 if (bufsize)
fFile->SetBufferSize(bufsize);
2008 if (bufsize)
fFile->SetBufferSize(bufsize);
2047 TVirtualStreamerInfo *info =
dynamic_cast<TVirtualStreamerInfo*
>(info_obj);
2049 Error(
"WriteObjectAny",
"Unknown class: %s",classname);
2073 if (!
fFile)
return 0;
2076 Error(
"WriteObject",
"Unknown type for %s, it can not be written.",
name);
2080 if (!
fFile->IsWritable()) {
2083 Error(
"WriteObject",
"File %s is not writable",
fFile->GetName());
2090 const char *className = cl->
GetName();
2098 Error(
"WriteObjectAny",
2099 "The class requested (%s) for the key name \"%s\""
2100 " is an instance of an stl collection and does not have a compiled CollectionProxy."
2101 " Please generate the dictionary for this collection (%s). No data will be written.",
2102 className, oname, className);
2106 TKey *key, *oldkey =
nullptr;
2108 if (bufsize > 0) bsize = bufsize;
2110 TString opt = option;
2114 Int_t nch = strlen(oname);
2115 char *newName =
nullptr;
2116 if (nch && oname[nch-1] ==
' ') {
2117 newName =
new char[nch+1];
2118 strlcpy(newName,oname,nch+1);
2119 for (
Int_t i=0;i<nch;i++) {
2120 if (newName[nch-i-1] !=
' ')
break;
2121 newName[nch-i-1] = 0;
2138 key =
fFile->CreateKey(
this, obj, cl, oname, bsize);
2139 if (newName)
delete [] newName;
2166 if (!
f->IsBinary()) {
2168 f->DirWriteHeader(
this);
2173 char *header =
new char[nbytes];
2174 char *buffer = header;
2180 f->WriteBuffer(header, nbytes);
2181 if (
f->MustFlush())
f->Flush();
2195 if (!
f->IsBinary()) {
2196 f->DirWriteKeys(
this);
2208 Int_t nbytes =
sizeof nkeys;
2210 while ((key = (TKey*)next())) {
2220 tobuf(buffer, nkeys);
2221 while ((key = (TKey*)next())) {
void frombuf(char *&buf, Bool_t *x)
void tobuf(char *&buf, Bool_t x)
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
const Bool_t kIterBackward
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
externTVirtualMutex * gROOTMutex
#define R__LOCKGUARD(mutex)
Using a TBrowser one can browse all ROOT objects.
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...
Buffer base class used for serializing objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
ROOT::DirAutoAdd_t GetDirectoryAutoAdd() const
Return the wrapper around the directory auto add function.
void BuildRealData(void *pointer=nullptr, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
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,...
Int_t GetBaseClassOffset(const TClass *toBase, void *address=nullptr, bool isDerivedObject=true)
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
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 SetBufferSize(Int_t bufsize) override
void SetTRefAction(TObject *ref, TObject *parent) override
void Close(Option_t *option="") override
Delete all objects from memory and directory structure itself.
Bool_t cd() override
Change current directory to "this" directory.
TFile * fFile
Pointer to current file in memory.
void Browse(TBrowser *b) override
Browse the content of the directory.
void Append(TObject *obj, Bool_t replace=kFALSE) override
Append object to this directory.
void SaveSelf(Bool_t force=kFALSE) override
Bool_t IsWritable() const override
void Streamer(TBuffer &) override
TDirectory Streamer.
void Delete(const char *namecycle="") override
Delete Objects or/and keys in a directory.
virtual void ResetAfterMerge(TFileMergeInfo *)
Int_t AppendKey(TKey *key) override
TDirectoryFile(const TDirectoryFile &directory)=delete
Int_t ReadKeys(Bool_t forceRead=kTRUE) override
TDatime fDatimeM
Date and time of last modification.
void * GetObjectUnchecked(const char *namecycle) override
Return pointer to object identified by namecycle.
TKey * FindKey(const char *keyname) const override
TKey * GetKey(const char *name, Short_t cycle=9999) const override
void * GetObjectChecked(const char *namecycle, const char *classname) override
See documentation of TDirectory::GetObjectCheck(const char *namecycle, const TClass *cl).
void InitDirectoryFile(TClass *cl=nullptr)
void Purge(Short_t nkeep=1) override
~TDirectoryFile() override
TObject * FindObjectAnyFile(const char *name) const override
Int_t fNbytesKeys
Number of bytes for the keys.
Bool_t fModified
True if directory has been modified.
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/...".
TList * GetListOfKeys() const override
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.
Long64_t fSeekKeys
Location of Keys record on file.
void WriteKeys() override
TFile * GetFile() const override
Int_t fBufferSize
Default buffer size to create new TKeys.
Int_t Sizeof() const override
Return size of the TNamed part of the TObject.
TObject * CloneObject(const TObject *obj, Bool_t autoadd=kTRUE) override
Clone an object.
TDirectory * GetDirectory(const char *apath, Bool_t printError=false, const char *funcname="GetDirectory") override
Find a directory using apath.
Long64_t fSeekParent
Location of parent directory on file.
Int_t WriteObjectAny(const void *obj, const char *classname, const char *name, Option_t *option="", Int_t bufsize=0) override
void BuildDirectoryFile(TFile *motherFile, TDirectory *motherDir)
void rmdir(const char *name) override
Removes subdirectory from the directory When directory is deleted, all keys in all subdirectories wil...
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsize=0) override
Write this object to the current directory.
Long64_t fSeekDir
Location of directory on file.
Int_t fNbytesName
Number of bytes in TNamed at creation time.
TDatime fDatimeC
Date and time when directory is created.
Bool_t fWritable
True if directory is writable.
Int_t WriteTObject(const TObject *obj, const char *name=nullptr, Option_t *option="", Int_t bufsize=0) override
Int_t ReadTObject(TObject *obj, const char *keyname) override
TFile * OpenFile(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0) override
Int_t GetBufferSize() const override
Int_t SaveObjectAs(const TObject *obj, const char *filename="", Option_t *option="") const override
Save object in filename, if filename is nullptr or "", a file with "<objectname>.root" is created.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
static constexpr Version_t Class_Version()
TKey * FindKeyAny(const char *keyname) const override
void FillBuffer(char *&buffer) override
Encode TNamed into output buffer.
void WriteDirHeader() override
void SetWritable(Bool_t writable=kTRUE) override
TClass * IsA() const override
void ReadAll(Option_t *option="") override
TList * fKeys
Pointer to keys list in memory.
void ls(Option_t *option="") const override
List Directory contents.
TDirectory::TContext keeps track and restore the current directory.
Describe directory structure in memory.
virtual Long64_t GetSeekDir() const
void Delete(const char *namecycle="") override
Delete Objects or/and keys in a directory.
virtual TList * GetList() const
TDirectory(const TDirectory &directory)=delete
virtual Int_t AppendKey(TKey *)
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
virtual void ReadAll(Option_t *="")
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
void CleanTargets()
Clean the pointers to this object (gDirectory, TContext, etc.).
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
virtual TFile * GetFile() const
virtual Bool_t cd()
Change current directory to "this" directory.
static size_t DecodeNameCycle(const char *namecycle, char *name, Short_t &cycle, const size_t namesize=0)
virtual TKey * GetKey(const char *, Short_t=9999) const
TUUID fUUID
Unique identifier.
TDirectory * GetMotherDir() const
TObject * fMother
pointer to mother of the directory
void GetObject(const char *namecycle, T *&ptr)
Get an object with proper type checking.
virtual void * GetObjectChecked(const char *namecycle, const char *classname)
See documentation of TDirectory::GetObjectCheck(const char *namecycle, const TClass *cl).
TList * fList
List of objects in memory.
virtual TKey * FindKeyAny(const char *) const
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.
A class to pass information from the TFileMerger to the objects being merged.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
static TFile *& CurrentFile()
Return the current ROOT file if any.
virtual const TUrl * GetEndpointUrl() const
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.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
void Delete(Option_t *option="") override
Delete an object from the file.
virtual Long64_t GetSeekKey() const
Int_t Sizeof() const override
Return the size in bytes of the key header structure.
Int_t Read(const char *name) override
Read contents of object with specified name from the current directory.
Short_t GetKeep() const
Returns the "KEEP" status.
virtual const char * GetClassName() const
virtual Bool_t ReadFile()
Read the key structure from the file.
virtual void * ReadObjectAny(const TClass *expectedClass)
To read an object (non deriving from TObject) from the file.
void ReadKeyBuffer(char *&buffer)
Decode input buffer.
virtual Long64_t GetSeekPdir() const
void SetMotherDir(TDirectory *dir)
virtual void ls(Bool_t current) const
List Key contents.
Short_t GetCycle() const
Return cycle number associated to this key.
virtual TObject * ReadObj()
To read a TObject* from the file.
virtual Int_t WriteFile(Int_t cycle=1, TFile *f=nullptr)
Write the encoded object supported by this key.
virtual char * GetBuffer() const
void FillBuffer(char *&buffer) override
Encode key header into output buffer.
TObject * Before(const TObject *obj) const override
Returns the object before object obj.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(const TObject *obj, const char *name="")
Add an object to the list of objects to be stored in shared memory.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
TClass * IsA() const override
TObject * GetObject() const
Mother of all ROOT objects.
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Bool_t TestBit(UInt_t f) const
virtual const char * GetName() const
Returns name of object.
@ kOnlyPrepStep
Used to request that the class specific implementation of TObject::Write just prepare the objects to ...
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual void Delete(Option_t *option="")
Delete this object.
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 void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual TClass * IsA() const
TObject()
TObject constructor.
virtual void ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
@ kCanDelete
if object in a list can be deleted
@ kIsReferenced
if object is referenced by a TRef or TRefArray
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
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().
virtual Int_t GetExecID() const
Returns the TExec id for the EXEC instruction in the comment field of a TRef data member.
TObjArray * GetElements() const override
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
virtual void Streamer(TBuffer &)
Stream a string object.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual TClass * GetClass() const =0
void(* DirAutoAdd_t)(void *, TDirectory *)