00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef SETTINGS_H_
00010 #define SETTINGS_H_
00011
00012 #include <string>
00013
00014 namespace srchilite {
00015
00016 enum SettingError {
00017 NO_SETTING_ERROR = 0, CANT_CREATE_DIR, CANT_CREATE_FILE
00018 };
00019
00062 class Settings {
00064 std::string homeDir;
00065
00067 std::string confDir;
00068
00070 std::string confFileName;
00071
00073 std::string testFileName;
00074
00076 std::string dataDir;
00077 public:
00078 Settings();
00079 ~Settings();
00080
00081 const std::string getConfDir() const {
00082 return confDir;
00083 }
00084
00085 void setConfDir(const std::string &dir) {
00086 confDir = dir;
00087 }
00088
00089 const std::string getConfFileName() const {
00090 return confFileName;
00091 }
00092
00093 const std::string getTestFileName() const {
00094 return testFileName;
00095 }
00096
00097 void setTestFileName(const std::string &name) {
00098 testFileName = name;
00099 }
00100
00101 const std::string getDataDir() const {
00102 return dataDir;
00103 }
00104
00105 void setDataDir(const std::string &ddir) {
00106 dataDir = ddir;
00107 }
00108
00113 bool checkForConfFile();
00114
00119 bool checkForTestFile();
00120
00125 bool readDataDir();
00126
00131 SettingError save();
00132
00146 static const std::string retrieveDataDir(bool reload = false);
00147 };
00148
00149 }
00150
00151 #endif