blob: 45eab0c4eaccee9fe63556803f2a37174d470dbd (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#include <config.h>
#ifndef __MIAV_MIAV_CONFIG_H__
#define __MIAV_MIAV_CONFIG_H__
#include <string>
using namespace std;
#include "error.h"
typedef struct __cfg {
string *name;
bool boolval;
int intval;
string *stringval;
float floatval;
struct __cfg* next;
} _cfg;
class MiavConfig {
public:
MiavConfig(char *file, Error* err = NULL);
~MiavConfig();
int readInt(char *node);
bool readBool(char *node);
string *readString(char *node);
float readFloat(char *node);
private:
string emptyString;
Error* error;
string filename;
_cfg *addConfig(_cfg *parent, char* conf);
int parse(char* conf);
char *strip(char* conf);
_cfg *parseError(char* msg, char* line);
_cfg *findNode(char* node);
_cfg *configs;
};
#endif
|