ROOT » IO » XML » TXMLFile

class TXMLFile: public TFile, public TXMLSetup


 The main motivation for the XML  format is to facilitate the
 communication with other non ROOT applications. Currently
 writing and reading XML files is limited to ROOT applications.
 It is our intention to develop a simple reader independent
 of the ROOT libraries that could be used as an example for
 real applications. One of possible approach with code generation
 is implemented in TXMLPlayer class.

 The XML format should be used only for small data volumes,
 typically histogram files, pictures, geometries, calibrations.
 The XML file is built in memory before being dumped to disk.

 Like for normal ROOT files, XML files use the same I/O mechanism
 exploiting the ROOT/CINT dictionary. Any class having a dictionary
 can be saved in XML format.

 This first implementation does not support subdirectories
 or Trees.

 The shared library libRXML.so may be loaded dynamically
 via gSystem->Load("libRXML"). This library is automatically
 loaded by the plugin manager as soon as a XML file is created
 via, eg
   TFile::Open("file.xml","recreate");
 TFile::Open returns a TXMLFile object. When a XML file is open in write mode,
 one can use the normal TObject::Write to write an object in the file.
 Alternatively one can use the new functions TDirectoryFile::WriteObject and
 TDirectoryFile::WriteObjectAny to write a TObject* or any class not deriving
 from TObject.

 example of a session saving a histogram to a XML file

   TFile *f = TFile::Open("Example.xml","recreate");
   TH1F *h = new TH1F("h","test",1000,-2,2);
   h->FillRandom("gaus");
   h->Write();
   delete f;

 example of a session reading the histogram from the file

   TFile *f = TFile::Open("Example.xml");
   TH1F *h = (TH1F*)f->Get("h");
   h->Draw();

 A new option in the canvas "File" menu is available to save
 a TCanvas as a XML file. One can also do
   canvas->Print("Example.xml");

 Configuring ROOT with the option "xml"

 The XML package is enabled by default

 documentation

 See also classes TBufferXML, TKeyXML, TXMLEngine, TXMLSetup and TXMLPlayer.
 An example of XML file corresponding to the small example below
 can be found at http://root.cern.ch/root/Example.xml


Function Members (Methods)

