forked from Nexusoft/PrimeSoloMiner
-
Notifications
You must be signed in to change notification settings - Fork 4
/
iniParser.h
45 lines (34 loc) · 880 Bytes
/
iniParser.h
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
#ifndef _INI_PARSER_H
#define _INI_PARSER_H
#include "linkedlist.h"
typedef char* LPSTR;
typedef const char* LPCSTR;
class CIniParserElement
{
public:
char value[4096];
char name[4096];
};
class CIniParserGroup
{
public:
char groupName[4096];
CIniParserGroup();
~CIniParserGroup();
CLinkedListByRef<CIniParserElement> elemente;
};
class CIniParser
{
CLinkedListByRef<CIniParserGroup> groups;
void ClearLine(LPCSTR input, LPSTR output);
bool GetValueAndName(LPCSTR line, LPSTR name, LPSTR value);
public:
CIniParser();
~CIniParser();
bool Parse(LPCSTR inhalt);
void Clear();
bool GetValueAsString(LPCSTR section, LPCSTR value, LPSTR dest, int maxDestSize);
bool GetValueAsInteger(LPCSTR section, LPCSTR value, int *dest);
bool GetValueAsDouble(LPCSTR section, LPCSTR value, double *dest);
};
#endif