00001 #ifndef _CONFIGMANAGER_H 00002 #define _CONFIGMANAGER_H 00003 00004 #include <string> 00005 #include <map> 00006 #include "ConfigSection.h" 00007 00010 class ConfigManager 00011 { 00012 public: 00014 typedef std::map<std::string, ConfigSection> SectionMap; 00015 00020 ConfigManager(std::string filename); 00022 void save(); 00024 void load(); 00025 00031 bool hasSection(std::string name) { return m_sections.find(name) != m_sections.end(); } 00037 ConfigSection &getSection(std::string name); 00043 ConfigSection &getSectionSilent(std::string name); 00049 void setSection(std::string name, ConfigSection §ion); 00054 void addEmptySection(std::string name); 00055 00059 SectionMap::iterator begin() { return m_sections.begin(); } 00063 SectionMap::iterator end() { return m_sections.end(); } 00064 00065 private: 00066 std::string m_filename; 00067 SectionMap m_sections; 00068 }; 00069 00070 #endif