#ifndef ROOT_TEnv
#define ROOT_TEnv
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
class THashList;
class TEnv;
class TEnvParser;
class TReadEnvParser;
class TWriteEnvParser;
enum EEnvLevel {
kEnvGlobal,
kEnvUser,
kEnvLocal,
kEnvChange,
kEnvAll
};
class TEnvRec : public TObject {
friend class TEnv;
friend class TEnvParser;
friend class TReadEnvParser;
friend class TWriteEnvParser;
private:
TString fName;
TString fType;
TString fValue;
EEnvLevel fLevel;
Bool_t fModified;
TEnvRec(const char *n, const char *v, const char *t, EEnvLevel l);
Int_t Compare(const TObject *obj) const;
void ChangeValue(const char *v, const char *t, EEnvLevel l,
Bool_t append = kFALSE, Bool_t ignoredup = kFALSE);
TString ExpandValue(const char *v);
public:
TEnvRec(): fName(), fType(), fValue(), fLevel(kEnvAll), fModified(kTRUE) { }
const char *GetName() const { return fName; }
const char *GetValue() const { return fValue; }
const char *GetType() const { return fType; }
EEnvLevel GetLevel() const { return fLevel; }
ULong_t Hash() const { return fName.Hash(); }
ClassDef(TEnvRec,2)
};
class TEnv : public TObject {
private:
THashList *fTable;
TString fRcName;
Bool_t fIgnoreDup;
TEnv(const TEnv&);
TEnv& operator=(const TEnv&);
const char *Getvalue(const char *name);
public:
TEnv(const char *name="");
virtual ~TEnv();
THashList *GetTable() const { return fTable; }
Bool_t Defined(const char *name)
{ return Getvalue(name) != 0; }
virtual const char *GetRcName() const { return fRcName; }
virtual void SetRcName(const char *name) { fRcName = name; }
virtual Int_t GetValue(const char *name, Int_t dflt);
virtual Double_t GetValue(const char *name, Double_t dflt);
virtual const char *GetValue(const char *name, const char *dflt);
virtual void SetValue(const char *name, const char *value,
EEnvLevel level = kEnvChange,
const char *type = 0);
virtual void SetValue(const char *name, EEnvLevel level = kEnvChange);
virtual void SetValue(const char *name, Int_t value);
virtual void SetValue(const char *name, Double_t value);
virtual TEnvRec *Lookup(const char *n);
virtual Int_t ReadFile(const char *fname, EEnvLevel level);
virtual Int_t WriteFile(const char *fname, EEnvLevel level = kEnvAll);
virtual void Save();
virtual void SaveLevel(EEnvLevel level);
virtual void Print(Option_t *option="") const;
virtual void PrintEnv(EEnvLevel level = kEnvAll) const;
Bool_t IgnoreDuplicates(Bool_t ignore);
ClassDef(TEnv,2)
};
R__EXTERN TEnv *gEnv;
#endif
Last change: Wed Jun 25 08:36:25 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.