#ifndef A8_INIFILE_H #define A8_INIFILE_H #include namespace a8 { class IniFile { public: IniFile(const std::string filename); bool Load(); template a8::XValue ReadValue(const char* section, const char* key, const T& defval) { auto itr = sections_.find(std::string(section)); if(itr != sections_.end()){ auto key_itr = itr->second.find(std::string(key)); if(key_itr != itr->second.end()){ return a8::XValue(key_itr->second); } } return a8::XValue(defval); } private: std::string filename_; std::map > sections_; }; } #endif