1 #ifndef CONFIG_RUNTINE_H_
2 #define CONFIG_RUNTINE_H_
12 #include <sys/types.h>
22 list<string>::iterator position;
24 typedef map<string, map<string, Config> > config;
29 static ConfigRuntime* Instance();
30 static void Finalize();
39 template<
typename T> T Get(std::string section, std::string key, T defaultValue);
43 template<
typename T>
void Set(std::string section, std::string key, T value);
51 static void ConfigureAll();
55 void CheckForFileUpdates();
59 static ConfigRuntime* m_instance;
60 static std::vector<Configurable*> configurables;
65 void LoadConfig(std::string path);
69 void SaveConfig(std::string path);
70 std::list<string>* fileData;
72 std::map<string, std::list<std::string>::iterator>* sectionMap;
73 std::time_t lastReadTime;
74 bool KeyExists(std::string section, std::string key);
76 const static std::string ConfigRuntime::CONFIG_FILE_PATH;
77 const static std::string ConfigRuntime::COMMENT_DELIMITERS;
79 DISALLOW_COPY_AND_ASSIGN(ConfigRuntime);