Revision 183,
1011 bytes
checked in by mattausch, 19 years ago
(diff) |
added iv-reader library, testing code, and resources
|
Line | |
---|
1 | #ifndef __IVNode_H__
|
---|
2 | #define __IVNode_H__
|
---|
3 |
|
---|
4 |
|
---|
5 | #include <string.h>
|
---|
6 | #include <Ogre.h>
|
---|
7 |
|
---|
8 | enum IVType
|
---|
9 | {
|
---|
10 | IV_INVALID = -1,
|
---|
11 | IV_STRING = 0,
|
---|
12 | IV_INT = 1,
|
---|
13 | IV_REAL = 2
|
---|
14 | };
|
---|
15 |
|
---|
16 |
|
---|
17 | class IVField
|
---|
18 | {
|
---|
19 | public:
|
---|
20 | IVField();
|
---|
21 | ~IVField();
|
---|
22 |
|
---|
23 | char *name;
|
---|
24 | void *value;
|
---|
25 | IVType typ;
|
---|
26 | int cnt;
|
---|
27 | IVField *next;
|
---|
28 | };
|
---|
29 |
|
---|
30 | class __declspec(dllexport) IVNode
|
---|
31 | {
|
---|
32 | public:
|
---|
33 | IVNode();
|
---|
34 | IVNode(const char *s);
|
---|
35 | ~IVNode();
|
---|
36 |
|
---|
37 | void print(int ident=0);
|
---|
38 | void attachNode(IVNode *child);
|
---|
39 | void addField(const char *name, char *value);
|
---|
40 | void addField(const char *name, void *value, int cnt, IVType typ);
|
---|
41 |
|
---|
42 | IVNode *getParent() { return parent; }
|
---|
43 | char *getName() { return name; }
|
---|
44 | IVNode *getNodeRecursive(const char *name);
|
---|
45 | IVNode *getNextChildNode(bool reset = false);
|
---|
46 | IVField *getField(const char *name);
|
---|
47 | void *getField(const char *name, IVType *typ, int *cnt);
|
---|
48 |
|
---|
49 | private:
|
---|
50 | char *name;
|
---|
51 | IVField *fields;
|
---|
52 | IVNode *parent;
|
---|
53 | IVNode *children;
|
---|
54 | IVNode *next;
|
---|
55 |
|
---|
56 | IVNode *actual;
|
---|
57 | };
|
---|
58 |
|
---|
59 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.