Last change
on this file since 1545 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
|
Rev | Line | |
---|
[1397] | 1 | #ifndef _CONFIG_H_
|
---|
| 2 | #define _CONFIG_H_
|
---|
[1475] | 3 | #include <string>
|
---|
[1539] | 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
|
---|
[1475] | 10 | using namespace std;
|
---|
[1539] | 11 | #endif
|
---|
| 12 | #endif
|
---|
[1475] | 13 |
|
---|
[1397] | 14 | #include <stdio.h>
|
---|
| 15 | #include <string.h>
|
---|
| 16 |
|
---|
| 17 | #include <windows.h>
|
---|
| 18 |
|
---|
[1539] | 19 | typedef struct
|
---|
| 20 | {
|
---|
| 21 | char label[32];
|
---|
| 22 | char data[64];
|
---|
[1397] | 23 | } config_item;
|
---|
| 24 |
|
---|
| 25 | typedef struct
|
---|
[1539] | 26 | {
|
---|
| 27 | int count;
|
---|
[1397] | 28 | config_item item[1];
|
---|
| 29 | } config_str;
|
---|
| 30 |
|
---|
| 31 | class configureFile
|
---|
| 32 | {
|
---|
[1539] | 33 | private:
|
---|
| 34 | config_str *configstr;
|
---|
| 35 | bool valid;
|
---|
[1397] | 36 |
|
---|
[1539] | 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();
|
---|
[1397] | 48 | };
|
---|
| 49 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.