Changeset 8539 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 05/25/07 13:48:15 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MEnv.cc
r8240 r8539 18 18 ! Author(s): Thomas Bretz 2/2005 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 520 ! Copyright: MAGIC Software Development, 2000-2007 21 21 ! 22 22 ! … … 51 51 //--------------------------------------------------------------------------- 52 52 // 53 // (Default) constructor. If the given file cannot be accessed the data54 // member fName is set to ""which can then be checked by IsValid()55 // 56 MEnv::MEnv(const char *name) : TEnv(name) , fName(name)53 // (Default) constructor. If the given file cannot be accessed SetRcName("") 54 // is called which can then be checked by IsValid() 55 // 56 MEnv::MEnv(const char *name) : TEnv(name) 57 57 { 58 58 fChecked.SetOwner(); 59 59 60 if ( fName.IsNull())60 if (!IsValid()) 61 61 return; 62 62 … … 65 65 66 66 if (gSystem->AccessPathName(fname, kFileExists)) 67 fName = ""; 67 fname = ""; 68 69 SetRcName(fname); 70 71 if (GetEntries()<=0 && !fname.IsNull() && fname!=name) 72 ReadFile(fname, kEnvLocal);; 73 } 74 75 //--------------------------------------------------------------------------- 76 // 77 // Return the total number of entries in the table 78 // 79 Int_t MEnv::GetEntries() const 80 { 81 if (!GetTable()) 82 return -1; 83 84 return GetTable()->GetEntries(); 68 85 } 69 86 … … 123 140 { 124 141 MEnv *env = new MEnv("/dev/null"); 125 env-> fName = fName;142 env->SetRcName(GetRcName()); 126 143 env->AddEnv(*this); 127 144 return env; … … 836 853 int i=0; 837 854 gLog << inf << flush; 838 gLog.Separator("Untouched Resources"); 855 856 TString sep = "Untouched Resources - "; 857 sep += GetRcName(); 858 gLog.Separator(sep); 839 859 TIter Next(GetTable()); 840 860 TObject *o=0; -
trunk/MagicSoft/Mars/mbase/MEnv.h
r8384 r8539 21 21 TOrdCollection fChecked; 22 22 23 TString fName; // A workaround!24 25 23 TString Compile(TString str, const char *post) const; 26 24 … … 28 26 MEnv(const char *name=""); 29 27 30 Bool_t IsValid() const { return ! fName.IsNull(); }28 Bool_t IsValid() const { return !TString(GetRcName()).IsNull(); } 31 29 32 30 TObject *Clone(const char *newname="") const; … … 34 32 Bool_t Touch(const char *name) { return !TString(GetValue(name, "")).IsNull(); } 35 33 34 Int_t GetEntries() const; 35 36 36 Int_t GetValue(const char *name, Int_t dflt); 37 37 Double_t GetValue(const char *name, Double_t dflt); 38 38 const char *GetValue(const char *name, const char *dflt); 39 39 40 const char *GetName() const { return fName; }40 const char *GetName() const { return GetRcName(); } 41 41 42 42 Int_t GetColor(const char *name, Int_t dftl);
Note:
See TracChangeset
for help on using the changeset viewer.