//--------------------------------------------------------------------------- #ifndef INIParserH #define INIParserH //--------------------------------------------------------------------------- #include #include #include #include #include #include using namespace std; //INI文件结点存储结构 class ININode { public: ININode(string root, string key, string value) { this->root = root; this->key = key; this->value = value; } string root; string key; string value; }; //键值对结构体 class SubNode { public: void InsertElement(string key, string value) { sub_node.insert(pair(key, value)); } map sub_node; }; //主要的INIParser类 class INIParser { public: int ReadINI(string path); string GetValue(string root, string key); vector::size_type GetSize(){return map_ini.size();} vector::size_type SetValue(string root, string key, string value); int WriteINI(string path); void Clear(){map_ini.clear();} private: map map_ini; }; #endif