File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ #ifndef INIPARSER_H
2
+ #define INIPARSER_H
3
+
4
+ #include < string>
5
+ #include < unordered_map>
6
+ #include < fstream>
7
+ #include < sstream>
8
+
9
+ class INIParser {
10
+ public:
11
+ INIParser (const std::string& filename);
12
+ ~INIParser ();
13
+ int getValue (const std::string& section, const std::string& key, std::string& value);
14
+ int setValue (const std::string& section, const std::string& key, const std::string& value);
15
+ int deleteValue (const std::string& section, const std::string& key);
16
+ int moveValue (const std::string& srcSection, const std::string& srcKey,
17
+ const std::string& destSection, const std::string& destKey);
18
+
19
+ private:
20
+ void loadFile ();
21
+ void saveFile ();
22
+ bool sectionExists (const std::string& section);
23
+ bool keyExists (const std::string& section, const std::string& key);
24
+
25
+ std::string filename;
26
+ std::unordered_map<std::string, std::unordered_map<std::string, std::string>> data;
27
+ };
28
+
29
+ #endif // INIPARSER_H
You can’t perform that action at this time.
0 commit comments