Last change
on this file since 3177 was 1539, checked in by sjboddie, 24 years ago |
Got compiling on VC++ 4.2
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
873 bytes
|
Line | |
---|
1 | #ifndef _CONFIG_H_
|
---|
2 | #define _CONFIG_H_
|
---|
3 | #include <string>
|
---|
4 |
|
---|
5 | // use the standard namespace
|
---|
6 | #if !defined (GSDL_NAMESPACE_BROKEN)
|
---|
7 | #if defined(GSDL_USE_OBJECTSPACE)
|
---|
8 | using namespace ospace::std;
|
---|
9 | #else
|
---|
10 | using namespace std;
|
---|
11 | #endif
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | #include <stdio.h>
|
---|
15 | #include <string.h>
|
---|
16 |
|
---|
17 | #include <windows.h>
|
---|
18 |
|
---|
19 | typedef struct
|
---|
20 | {
|
---|
21 | char label[32];
|
---|
22 | char data[64];
|
---|
23 | } config_item;
|
---|
24 |
|
---|
25 | typedef struct
|
---|
26 | {
|
---|
27 | int count;
|
---|
28 | config_item item[1];
|
---|
29 | } config_str;
|
---|
30 |
|
---|
31 | class configureFile
|
---|
32 | {
|
---|
33 | private:
|
---|
34 | config_str *configstr;
|
---|
35 | bool valid;
|
---|
36 |
|
---|
37 | bool scan(char *buffer, unsigned int &pos, unsigned int length);
|
---|
38 | public:
|
---|
39 | configureFile(char *name);
|
---|
40 | char *filename(char *base);
|
---|
41 | bool put(char *label, char *value);
|
---|
42 | bool concat(char *label, char *buffer, unsigned int &space);
|
---|
43 | string getString(string label);
|
---|
44 | void get(char *label, char **to);
|
---|
45 | bool store(char *);
|
---|
46 | bool isValid();
|
---|
47 | ~configureFile();
|
---|
48 | };
|
---|
49 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.