-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathConfigReader.h
More file actions
36 lines (27 loc) · 767 Bytes
/
ConfigReader.h
File metadata and controls
36 lines (27 loc) · 767 Bytes
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
#ifndef _CONFIGREADER_
#define _CONFIGREADER_
#include <map>
#include <list>
#include <string>
class ConfigReader {
public:
ConfigReader(const std::string &path);
class Section {
public:
Section(const std::string &name);
void add(const std::string &key, const std::string &value);
const std::string &get(const std::string &key) const;
const std::string &name() const;
protected:
std::string _name;
std::map<std::string, std::string> entries;
};
const Section &get(const std::string &name) const;
// section iterators
std::list<Section>::const_iterator begin() const;
std::list<Section>::const_iterator end() const;
protected:
std::list<Section> sections;
};
#endif /* _CONFIGREADER_ */
/* vim: set sw=2 sts=2 : */