TDbiCfgPromptConfigurable.hxx
Go to the documentation of this file.00001 #ifndef CFGPROMPTCONFIGURABLE
00002 #define CFGPROMPTCONFIGURABLE
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 #include <string>
00057 #include "TDbiRegistry.hxx"
00058
00059 class TDbiCfgDialog;
00060
00061 class TDbiCfgPromptConfigurable
00062 {
00063 public:
00064 TDbiCfgPromptConfigurable();
00065 TDbiCfgPromptConfigurable(const TDbiRegistry& r) {InitializeConfig(r);};
00066 virtual ~TDbiCfgPromptConfigurable() {};
00067
00068
00069 const TDbiRegistry& GetConfig() const { return fConfig; };
00070
00071
00072 void UnLockKeys() { fConfig.UnLockKeys(); };
00073 void LockKeys() { fConfig.LockKeys(); };
00074 void UnLockValues() { fConfig.UnLockValues(); };
00075 void LockValues() { fConfig.LockValues(); };
00076
00077
00078
00079 void Set(const char* key, char val);
00080 void Set(const char* key, const char* val);
00081 void Set(const char* key, double val);
00082 void Set(const char* key, int val);
00083 void Set(const char* key, const TDbiRegistry& val);
00084 void Set(const char* setstring);
00085 void Set(TDbiCfgDialog* d=0);
00086
00087
00088
00089 void Set(const TDbiRegistry& stuff, Bool_t recursive = false);
00090
00091
00092 static Bool_t Split(const char* line, char sep, std::string& a, std::string& b);
00093 static Bool_t Split(const std::string& line, char sep, std::string& a, std::string& b)
00094 { return Split(line.c_str(),sep,a,b); };
00095 static Bool_t IsInt(const std::string& s, Int_t& val);
00096 static Bool_t IsFloat(const std::string& s, Double_t& val);
00097
00098
00099 static Bool_t SafeMerge(TDbiRegistry& modify,
00100 const TDbiRegistry& stuff,
00101 Bool_t recursive = false );
00102
00103
00104 protected:
00105
00106
00107 void InitializeConfig(const TDbiRegistry& initConfig);
00108
00109
00110 virtual void ConfigModified(void)=0;
00111
00112 private:
00113 TDbiRegistry fConfig;
00114 TDbiRegistry fDefaultConfig;
00115
00116 ClassDef(TDbiCfgPromptConfigurable,1);
00117 };
00118
00119
00120 #endif