#ifndef ROOT_TDirectory
#define ROOT_TDirectory
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
#ifndef ROOT_TList
#include "TList.h"
#endif
#ifndef ROOT_TDatime
#include "TDatime.h"
#endif
#ifndef ROOT_TUUID
#include "TUUID.h"
#endif
class TBrowser;
class TKey;
class TFile;
R__EXTERN TDirectory *gDirectory;
class TDirectory : public TNamed {
public:
class TContext {
private:
TDirectory *fDirectory;
TContext *fPrevious;
TContext *fNext;
TContext(TContext&);
TContext& operator=(TContext&);
void CdNull();
friend class TDirectory;
public:
TContext(TDirectory* previous, TDirectory* newCurrent)
: fDirectory(previous),fPrevious(0),fNext(0)
{
if ( fDirectory ) fDirectory->RegisterContext(this);
if ( newCurrent ) newCurrent->cd();
}
TContext(TDirectory* newCurrent) : fDirectory(gDirectory),fPrevious(0),fNext(0)
{
if ( fDirectory ) fDirectory->RegisterContext(this);
if ( newCurrent ) newCurrent->cd();
}
~TContext()
{
if ( fDirectory ) {
fDirectory->UnregisterContext(this);
fDirectory->cd();
}
else CdNull();
}
};
protected:
TObject *fMother;
TList *fList;
TUUID fUUID;
TString fPathBuffer;
TContext *fContext;
static Bool_t fgAddDirectory;
Bool_t cd1(const char *path);
static Bool_t Cd1(const char *path);
virtual void CleanTargets();
void FillFullPath(TString& buf) const;
void RegisterContext(TContext *ctxt);
void UnregisterContext(TContext *ctxt);
friend class TContext;
protected:
TDirectory(const TDirectory &directory);
void operator=(const TDirectory &);
public:
TDirectory();
TDirectory(const char *name, const char *title, Option_t *option="", TDirectory* motherDir = 0);
virtual ~TDirectory();
static void AddDirectory(Bool_t add=kTRUE);
static Bool_t AddDirectoryStatus();
virtual void Append(TObject *obj, Bool_t replace = kFALSE);
virtual void Add(TObject *obj, Bool_t replace = kFALSE) { Append(obj,replace); }
virtual Int_t AppendKey(TKey *) {return 0;}
virtual void Browse(TBrowser *b);
virtual void Build(TFile* motherFile = 0, TDirectory* motherDir = 0);
virtual void Clear(Option_t *option="");
virtual TObject *CloneObject(const TObject *obj, Bool_t autoadd = kTRUE);
virtual void Close(Option_t *option="");
virtual void Copy(TObject &) const { MayNotUse("Copy(TObject &)"); }
virtual Bool_t cd(const char *path = 0);
virtual void DeleteAll(Option_t *option="");
virtual void Delete(const char *namecycle="");
virtual void Draw(Option_t *option="");
virtual TKey *FindKey(const char * ) const {return 0;}
virtual TKey *FindKeyAny(const char * ) const {return 0;}
virtual TObject *FindObject(const char *name) const;
virtual TObject *FindObject(const TObject *obj) const;
virtual TObject *FindObjectAny(const char *name) const;
virtual TObject *FindObjectAnyFile(const char * ) const {return 0;}
virtual TObject *Get(const char *namecycle);
virtual TDirectory *GetDirectory(const char *namecycle, Bool_t printError = false, const char *funcname = "GetDirectory");
template <class T> inline void GetObject(const char* namecycle, T*& ptr)
{
ptr = (T*)GetObjectChecked(namecycle,TBuffer::GetClass(typeid(T)));
}
virtual void *GetObjectChecked(const char *namecycle, const char* classname);
virtual void *GetObjectChecked(const char *namecycle, const TClass* cl);
virtual void *GetObjectUnchecked(const char *namecycle);
virtual Int_t GetBufferSize() const {return 0;}
virtual TFile *GetFile() const { return 0; }
virtual TKey *GetKey(const char * , Short_t =9999) const {return 0;}
virtual TList *GetList() const { return fList; }
virtual TList *GetListOfKeys() const { return 0; }
virtual TObject *GetMother() const { return fMother; }
virtual TDirectory *GetMotherDir() const { return fMother==0 ? 0 : dynamic_cast<TDirectory*>(fMother); }
virtual Int_t GetNbytesKeys() const { return 0; }
virtual Int_t GetNkeys() const { return 0; }
virtual Long64_t GetSeekDir() const { return 0; }
virtual Long64_t GetSeekParent() const { return 0; }
virtual Long64_t GetSeekKeys() const { return 0; }
virtual const char *GetPathStatic() const;
virtual const char *GetPath() const;
TUUID GetUUID() const {return fUUID;}
virtual Bool_t IsFolder() const { return kTRUE; }
virtual Bool_t IsModified() const { return kFALSE; }
virtual Bool_t IsWritable() const { return kFALSE; }
virtual void ls(Option_t *option="") const;
virtual TDirectory *mkdir(const char *name, const char *title="");
virtual TFile *OpenFile(const char * , Option_t * = "",
const char * = "", Int_t = 1,
Int_t = 0) {return 0;}
virtual void Paint(Option_t *option="");
virtual void Print(Option_t *option="") const;
virtual void Purge(Short_t =1) {}
virtual void pwd() const;
virtual void ReadAll(Option_t * ="") {}
virtual Int_t ReadKeys(Bool_t =kTRUE) {return 0;}
virtual Int_t ReadTObject(TObject * , const char * ) {return 0;}
virtual TObject *Remove(TObject*);
virtual void RecursiveRemove(TObject *obj);
virtual void rmdir(const char *name);
virtual void Save() {}
virtual Int_t SaveObjectAs(const TObject * , const char * ="", Option_t * ="") const;
virtual void SaveSelf(Bool_t = kFALSE) {}
virtual void SetBufferSize(Int_t ) {}
virtual void SetModified() {}
virtual void SetMother(const TObject *mother) {fMother = (TObject*)mother;}
virtual void SetName(const char* newname);
virtual void SetTRefAction(TObject * , TObject * ) {}
virtual void SetSeekDir(Long64_t) {}
virtual void SetWritable(Bool_t) {}
virtual Int_t Sizeof() const {return 0;}
virtual Int_t Write(const char * =0, Int_t =0, Int_t =0){return 0;}
virtual Int_t Write(const char * =0, Int_t =0, Int_t =0) const {return 0;}
virtual Int_t WriteTObject(const TObject *obj, const char *name =0, Option_t * ="", Int_t =0);
template <class T> inline Int_t WriteObject(const T* obj, const char* name, Option_t *option="", Int_t bufsize=0)
{
return WriteObjectAny(obj,TBuffer::GetClass(typeid(T)),name,option,bufsize);
}
virtual Int_t WriteObjectAny(const void *, const char * , const char * , Option_t * ="", Int_t =0) {return 0;}
virtual Int_t WriteObjectAny(const void *, const TClass * , const char * , Option_t * ="", Int_t =0) {return 0;}
virtual void WriteDirHeader() {}
virtual void WriteKeys() {}
static Bool_t Cd(const char *path);
static void DecodeNameCycle(const char *namecycle, char *name, Short_t &cycle);
static void EncodeNameCycle(char *buffer, const char *name, Short_t cycle);
ClassDef(TDirectory,5)
};
#endif
Last change: Wed Jun 25 08:36:12 2008
Last generated: 2008-06-25 08:36
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.