00001 #ifndef CFGPROMPTCONFIGURABLE
00002 #define CFGPROMPTCONFIGURABLE
00003
00052
00053
00054 #include <string>
00055 #include "Registry/Registry.h"
00056
00057 class CfgDialog;
00058
00059 class CfgPromptConfigurable
00060 {
00061 public:
00062 CfgPromptConfigurable();
00063 CfgPromptConfigurable(const Registry& r) {InitializeConfig(r);};
00064 virtual ~CfgPromptConfigurable() {};
00065
00066
00067 const Registry& GetConfig() const { return fConfig; };
00068
00069
00070 void UnLockKeys() { fConfig.UnLockKeys(); };
00071 void LockKeys() { fConfig.LockKeys(); };
00072 void UnLockValues() { fConfig.UnLockValues(); };
00073 void LockValues() { fConfig.LockValues(); };
00074
00075
00076
00077 void Set(const char* key, char val);
00078 void Set(const char* key, const char* val);
00079 void Set(const char* key, double val);
00080 void Set(const char* key, int val);
00081 void Set(const char* key, const Registry& val);
00082 void Set(const char* setstring);
00083 void Set(CfgDialog* d=0);
00084
00085
00086
00087 void Set(const Registry& stuff, Bool_t recursive = false);
00088
00089
00090 static Bool_t Split(const char* line, char sep, std::string& a, std::string& b);
00091 static Bool_t Split(const std::string& line, char sep, std::string& a, std::string& b)
00092 { return Split(line.c_str(),sep,a,b); };
00093 static Bool_t IsInt(const std::string& s, Int_t& val);
00094 static Bool_t IsFloat(const std::string& s, Double_t& val);
00095
00096
00097 static Bool_t SafeMerge(Registry& modify,
00098 const Registry& stuff,
00099 Bool_t recursive = false );
00100
00101
00102 protected:
00103
00104
00105 void InitializeConfig(const Registry& initConfig);
00106
00107
00108 virtual void ConfigModified(void)=0;
00109
00110 private:
00111 Registry fConfig;
00112 Registry fDefaultConfig;
00113
00114 ClassDef(CfgPromptConfigurable,1);
00115 };
00116
00117 #endif