Skip to content

Commit ff737f6

Browse files
authored
Add files via upload
1 parent 57404c2 commit ff737f6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

lib/IniParser/IniParser.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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

0 commit comments

Comments
 (0)