source: branches/Mars_McMismatchStudy/mbase/MEnv.h@ 17975

Last change on this file since 17975 was 9518, checked in by tbretz, 15 years ago
*** empty log message ***
File size: 3.2 KB
Line 
1#ifndef MARS_MEnv
2#define MARS_MEnv
3
4#ifndef ROOT_TEnv
5#include <TEnv.h>
6#endif
7
8#ifndef ROOT_TOrdCollection
9#include <TOrdCollection.h>
10#endif
11
12class TAttLine;
13class TAttMarker;
14class TAttText;
15class TAttFill;
16class TPave;
17
18class MArgs;
19
20class MEnv : public TEnv
21{
22private:
23 TOrdCollection fChecked; //!
24
25 TString fName;
26
27 TString Compile(TString str, const char *post) const;
28 Int_t ReadInclude();
29
30public:
31 MEnv(const char *name="", const char *defname=0);
32
33 Bool_t IsValid() const { return !TString(GetRcName()).IsNull(); }
34
35 TObject *Clone(const char *newname="") const;
36
37 Bool_t Touch(const char *name) { return !TString(GetValue(name, "")).IsNull(); }
38
39 Int_t GetEntries() const;
40
41 Int_t GetValue(const char *name, Int_t dflt);
42 Double_t GetValue(const char *name, Double_t dflt);
43 const char *GetValue(const char *name, const char *dflt="");
44
45 // GetValue: regexp
46
47 const char *GetName() const;
48 void SetName(const char *name=0) { fName = name; }
49
50 Int_t GetColor(const char *name, Int_t dftl);
51 Int_t GetAlign(const char *name, Int_t dftl);
52 Int_t GetFillStyle(const char *name, Int_t dftl);
53 Int_t GetLineStyle(const char *name, Int_t dftl);
54
55 void GetAttributes(const char *name, TObject *obj, TObject *dftl=0);
56 void GetAttLine(const char *name, TAttLine &line, TAttLine *dftl=0);
57 void GetAttText(const char *name, TAttText &text, TAttText *dftl=0);
58 void GetAttFill(const char *name, TAttFill &fill, TAttFill *dftl=0);
59 void GetAttMarker(const char *name, TAttMarker &marker, TAttMarker *dftl=0);
60 void GetAttPave(const char *name, TPave &pave, TPave *dftl=0);
61
62 void SetColor(const char *name, Int_t col);
63 void SetAlign(const char *name, Int_t align);
64 void SetFillStyle(const char *name, Int_t style);
65 void SetLineStyle(const char *name, Int_t style);
66 void SetMarkerStyle(const char *name, Int_t style);
67
68 void SetAttributes(const char *name, const TObject *obj);
69 void SetAttLine(const char *name, const TAttLine &line);
70 void SetAttText(const char *name, const TAttText &text);
71 void SetAttFill(const char *name, const TAttFill &fill);
72 void SetAttMarker(const char *name, const TAttMarker &marker);
73 void SetAttPave(const char *name, const TPave &pave);
74
75 void AddEnv(const TEnv &env, Bool_t overwrite=kTRUE);
76 Bool_t TakeEnv(MArgs &args, Bool_t print=kFALSE, Bool_t overwrite=kTRUE);
77
78 Int_t Read(const char *name=0);
79 Int_t ReadFile(const char *fname, EEnvLevel level);
80
81 Int_t WriteFile(const char *filename, EEnvLevel level) { return TEnv::WriteFile(filename, level); }
82 Int_t WriteFile(const char *filename) { return WriteFile(filename, kEnvLocal); } //*MENU*
83
84 void PrintEnv(EEnvLevel level = kEnvAll) const;
85 void Print(Option_t *option) const { TEnv::Print(option); }
86 void Print() const { PrintEnv(kEnvLocal); } //*MENU*
87
88 void PrintUntouched() const;
89 Int_t GetNumUntouched() const;
90
91 ClassDef(MEnv, 1) // A slightly more advanced version of TEnv
92};
93
94#endif
95
Note: See TracBrowser for help on using the repository browser.