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

Last change on this file since 9343 was 9301, checked in by tbretz, 16 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 // GetValue: regexp
44
45 const char *GetName() const;
46
47 Int_t GetColor(const char *name, Int_t dftl);
48 Int_t GetAlign(const char *name, Int_t dftl);
49 Int_t GetFillStyle(const char *name, Int_t dftl);
50 Int_t GetLineStyle(const char *name, Int_t dftl);
51
52 void GetAttributes(const char *name, TObject *obj, TObject *dftl=0);
53 void GetAttLine(const char *name, TAttLine &line, TAttLine *dftl=0);
54 void GetAttText(const char *name, TAttText &text, TAttText *dftl=0);
55 void GetAttFill(const char *name, TAttFill &fill, TAttFill *dftl=0);
56 void GetAttMarker(const char *name, TAttMarker &marker, TAttMarker *dftl=0);
57 void GetAttPave(const char *name, TPave &pave, TPave *dftl=0);
58
59 void SetColor(const char *name, Int_t col);
60 void SetAlign(const char *name, Int_t align);
61 void SetFillStyle(const char *name, Int_t style);
62 void SetLineStyle(const char *name, Int_t style);
63 void SetMarkerStyle(const char *name, Int_t style);
64
65 void SetAttributes(const char *name, const TObject *obj);
66 void SetAttLine(const char *name, const TAttLine &line);
67 void SetAttText(const char *name, const TAttText &text);
68 void SetAttFill(const char *name, const TAttFill &fill);
69 void SetAttMarker(const char *name, const TAttMarker &marker);
70 void SetAttPave(const char *name, const TPave &pave);
71
72 void AddEnv(const TEnv &env, Bool_t overwrite=kTRUE);
73 Bool_t TakeEnv(MArgs &args, Bool_t print=kFALSE, Bool_t overwrite=kTRUE);
74
75 Int_t ReadFile(const char *fname, EEnvLevel level);
76
77 Int_t WriteFile(const char *filename, EEnvLevel level) { return TEnv::WriteFile(filename, level); }
78 Int_t WriteFile(const char *filename) { return WriteFile(filename, kEnvLocal); } //*MENU*
79
80 void PrintEnv(EEnvLevel level = kEnvAll) const;
81 void Print(Option_t *option) const { TEnv::Print(option); }
82 void Print() const { PrintEnv(kEnvLocal); } //*MENU*
83
84 void PrintUntouched() const;
85 Int_t GetNumUntouched() const;
86
87 ClassDef(MEnv, 0) // A slightly more advanced version of TEnv
88};
89
90#endif
91
Note: See TracBrowser for help on using the repository browser.