source: trunk/MagicSoft/Mars/mbase/MEnv.h@ 8957

Last change on this file since 8957 was 8882, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 3.0 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 Compile(TString str, const char *post) const;
26 Int_t ReadInclude();
27
28public:
29 MEnv(const char *name="");
30
31 Bool_t IsValid() const { return !TString(GetRcName()).IsNull(); }
32
33 TObject *Clone(const char *newname="") const;
34
35 Bool_t Touch(const char *name) { return !TString(GetValue(name, "")).IsNull(); }
36
37 Int_t GetEntries() const;
38
39 Int_t GetValue(const char *name, Int_t dflt);
40 Double_t GetValue(const char *name, Double_t dflt);
41 const char *GetValue(const char *name, const char *dflt);
42
43 const char *GetName() const;
44
45 Int_t GetColor(const char *name, Int_t dftl);
46 Int_t GetAlign(const char *name, Int_t dftl);
47 Int_t GetFillStyle(const char *name, Int_t dftl);
48 Int_t GetLineStyle(const char *name, Int_t dftl);
49
50 void GetAttributes(const char *name, TObject *obj, TObject *dftl=0);
51 void GetAttLine(const char *name, TAttLine &line, TAttLine *dftl=0);
52 void GetAttText(const char *name, TAttText &text, TAttText *dftl=0);
53 void GetAttFill(const char *name, TAttFill &fill, TAttFill *dftl=0);
54 void GetAttMarker(const char *name, TAttMarker &marker, TAttMarker *dftl=0);
55 void GetAttPave(const char *name, TPave &pave, TPave *dftl=0);
56
57 void SetColor(const char *name, Int_t col);
58 void SetAlign(const char *name, Int_t align);
59 void SetFillStyle(const char *name, Int_t style);
60 void SetLineStyle(const char *name, Int_t style);
61 void SetMarkerStyle(const char *name, Int_t style);
62
63 void SetAttributes(const char *name, const TObject *obj);
64 void SetAttLine(const char *name, const TAttLine &line);
65 void SetAttText(const char *name, const TAttText &text);
66 void SetAttFill(const char *name, const TAttFill &fill);
67 void SetAttMarker(const char *name, const TAttMarker &marker);
68 void SetAttPave(const char *name, const TPave &pave);
69
70 void AddEnv(const TEnv &env, Bool_t overwrite=kTRUE);
71 Bool_t TakeEnv(MArgs &args, Bool_t print=kFALSE, Bool_t overwrite=kTRUE);
72
73 Int_t ReadFile(const char *fname, EEnvLevel level);
74
75 Int_t WriteFile(const char *filename, EEnvLevel level) { return TEnv::WriteFile(filename, level); }
76 Int_t WriteFile(const char *filename) { return WriteFile(filename, kEnvLocal); } //*MENU*
77
78 void PrintEnv(EEnvLevel level = kEnvAll) const;
79 void Print(Option_t *option) const { TEnv::Print(option); }
80 void Print() const { PrintEnv(kEnvLocal); } //*MENU*
81
82 void PrintUntouched() const;
83 Int_t GetNumUntouched() const;
84
85 ClassDef(MEnv, 0) // A slightly more advanced version of TEnv
86};
87
88#endif
89
Note: See TracBrowser for help on using the repository browser.