Version 8.9.0
 
Loading...
Searching...
No Matches
SimpleXML.h
1/******************************************************************************
2 * Copyright (c) 2012-2017 All Rights Reserved, http://www.evocortex.com *
3 * Evocortex GmbH *
4 * Emilienstr. 1 *
5 * 90489 Nuremberg *
6 * Germany *
7 * *
8 * Contributors: *
9 * Initial version for Linux 64-Bit platform supported by Fraunhofer IPA, *
10 * http://www.ipa.fraunhofer.de *
11 *****************************************************************************/
12
13#ifndef SIMPLEXML_H
14#define SIMPLEXML_H
15
16#include <stdio.h>
17#include <string.h>
18
19#ifdef _WIN32
20#include <shlobj.h>
21#else
22#include <stdlib.h>
23#include <fstream>
24#endif
25
26#include "unicode.h"
27
28using namespace std;
29
30namespace evo
31{
32
33#define NODES 256
34
42{
43public:
44
48 SimpleXML(void);
49
54
62 bool open(const Tchar* dir, Tchar* xmlFile, const Tchar* root);
63
70 bool open(const Tchar* filename, const Tchar* root);
71
76 bool setNode(void);
77
83 bool setNode(const Tchar* node);
84
91 bool setNode(const Tchar* node, int index);
92
97 bool resetNode(void);
98
104 bool getNode(Tchar** value);
105
111 int getNodeCount(const Tchar* node);
112
119 bool getInt(const Tchar* node, int* value);
120
127 bool getBool(const Tchar* node, bool* value);
128
135 bool getLong(const Tchar* node, long* value);
136
143 bool getFloat(const Tchar* node, float* value);
144
151 bool getString(const Tchar* node, Tchar** value);
152
153
160 bool getUnsignedShort(const Tchar* node, unsigned short* value);
161
162private:
163
164 int getKey(const Tchar* key, int begin, int end, bool closeTag = false);
165
166 int _fileSize;
167
168 int _begin[NODES], _end[NODES];
169
170 unsigned short _nodeIndex;
171
172 Tchar* _data;
173
174};
175
176} // namespace
177
178#endif // SIMPLEXML_H
Simple XML parser.
Definition: SimpleXML.h:42
bool getString(const Tchar *node, Tchar **value)
Get string.
bool setNode(const Tchar *node, int index)
Set specific node by name and index.
int getNodeCount(const Tchar *node)
Get number of nodes with same name.
bool getFloat(const Tchar *node, float *value)
Get float value.
bool open(const Tchar *filename, const Tchar *root)
Open file.
bool getNode(Tchar **value)
Get xml chunk, i.e., selected node with all xml tags.
bool resetNode(void)
Move one node back.
bool setNode(void)
Set node to root of tree.
bool getLong(const Tchar *node, long *value)
Get long integer.
SimpleXML(void)
Constructor.
bool getUnsignedShort(const Tchar *node, unsigned short *value)
Get unsigned short.
~SimpleXML(void)
Destructor.
bool getInt(const Tchar *node, int *value)
Get integer value.
bool setNode(const Tchar *node)
Set specific node by name.
bool open(const Tchar *dir, Tchar *xmlFile, const Tchar *root)
Open file.
bool getBool(const Tchar *node, bool *value)
Get boolean value.