blob: c17811b649ddf039623cc6bb46c3ab10e8b43ad7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#pragma once
#include <string>
#include <map>
#include <fstream>
class ConfigFile
{
public:
ConfigFile(const std::string& filename);
virtual ~ConfigFile();
virtual bool load();
virtual bool save();
std::string getValue(const std::string& key) const;
void setValue(const std::string& key, const std::string& value);
protected:
std::map<std::string, std::string> values;
std::string filename;
std::fstream current_file;
virtual bool open(std::ios_base::openmode mode);
std::string readLine();
bool parseLine(const std::string& line);
};
|