00001
00003
00017 #ifndef INCRONCFG_H_
00018 #define INCRONCFG_H_
00019
00020
00021 #include <cstring>
00022 #include <map>
00023
00025
00030 class IncronCfg
00031 {
00032 public:
00033
00035 static void Init();
00036
00038
00047 static void Load(const std::string& rPath);
00048
00050
00059 static bool GetValue(const std::string& rKey, std::string& rVal);
00060
00062
00071 static bool GetValue(const std::string& rKey, int& rVal);
00072
00074
00083 static bool GetValue(const std::string& rKey, unsigned& rVal);
00084
00086
00095 static bool GetValue(const std::string& rKey, bool& rVal);
00096
00098
00105 static std::string BuildPath(const std::string& rPath, const std::string& rName);
00106
00107 protected:
00109
00115 static bool ParseLine(const char* s, std::string& rKey, std::string& rVal);
00116
00118
00122 static bool IsComment(const char* s);
00123
00124 private:
00125 static std::map<std::string, std::string> m_values;
00126 static std::map<std::string, std::string> m_defaults;
00127 };
00128
00129 #endif