public:
virtual~TXMLFile()
voidTObject::AbstractMethod(const char* method) const
virtual voidTDirectoryFile::Add(TObject* obj, Bool_t replace = kFALSE)
static voidTDirectory::AddDirectory(Bool_t add = kTRUE)
static Bool_tTDirectory::AddDirectoryStatus()
Bool_tAddXmlComment(const char* comment)
Bool_tAddXmlLine(const char* line)
Bool_tAddXmlStyleSheet(const char* href, const char* type = "text/css", const char* title = 0, int alternate = -1, const char* media = 0, const char* charset = 0)
virtual voidTDirectoryFile::Append(TObject* obj, Bool_t replace = kFALSE)
virtual Int_tTDirectoryFile::AppendKey(TKey* key)
virtual voidTObject::AppendPad(Option_t* option = "")
static TFileOpenHandle*TFile::AsyncOpen(const char* name, Option_t* option = "", const char* ftitle = "", Int_t compress = 1, Int_t netopt = 0)
virtual voidTDirectoryFile::Browse(TBrowser* b)
virtual voidTDirectoryFile::Build(TFile* motherFile = 0, TDirectory* motherDir = 0)
virtual Bool_tTDirectoryFile::cd(const char* path = 0)
static Bool_tTDirectory::Cd(const char* path)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTDirectory::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual TObject*TDirectoryFile::CloneObject(const TObject* obj, Bool_t autoadd = kTRUE)
virtual voidClose(Option_t* option = "")MENU
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTFile::Copy(TObject&) const
virtual Bool_tTFile::Cp(const char* dst, Bool_t progressbar = kTRUE, UInt_t buffersize = 1000000)
static Bool_tTFile::Cp(const char* src, const char* dst, Bool_t progressbar = kTRUE, UInt_t buffersize = 1000000)
virtual TKey*CreateKey(TDirectory* mother, const TObject* obj, const char* name, Int_t bufsize)
virtual TKey*CreateKey(TDirectory* mother, const void* obj, const TClass* cl, const char* name, Int_t bufsize)
static TDirectory*&TDirectory::CurrentDirectory()
static TFile*&TFile::CurrentFile()
static voidTDirectory::DecodeNameCycle(const char* namecycle, char* name, Short_t& cycle, const size_t namesize = 0)
static TStringTXMLSetup::DefaultXmlSetup()
virtual voidTFile::Delete(const char* namecycle = "")
virtual voidTDirectory::DeleteAll(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTFile::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidDrawMap(const char* = "*", Option_t* = "")
virtual voidTObject::Dump() constMENU
static voidTDirectory::EncodeNameCycle(char* buffer, const char* name, Short_t cycle)
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidFillBuffer(char*&)
virtual TKey*TDirectoryFile::FindKey(const char* keyname) const
virtual TKey*TDirectoryFile::FindKeyAny(const char* keyname) const
virtual TObject*TDirectory::FindObject(const char* name) const
virtual TObject*TDirectory::FindObject(const TObject* obj) const
virtual TObject*TDirectoryFile::FindObjectAny(const char* name) const
virtual TObject*TDirectoryFile::FindObjectAnyFile(const char* name) const
virtual voidFlush()
virtual TObject*TDirectoryFile::Get(const char* namecycle)
TArchiveFile*TFile::GetArchive() const
Long64_tTFile::GetArchiveOffset() const
static TFile::EAsyncOpenStatusTFile::GetAsyncOpenStatus(const char* name)
static TFile::EAsyncOpenStatusTFile::GetAsyncOpenStatus(TFileOpenHandle* handle)
Int_tTFile::GetBestBuffer() const
virtual Int_tTDirectoryFile::GetBufferSize() const
virtual Long64_tTFile::GetBytesRead() const
virtual Long64_tTFile::GetBytesReadExtra() const
virtual Int_tTFile::GetBytesToPrefetch() const
virtual Long64_tTFile::GetBytesWritten() const
static const char*TFile::GetCacheFileDir()
TFileCacheRead*TFile::GetCacheRead(TObject* tree = 0) const
TFileCacheWrite*TFile::GetCacheWrite() const
TArrayC*TFile::GetClassIndex() const
Int_tTFile::GetCompressionAlgorithm() const
Float_tTFile::GetCompressionFactor()
Int_tTFile::GetCompressionLevel() const
Int_tTFile::GetCompressionSettings() const
const TDatime&TDirectoryFile::GetCreationDate() const
virtual TDirectory*TDirectoryFile::GetDirectory(const char* apath, Bool_t printError = false, const char* funcname = "GetDirectory")
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Long64_tGetEND() const
virtual const TUrl*TFile::GetEndpointUrl() const
static const TUrl*TFile::GetEndpointUrl(const char* name)
virtual Int_tGetErrno() const
Int_tTFile::GetFd() const
virtual TFile*TDirectoryFile::GetFile() const
static Long64_tTFile::GetFileBytesRead()
static Long64_tTFile::GetFileBytesWritten()
static Long64_tTFile::GetFileCounter()
static Int_tTFile::GetFileReadCalls()
virtual const char*TObject::GetIconName() const
Int_tGetIOVersion() const
virtual TKey*TDirectoryFile::GetKey(const char* name, Short_t cycle = 9999) const
virtual TList*TDirectory::GetList() const
TList*TFile::GetListOfFree() const
virtual TList*TDirectoryFile::GetListOfKeys() const
TObjArray*TFile::GetListOfProcessIDs() const
const TDatime&TDirectoryFile::GetModificationDate() const
virtual TObject*TDirectory::GetMother() const
virtual TDirectory*TDirectory::GetMotherDir() const
virtual const char*TNamed::GetName() const
virtual Int_tGetNbytesFree() const
virtual Int_tGetNbytesInfo() const
virtual Int_tTDirectoryFile::GetNbytesKeys() const
virtual TStringTFile::GetNewUrl()
Int_tTXMLSetup::GetNextRefCounter()
virtual Int_tGetNfree() const
virtual Int_tTDirectoryFile::GetNkeys() const
virtual Int_tTFile::GetNProcessIDs() const
virtual void*TDirectoryFile::GetObjectChecked(const char* namecycle, const char* classname)
virtual void*TDirectoryFile::GetObjectChecked(const char* namecycle, const TClass* cl)
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual void*TDirectoryFile::GetObjectUnchecked(const char* namecycle)
static Bool_tTFile::GetOnlyStaged()
static UInt_tTFile::GetOpenTimeout()
virtual Option_t*TFile::GetOption() const
virtual const char*TDirectory::GetPath() const
virtual const char*TDirectory::GetPathStatic() const
static Int_tTFile::GetReadaheadSize()
virtual Int_tTFile::GetReadCalls() const
static Bool_tTFile::GetReadStreamerInfo()
Int_tTFile::GetRecordHeader(char* buf, Long64_t first, Int_t maxbytes, Int_t& nbytes, Int_t& objlen, Int_t& keylen)
Long64_tTFile::GetRelOffset() const
virtual Long64_tTDirectoryFile::GetSeekDir() const
virtual Long64_tGetSeekFree() const
virtual Long64_tGetSeekInfo() const
virtual Long64_tTDirectoryFile::GetSeekKeys() const
virtual Long64_tTDirectoryFile::GetSeekParent() const
TStringTXMLSetup::GetSetupAsString()
virtual Long64_tGetSize() const
const TList*TFile::GetStreamerInfoCache()
virtual TList*GetStreamerInfoList()
virtual const char*TNamed::GetTitle() const
static TFile::EFileTypeTFile::GetType(const char* name, Option_t* option = "", TString* prefix = 0)
virtual UInt_tTObject::GetUniqueID() const
TUUIDTDirectory::GetUUID() const
Int_tTFile::GetVersion() const
TXMLSetup::EXMLLayoutTXMLSetup::GetXmlLayout() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
static voidTFile::IncrementFileCounter()
virtual voidTFile::IncrementProcessIDs()
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTFile::IsArchive() const
Bool_tTFile::IsBinary() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTDirectory::IsFolder() const
virtual Bool_tTDirectoryFile::IsModified() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tIsOpen() const
Bool_tTFile::IsRaw() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTXMLSetup::IsStoreStreamerInfos() const
Bool_tTXMLSetup::IsUseDtd() const
Bool_tTXMLSetup::IsUseNamespaces() const
virtual Bool_tTDirectoryFile::IsWritable() const
Bool_tTObject::IsZombie() const
virtual voidTFile::ls(Option_t* option = "") const
virtual voidMakeFree(Long64_t, Long64_t)
virtual voidMakeProject(const char*, const char* = "*", Option_t* = "new")MENU
virtual voidMap()
virtual Bool_tTFile::Matches(const char* name)
voidTObject::MayNotUse(const char* method) const
virtual TDirectory*TDirectoryFile::mkdir(const char* name, const char* title = "")
virtual Bool_tTFile::MustFlush() const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static TFile*TFile::Open(TFileOpenHandle* handle)
static TFile*TFile::Open(const char* name, Option_t* option = "", const char* ftitle = "", Int_t compress = 1, Int_t netopt = 0)
virtual TFile*TDirectoryFile::OpenFile(const char* name, Option_t* option = "", const char* ftitle = "", Int_t compress = 1, Int_t netopt = 0)
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidPaint(Option_t* = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* = "") const
voidTXMLSetup::PrintSetup()
virtual voidTDirectoryFile::Purge(Short_t nkeep = 1)
virtual voidTDirectory::pwd() const
virtual Int_tTObject::Read(const char* name)
virtual voidTDirectoryFile::ReadAll(Option_t* option = "")
virtual Bool_tReadBuffer(char*, Int_t)
virtual Bool_tReadBuffer(char*, Long64_t, Int_t)
virtual Bool_tTFile::ReadBufferAsync(Long64_t offs, Int_t len)
virtual Bool_tTFile::ReadBuffers(char* buf, Long64_t* pos, Int_t* len, Int_t nbuf)
virtual voidReadFree()
virtual Int_tTDirectoryFile::ReadKeys(Bool_t forceRead = kTRUE)
virtual TProcessID*TFile::ReadProcessID(UShort_t pidf)
virtual voidTFile::ReadStreamerInfo()
virtual Int_tTDirectoryFile::ReadTObject(TObject* obj, const char* keyname)
virtual Int_tRecover()
virtual voidTDirectory::RecursiveRemove(TObject* obj)
virtual TObject*TDirectory::Remove(TObject*)
virtual Int_tReOpen(Option_t* mode)
virtual voidTDirectoryFile::ResetAfterMerge(TFileMergeInfo*)
voidTObject::ResetBit(UInt_t f)
virtual voidResetErrno() const
virtual voidTDirectoryFile::rmdir(const char* name)
virtual voidTDirectoryFile::Save()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual Int_tTDirectoryFile::SaveObjectAs(const TObject* obj, const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
virtual voidTDirectoryFile::SaveSelf(Bool_t force = kFALSE)
virtual voidSeek(Long64_t, TFile::ERelativeTo = kBeg)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTDirectoryFile::SetBufferSize(Int_t bufsize)
static Bool_tTFile::SetCacheFileDir(const char* cacheDir, Bool_t operateDisconnected = kTRUE, Bool_t forceCacheread = kFALSE)
virtual voidTFile::SetCacheRead(TFileCacheRead* cache, TObject* tree = 0, TFile::ECacheAction action = kDisconnect)
virtual voidTFile::SetCacheWrite(TFileCacheWrite* cache)
virtual voidTFile::SetCompressionAlgorithm(Int_t algorithm = 0)
virtual voidTFile::SetCompressionLevel(Int_t level = 1)
virtual voidTFile::SetCompressionSettings(Int_t settings = 1)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidSetEND(Long64_t)
static voidTFile::SetFileBytesRead(Long64_t bytes = 0)
static voidTFile::SetFileBytesWritten(Long64_t bytes = 0)
static voidTFile::SetFileReadCalls(Int_t readcalls = 0)
virtual voidTDirectoryFile::SetModified()
virtual voidTDirectory::SetMother(TObject* mother)
virtual voidTDirectory::SetName(const char* newname)
static voidTXMLSetup::SetNameSpaceBase(const char* namespacebase)
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTFile::SetOffset(Long64_t offset, TFile::ERelativeTo pos = kBeg)
static Bool_tTFile::SetOnlyStaged(Bool_t onlystaged)
static UInt_tTFile::SetOpenTimeout(UInt_t timeout)
virtual voidTFile::SetOption(Option_t* option = ">")
static voidTFile::SetReadaheadSize(Int_t bufsize = 256000)
virtual voidTFile::SetReadCalls(Int_t readcalls = 0)
static voidTFile::SetReadStreamerInfo(Bool_t readinfo = kTRUE)
virtual voidTDirectoryFile::SetSeekDir(Long64_t v)
virtual voidSetStoreStreamerInfos(Bool_t iConvert = kTRUE)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTDirectoryFile::SetTRefAction(TObject* ref, TObject* parent)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidSetUsedDtd(Bool_t use = kTRUE)
virtual voidSetUseNamespaces(Bool_t iUseNamespaces = kTRUE)
virtual voidTDirectoryFile::SetWritable(Bool_t writable = kTRUE)
virtual voidSetXmlLayout(TXMLSetup::EXMLLayout layout)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidTFile::ShowStreamerInfo()
static Bool_tTFile::ShrinkCacheFileDir(Long64_t shrinkSize, Long_t cleanupInteval = 0)
virtual Int_tSizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
voidTFile::SumBuffer(Int_t bufsize)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TXMLFile()
TXMLFile(const TXMLFile&)
TXMLFile(const char* filename, Option_t* option = "read", const char* title = "title", Int_t compression = 1)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tWrite(const char* = 0, Int_t = 0, Int_t = 0)
virtual Int_tWrite(const char* = 0, Int_t = 0, Int_t = 0) const
virtual Bool_tWriteBuffer(const char*, Int_t)
virtual voidTDirectoryFile::WriteDirHeader()
virtual voidWriteFree()
virtual voidWriteHeader()
virtual voidTDirectoryFile::WriteKeys()
virtual Int_tTDirectoryFile::WriteObjectAny(const void* obj, const char* classname, const char* name, Option_t* option = "", Int_t bufsize = 0)
virtual Int_tTDirectoryFile::WriteObjectAny(const void* obj, const TClass* cl, const char* name, Option_t* option = "", Int_t bufsize = 0)
virtual UShort_tTFile::WriteProcessID(TProcessID* pid)
virtual voidWriteStreamerInfo()
virtual Int_tTDirectoryFile::WriteTObject(const TObject* obj, const char* name = 0, Option_t* option = "", Int_t bufsize = 0)
TXMLEngine*XML()
const char*TXMLSetup::XmlClassNameSpaceRef(const TClass* cl)
const char*TXMLSetup::XmlConvertClassName(const char* name)
const char*TXMLSetup::XmlGetElementName(const TStreamerElement* el)
protected:
Int_tTXMLSetup::AtoI(const char* sbuf, Int_t def = 0, const char* errinfo = 0)
Bool_tTDirectory::cd1(const char* path)
static Bool_tTDirectory::Cd1(const char* path)
virtual voidTDirectoryFile::CleanTargets()
voidCombineNodesTree(TDirectory* dir, XMLNodePointer_t topnode, Bool_t dolink)
virtual Long64_tDirCreateEntry(TDirectory*)
virtual Int_tDirReadKeys(TDirectory*)
virtual voidDirWriteHeader(TDirectory*)
virtual voidDirWriteKeys(TDirectory*)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTDirectory::FillFullPath(TString& buf) const
TKeyXML*FindDirKey(TDirectory* dir)
TDirectory*FindKeyDir(TDirectory* mother, Long64_t keyid)
Bool_tTFile::FlushWriteCache()
virtual TFile::EAsyncOpenStatusTFile::GetAsyncOpenStatus()
const char*TXMLSetup::GetElItemName(TStreamerElement* el)
virtual voidTFile::Init(Bool_t create)
voidInitXmlFile(Bool_t create)
Bool_tTXMLSetup::IsValidXmlSetup(const char* setupstr)
Int_tTFile::MakeProjectParMake(const char* packname, const char* filename)
Int_tTFile::MakeProjectParProofInf(const char* packname, const char* proofinfdir)
voidTObject::MakeZombie()
static voidProduceFileNames(const char* filename, TString& fname, TString& dtdname)
Int_tTFile::ReadBufferViaCache(char* buf, Int_t len)
Bool_tReadFromFile()
Int_tReadKeysList(TDirectory* dir, XMLNodePointer_t topnode)
Bool_tTXMLSetup::ReadSetupFromStr(const char* setupstr)
voidReadStreamerElement(XMLNodePointer_t node, TStreamerInfo* info)
voidTDirectory::RegisterContext(TDirectory::TContext* ctxt)
voidSaveToFile()
voidStoreStreamerElement(XMLNodePointer_t node, TStreamerElement* elem)
virtual Int_tSysClose(Int_t)
virtual Int_tSysOpen(const char*, Int_t, UInt_t)
virtual Int_tSysRead(Int_t, void*, Int_t)
virtual Long64_tSysSeek(Int_t, Long64_t, Int_t)
virtual Int_tSysStat(Int_t, Long_t*, Long64_t*, Long_t*, Long_t*)
virtual Int_tSysSync(Int_t)
virtual Int_tSysWrite(Int_t, const void*, Int_t)
voidTDirectory::UnregisterContext(TDirectory::TContext* ctxt)
Int_tTFile::WriteBufferViaCache(const char* buf, Int_t len)
TClass*TXMLSetup::XmlDefineClass(const char* xmlClassName)
private:
voidoperator=(const TXMLFile&)

Data Members

public:
static TFile::EAsyncOpenStatusTFile::kAOSFailure
static TFile::EAsyncOpenStatusTFile::kAOSInProgress
static TFile::EAsyncOpenStatusTFile::kAOSNotAsync
static TFile::EAsyncOpenStatusTFile::kAOSSuccess
static TFile::ERelativeToTFile::kBeg
static TFile::EStatusBitsTFile::kBinaryFile
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TDirectoryFile::(anonymous)TDirectoryFile::kCloseDirectory
static TFile::ERelativeToTFile::kCur
static TFile::EFileTypeTFile::kDefault
static TFile::EStatusBitsTFile::kDevNull
static TFile::ECacheActionTFile::kDisconnect
static TFile::ECacheActionTFile::kDoNotDisconnect
static TFile::ERelativeToTFile::kEnd
static TFile::EOpenTimeOutTFile::kEternalTimeout
static TFile::EFileTypeTFile::kFile
static TXMLSetup::EXMLLayoutTXMLSetup::kGeneralized
static TFile::EStatusBitsTFile::kHasReferences
static TObject::EStatusBitsTObject::kHasUUID
static TFile::EOpenTimeOutTFile::kInstantTimeout
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TFile::EFileTypeTFile::kLocal
static TFile::EFileTypeTFile::kMerge
static TObject::EStatusBitsTObject::kMustCleanup
static TFile::EFileTypeTFile::kNet
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TFile::EStatusBitsTFile::kRecovered
static TFile::EStatusBitsTFile::kRedirected
static TObject::(anonymous)TObject::kSingleKey
static TXMLSetup::EXMLLayoutTXMLSetup::kSpecialized
static TFile::(anonymous)TFile::kStartBigFile
static TFile::EFileTypeTFile::kWeb
static TObject::(anonymous)TObject::kWriteDelete
static TFile::EStatusBitsTFile::kWriteError
static TObject::(anonymous)TObject::kZombie
protected:
TArchiveFile*TFile::fArchive!Archive file from which we read this file
Long64_tTFile::fArchiveOffset!Offset at which file starts in archive
TFileOpenHandle*TFile::fAsyncHandle!For proper automatic cleanup
TFile::EAsyncOpenStatusTFile::fAsyncOpenStatus!Status of an asynchronous open request
Long64_tTFile::fBEGINFirst used byte in file
Int_tTDirectoryFile::fBufferSizeDefault buffer size to create new TKeys
Long64_tTFile::fBytesReadNumber of bytes read from this file
Long64_tTFile::fBytesReadExtraNumber of extra bytes (overhead) read by the readahead buffer
Long64_tTFile::fBytesWriteNumber of bytes written to this file
TFileCacheRead*TFile::fCacheRead!Pointer to the read cache (if any)
TMap*TFile::fCacheReadMap!Pointer to the read cache (if any)
TFileCacheWrite*TFile::fCacheWrite!Pointer to the write cache (if any)
TArrayC*TFile::fClassIndex!Index of TStreamerInfo classes written to this file
Int_tTFile::fCompressCompression level and algorithm
TDirectory::TContext*TDirectory::fContext!Pointer to a list of TContext object pointing to this TDirectory
Int_tTFile::fDFile descriptor
TDatimeTDirectoryFile::fDatimeCDate and time when directory is created
TDatimeTDirectoryFile::fDatimeMDate and time of last modification
XMLDocPointer_tfDoc!
Long64_tTFile::fENDLast used byte in file
TFile*TDirectoryFile::fFilepointer to current file in memory
TList*TFile::fFreeFree segments linked list table
Int_tfIOVersion! indicates format of ROOT xml file
TList*TFile::fInfoCache!Cached list of the streamer infos in this file
Bool_tTFile::fInitDone!True if the file has been initialized
Bool_tTFile::fIsArchive!True if this is a pure archive file
Bool_tTFile::fIsPcmFile!True if the file is a ROOT pcm file.
Bool_tTFile::fIsRootFile!True is this is a ROOT file, raw file otherwise
Long64_tfKeyCounter! counter of created keys, used for keys id
TList*TDirectoryFile::fKeysPointer to keys list in memory
TList*TDirectory::fListList of objects in memory
Bool_tTDirectoryFile::fModifiedtrue if directory has been modified
TObject*TDirectory::fMotherpointer to mother of the directory
Bool_tTFile::fMustFlush!True if the file buffers must be flushed
Int_tTFile::fNProcessIDsNumber of TProcessID written to this file
TStringTNamed::fNameobject identifier
Int_tTFile::fNbytesFreeNumber of bytes for free segments structure
Int_tTFile::fNbytesInfoNumber of bytes for StreamerInfo record
Int_tTDirectoryFile::fNbytesKeysNumber of bytes for the keys
Int_tTDirectoryFile::fNbytesNameNumber of bytes in TNamed at creation time
Bool_tTFile::fNoAnchorInName!True if we don't want to force the anchor to be appended to the file name
Long64_tTFile::fOffset!Seek offset cache
TList*TFile::fOpenPhases!Time info about open phases
TStringTFile::fOptionFile options
TStringTDirectory::fPathBuffer!Buffer for GetPath() function
TObjArray*TFile::fProcessIDs!Array of pointers to TProcessIDs
Int_tTFile::fReadCallsNumber of read calls ( not counting the cache calls )
TStringTFile::fRealNameEffective real file name (not original url)
Int_tTXMLSetup::fRefCounter! counter , used to build id of xml references
Long64_tTDirectoryFile::fSeekDirLocation of directory on file
Long64_tTFile::fSeekFreeLocation on disk of free segments structure
Long64_tTFile::fSeekInfoLocation on disk of StreamerInfo record
Long64_tTDirectoryFile::fSeekKeysLocation of Keys record on file
Long64_tTDirectoryFile::fSeekParentLocation of parent directory on file
Bool_tTXMLSetup::fStoreStreamerInfos
TStringTXMLSetup::fStrBuf! buffer, used in XmlDefineClass() function
XMLNodePointer_tfStreamerInfoNode! pointer of node with streamer info data
Double_tTFile::fSum2BufferSum of squares of buffer sizes of objects written so far
Double_tTFile::fSumBufferSum of buffer sizes of objects written so far
TStringTNamed::fTitleobject title
TUUIDTDirectory::fUUIDUnique identifier
Char_tTFile::fUnitsNumber of bytes for file pointers
TUrlTFile::fUrl!URL of file
Bool_tTXMLSetup::fUseDtd
Bool_tTXMLSetup::fUseNamespaces
Int_tTFile::fVersionFile format version
Bool_tTDirectoryFile::fWritabletrue if directory is writable
Int_tTFile::fWrittenNumber of objects written so far
TXMLEngine*fXML! object for interface with xml library
TXMLSetup::EXMLLayoutTXMLSetup::fXmlLayout
static Bool_tTDirectory::fgAddDirectory!flag to add histograms, graphs,etc to the directory
static TList*TFile::fgAsyncOpenRequestsList of handles for pending open requests
static atomic<Long64_t>TFile::fgBytesReadNumber of bytes read by all TFile objects
static atomic<Long64_t>TFile::fgBytesWriteNumber of bytes written by all TFile objects
static TStringTFile::fgCacheFileDirDirectory where to locally stage files
static Bool_tTFile::fgCacheFileDisconnectedIndicates, we trust in the files in the cache dir without stat on the cached file
static Bool_tTFile::fgCacheFileForceIndicates, to force all READ to CACHEREAD
static atomic<Long64_t>TFile::fgFileCounterCounter for all opened files
static TStringTXMLSetup::fgNameSpaceBase
static Bool_tTFile::fgOnlyStagedBefore the file is opened, it is checked, that the file is staged, if not, the open fails
static UInt_tTFile::fgOpenTimeoutTimeout for open operations in ms - 0 corresponds to blocking i/o
static atomic<Int_t>TFile::fgReadCallsNumber of bytes read from all TFile objects
static Bool_tTFile::fgReadInfoif true (default) ReadStreamerInfo is called when opening a file
static Int_tTFile::fgReadaheadSizeReadahead buffer size

Class Charts

Inheritance Chart:
TObject
TNamed
TDirectory
TDirectoryFile
TFile
TXMLSetup
TXMLFile

Function documentation

TXMLFile()
 default TXMLFile constructor
TXMLFile(const char* filename, Option_t* option = "read", const char* title = "title", Int_t compression = 1)
 Open or creates local XML file with name filename.
 It is recommended to specify filename as "<file>.xml". The suffix ".xml"
 will be used by object browsers to automatically identify the file as
 a XML file. If the constructor fails in any way IsZombie() will
 return true. Use IsOpen() to check if the file is (still) open.

 If option = NEW or CREATE   create a new file and open it for writing,
                             if the file already exists the file is
                             not opened.
           = RECREATE        create a new file, if the file already
                             exists it will be overwritten.
           = 2xoo            create a new file with specified xml settings
                             for more details see TXMLSetup class
           = UPDATE          open an existing file for writing.
                             if no file exists, it is created.
           = READ            open an existing file for reading.

 For more details see comments for TFile::TFile() constructor

 For a moment TXMLFile does not support TTree objects and subdirectories
void InitXmlFile(Bool_t create)
 initialize xml file and correspondent structures
 identical to TFile::Init() function
void Close(Option_t* option = "")
 Close a XML file
 For more comments see TFile::Close() function
~TXMLFile()
 destructor of TXMLFile object
void operator=(const TXMLFile& )
 make private to exclude copy operator
Bool_t IsOpen() const
 return kTRUE if file is opened and can be accessed
Int_t ReOpen(Option_t* mode)
 Reopen a file with a different access mode, like from READ to
 See TFile::Open() for details
TKey* CreateKey(TDirectory* mother, const TObject* obj, const char* name, Int_t bufsize)
 create XML key, which will store object in xml structures
TKey* CreateKey(TDirectory* mother, const void* obj, const TClass* cl, const char* name, Int_t bufsize)
 create XML key, which will store object in xml structures
void ProduceFileNames(const char* filename, TString& fname, TString& dtdname)
 function produces pair of xml and dtd file names
void SaveToFile()
 Saves xml structures to file
 xml elements are kept in list of TKeyXML objects
 When saving, all this elements are linked to root xml node
 In the end StreamerInfo structures are added
 After xml document is saved, all nodes will be unlinked from root node
 and kept in memory.
 Only Close() or destructor relase memory, used by xml structures
void CombineNodesTree(TDirectory* dir, XMLNodePointer_t topnode, Bool_t dolink)
 Connect/disconnect all file nodes to single tree before/after saving
Bool_t ReadFromFile()
 read document from file
 Now full content of docuument reads into the memory
 Then document decomposed to separate keys and streamer info structures
 All inrelevant data will be cleaned
Int_t ReadKeysList(TDirectory* dir, XMLNodePointer_t topnode)
 Read list of keys for directory
void WriteStreamerInfo()
 convert all TStreamerInfo, used in file, to xml format
TList* GetStreamerInfoList()
 Read streamerinfo structures from xml format and provide them in the list
 It is user responsibility to destroy this list
void StoreStreamerElement(XMLNodePointer_t node, TStreamerElement* elem)
 store data of single TStreamerElement in streamer node
void ReadStreamerElement(XMLNodePointer_t node, TStreamerInfo* info)
 read and reconstruct single TStreamerElement from xml node
void SetXmlLayout(TXMLSetup::EXMLLayout layout)
 Change layout of objects in xml file
 Can be changed only for newly created file.

 Currently there are two supported layouts:

 TXMLSetup::kSpecialized = 2
    This is default layout of the file, when xml nodes names class names and data member
    names are used. For instance:
          <TAttLine version="1">
            <fLineColor v="1"/>
            <fLineStyle v="1"/>
            <fLineWidth v="1"/>
          </TAttLine>

 TXMLSetup::kGeneralized = 3
    For this layout all nodes name does not depend from class definitions.
    The same class looks like
          <Class name="TAttLine" version="1">
            <Member name="fLineColor" v="1"/>
            <Member name="fLineStyle" v="1"/>
            <Member name="fLineWidth" v="1"/>
          </Member>

void SetStoreStreamerInfos(Bool_t iConvert = kTRUE)
 If true, all correspondent to file TStreamerInfo objects will be stored in file
 this allows to apply schema avolution later for this file
 may be usefull, when file used outside ROOT and TStreamerInfo objects does not required
 Can be changed only for newly created file.
void SetUsedDtd(Bool_t use = kTRUE)
 Specify usage of DTD for this file.
 Currently this option not available (always false).
 Can be changed only for newly created file.
void SetUseNamespaces(Bool_t iUseNamespaces = kTRUE)
 Specifiy usage of namespaces in xml file
 In current implementation every instrumented class in file gets its unique namespace,
 which is equal to name of class and refer to root documentation page like
 <TAttPad xmlns:TAttPad="http://root.cern.ch/root/htmldoc/TAttPad.html" version="3">
 And xml node for class member gets its name as combination of class name and member name
            <TAttPad:fLeftMargin v="0.100000"/>
            <TAttPad:fRightMargin v="0.100000"/>
            <TAttPad:fBottomMargin v="0.100000"/>
            and so on
 Usage of namespace increase size of xml file, but makes file more readable
 and allows to produce DTD in the case, when in several classes data member has same name
 Can be changed only for newly created file.
Bool_t AddXmlComment(const char* comment)
 Add comment line on the top of the xml document
 This line can only be seen in xml editor and cannot be accessed later
 with TXMLFile methods
Bool_t AddXmlStyleSheet(const char* href, const char* type = "text/css", const char* title = 0, int alternate = -1, const char* media = 0, const char* charset = 0)
 Adds style sheet definition on the top of xml document
 Creates <?xml-stylesheet alternate="yes" title="compact" href="small-base.css" type="text/css"?>
 Attributes href and type must be supplied,
  other attributes: title, alternate, media, charset are optional
 if alternate==0, attribyte alternate="no" will be created,
 if alternate>0, attribute alternate="yes"
 if alternate<0, attribute will not be created
 This style sheet definition cannot be later access with TXMLFile methods.
Bool_t AddXmlLine(const char* line)
 Add just one line on the top of xml document
 For instance, line can contain special xml processing instructions
 Line should has correct xml syntax that later it can be decoded by xml parser
 To be parsed later by TXMLFile again, this line should contain either
 xml comments or xml processing instruction
Long64_t DirCreateEntry(TDirectory* )
 Create key for directory entry in the key
TKeyXML* FindDirKey(TDirectory* dir)
 Serach for key which correspond to direcory dir
TDirectory* FindKeyDir(TDirectory* mother, Long64_t keyid)
Find a directory in motherdir with a seek equal to keyid
Int_t DirReadKeys(TDirectory* )
 Read keys for directory
 Make sence only once, while next time no new subnodes will be created
void DirWriteKeys(TDirectory* )
 Update key attributes
void DirWriteHeader(TDirectory* )
Write the directory header
Int_t SysOpen(const char* , Int_t , UInt_t )
 Interface to basic system I/O routines
{ return 0; }
Int_t SysClose(Int_t )
{ return 0; }
Int_t SysRead(Int_t , void* , Int_t )
{ return 0; }
Int_t SysWrite(Int_t , const void* , Int_t )
{ return 0; }
Long64_t SysSeek(Int_t , Long64_t , Int_t )
{ return 0; }
Int_t SysStat(Int_t , Long_t* , Long64_t* , Long_t* , Long_t* )
{ return 0; }
Int_t SysSync(Int_t )
{ return 0; }
TXMLFile()
void DrawMap(const char* = "*", Option_t* = "")
{}
void FillBuffer(char*& )
{}
void Flush()
{}
Long64_t GetEND() const
{ return 0; }
Int_t GetErrno() const
{ return 0; }
void ResetErrno() const
{}
Int_t GetNfree() const
{ return 0; }
Int_t GetNbytesInfo() const
{return 0; }
Int_t GetNbytesFree() const
{return 0; }
Long64_t GetSeekFree() const
{return 0; }
Long64_t GetSeekInfo() const
{return 0; }
Long64_t GetSize() const
{ return 0; }
Int_t GetIOVersion() const
{ return fIOVersion; }
void MakeFree(Long64_t , Long64_t )
{}
void MakeProject(const char* , const char* = "*", Option_t* = "new")
{}
void Map()
{}
void Paint(Option_t* = "")
{}
void Print(Option_t* = "") const
{}
Bool_t ReadBuffer(char* , Int_t )
{ return kFALSE; }
Bool_t ReadBuffer(char* , Long64_t , Int_t )
{ return kFALSE; }
void ReadFree()
{}
Int_t Recover()
{ return 0; }
void Seek(Long64_t , TFile::ERelativeTo = kBeg)
{}
void SetEND(Long64_t )
{}
Int_t Sizeof() const
{ return 0; }
Bool_t WriteBuffer(const char* , Int_t )
{ return kFALSE; }
Int_t Write(const char* = 0, Int_t = 0, Int_t = 0)
{ return 0; }
Int_t Write(const char* = 0, Int_t = 0, Int_t = 0) const
{ return 0; }
void WriteFree()
{}
void WriteHeader()
{}