CFileXML.h
Go to the documentation of this file.
1 //==============================================================================
2 /*
3  Software License Agreement (BSD License)
4  Copyright (c) 2003-2016, CHAI3D.
5  (www.chai3d.org)
6 
7  All rights reserved.
8 
9  Redistribution and use in source and binary forms, with or without
10  modification, are permitted provided that the following conditions
11  are met:
12 
13  * Redistributions of source code must retain the above copyright
14  notice, this list of conditions and the following disclaimer.
15 
16  * Redistributions in binary form must reproduce the above
17  copyright notice, this list of conditions and the following
18  disclaimer in the documentation and/or other materials provided
19  with the distribution.
20 
21  * Neither the name of CHAI3D nor the names of its contributors may
22  be used to endorse or promote products derived from this software
23  without specific prior written permission.
24 
25  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  POSSIBILITY OF SUCH DAMAGE.
37 
38  \author <http://www.chai3d.org>
39  \author Sebastien Grange
40  \version 3.2.0 $Rev: 2016 $
41  */
42 //==============================================================================
43 
44 //------------------------------------------------------------------------------
45 #ifndef CFileXML
46 #define CFileXML
47 //------------------------------------------------------------------------------
48 #include <string>
49 //------------------------------------------------------------------------------
50 
51 //------------------------------------------------------------------------------
52 namespace chai3d {
53 //------------------------------------------------------------------------------
54 
55 //==============================================================================
63 //==============================================================================
64 
65 //------------------------------------------------------------------------------
69 //------------------------------------------------------------------------------
70 
72 
73 class cFileXML
74 {
76  void *m_xml;
77 
78 public:
79 
81  cFileXML();
82 
84  cFileXML(const std::string& a_filename);
85 
87  virtual ~cFileXML();
88 
90  bool loadFromFile(const std::string& a_filename);
91 
93  bool saveToFile();
94 
96  bool saveToFile(const std::string& a_filename);
97 
99  void clear();
100 
102  void gotoRoot();
103 
105  bool gotoFirstChild();
106 
108  bool gotoNextSibling();
109 
111  int gotoChild(const std::string& a_name, int a_index = 0, bool a_create = false);
112 
114  bool removeChild(const std::string& a_name, int a_index = 0);
115 
117  bool gotoParent();
118 
120  bool setName(const std::string& a_name);
121 
123  bool setValue(const bool a_val);
124 
126  bool setValue(const long int a_val);
127 
129  bool setValue(const int a_val) { long int tmp = a_val; return setValue(tmp); }
130 
132  bool setValue(const unsigned int a_val) { long int tmp = a_val; return setValue(tmp); }
133 
135  bool setValue(const short a_val) { long int tmp = a_val; return setValue(tmp); }
136 
138  bool setValue(const unsigned short a_val) { long int tmp = a_val; return setValue(tmp); }
139 
141  bool setValue(const char a_val) { long int tmp = a_val; return setValue(tmp); }
142 
144  bool setValue(const unsigned char a_val) { long int tmp = a_val; return setValue(tmp); }
145 
147  bool setValue(const float a_val) { double tmp = a_val; return setValue(tmp); }
148 
150  bool setValue(const double a_val);
151 
153  bool setValue(const std::string a_val);
154 
156  bool setAttribute(const std::string& a_attribute, const bool a_val);
157 
159  bool setAttribute(const std::string& a_attribute, const long int a_val);
160 
162  bool setAttribute(const std::string& a_attribute, const int a_val) { return setAttribute(a_attribute, (long int)a_val); }
163 
165  bool setAttribute(const std::string& a_attribute, const unsigned int a_val) { return setAttribute(a_attribute, (long int)a_val); }
166 
168  bool setAttribute(const std::string& a_attribute, const short a_val) { return setAttribute(a_attribute, (long int)a_val); }
169 
171  bool setAttribute(const std::string& a_attribute, const unsigned short a_val) { return setAttribute(a_attribute, (long int)a_val); }
172 
174  bool setAttribute(const std::string& a_attribute, const char a_val) { return setAttribute(a_attribute, (long int)a_val); }
175 
177  bool setAttribute(const std::string& a_attribute, const unsigned char a_val) { return setAttribute(a_attribute, (long int)a_val); }
178 
180  bool setAttribute(const std::string& a_attribute, const double a_val);
181 
183  bool setAttribute(const std::string& a_attribute, const float a_val) { return setAttribute(a_attribute, (double)a_val); }
184 
186  bool setAttribute(const std::string& a_attribute, const std::string a_val);
187 
189  bool getName(std::string& a_name) const;
190 
192  bool getValue(bool& a_val) const;
193 
195  bool getValue(long int& a_val) const;
196 
198  bool getValue(int& a_val) const { long int tmp; bool res = getValue(tmp); a_val = (int)tmp; return res; }
199 
201  bool getValue(unsigned int& a_val) const { long int tmp; bool res = getValue(tmp); a_val = (unsigned int)tmp; return res; }
202 
204  bool getValue(short& a_val) const { long int tmp; bool res = getValue(tmp); a_val = (short)tmp; return res; }
205 
207  bool getValue(unsigned short& a_val) const { long int tmp; bool res = getValue(tmp); a_val = (unsigned short)tmp; return res; }
208 
210  bool getValue(char& a_val) const { long int tmp; bool res = getValue(tmp); a_val = (char)tmp; return res; }
211 
213  bool getValue(unsigned char& a_val) const { long int tmp; bool res = getValue(tmp); a_val = (unsigned char)tmp; return res; }
214 
216  bool getValue(float& a_val) const { double tmp; bool res = getValue(tmp); a_val = (float)tmp; return res; }
217 
219  bool getValue(double& a_val) const;
220 
222  bool getValue(std::string& a_val) const;
223 
225  bool getAttribute(const std::string& a_attribute, bool& a_val) const;
226 
228  bool getAttribute(const std::string& a_attribute, long int& a_val) const;
229 
231  bool getAttribute(const std::string& a_attribute, int& a_val) const { long int tmp; bool res = getAttribute (a_attribute, tmp); a_val = (int)tmp; return res; }
232 
234  bool getAttribute(const std::string& a_attribute, unsigned int& a_val) const { long int tmp; bool res = getAttribute (a_attribute, tmp); a_val = (unsigned int)tmp; return res; }
235 
237  bool getAttribute(const std::string& a_attribute, short& a_val) const { long int tmp; bool res = getAttribute (a_attribute, tmp); a_val = (short)tmp; return res; }
238 
240  bool getAttribute(const std::string& a_attribute, unsigned short& a_val) const { long int tmp; bool res = getAttribute (a_attribute, tmp); a_val = (unsigned short)tmp; return res; }
241 
243  bool getAttribute(const std::string& a_attribute, char& a_val) const { long int tmp; bool res = getAttribute (a_attribute, tmp); a_val = (char)tmp; return res; }
244 
246  bool getAttribute(const std::string& a_attribute, unsigned char& a_val) const { long int tmp; bool res = getAttribute (a_attribute, tmp); a_val = (unsigned char)tmp; return res; }
247 
249  bool getAttribute(const std::string& a_attribute, float& a_val) const { double tmp; bool res = getAttribute (a_attribute, tmp); a_val = (float)tmp; return res; }
250 
252  bool getAttribute(const std::string& a_attribute, double& a_val) const;
253 
255  bool getAttribute(const std::string& a_attribute, std::string& a_val) const;
256 
258  bool setValue(const std::string& a_name, const bool a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
259 
261  bool setValue(const std::string& a_name, const long int a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
262 
264  bool setValue(const std::string& a_name, const int a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
265 
267  bool setValue(const std::string& a_name, const unsigned int a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
268 
270  bool setValue(const std::string& a_name, const short a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
271 
273  bool setValue(const std::string& a_name, const unsigned short a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
274 
276  bool setValue(const std::string& a_name, const char a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
277 
279  bool setValue(const std::string& a_name, const unsigned char a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
280 
282  bool setValue(const std::string& a_name, const double a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
283 
285  bool setValue(const std::string& a_name, const std::string& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setValue(a_val); gotoParent(); return res; }
286 
288  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, bool a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
289 
291  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, long int a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
292 
294  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, int a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
295 
297  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, unsigned int a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
298 
300  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, short a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
301 
303  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, unsigned short a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
304 
306  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, char a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
307 
309  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, unsigned char a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
310 
312  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, double a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
313 
315  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, float a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
316 
318  bool setAttribute(const std::string& a_name, const int a_index, const std::string& a_attribute, std::string a_val) { if (gotoChild(a_name, a_index, true) < 0) return false; bool res = setAttribute(a_attribute, a_val); gotoParent(); return res; }
319 
321  bool getValue(const std::string& a_name, bool& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
322 
324  bool getValue(const std::string& a_name, long int& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
325 
327  bool getValue(const std::string& a_name, int& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
328 
330  bool getValue(const std::string& a_name, unsigned int& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
331 
333  bool getValue(const std::string& a_name, short& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
334 
336  bool getValue(const std::string& a_name, unsigned short& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
337 
339  bool getValue(const std::string& a_name, char& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
340 
342  bool getValue(const std::string& a_name, unsigned char& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
343 
345  bool getValue(const std::string& a_name, float& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
346 
348  bool getValue(const std::string& a_name, double& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
349 
351  bool getValue(const std::string& a_name, std::string& a_val, int a_index = 0) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getValue(a_val); gotoParent(); return res; }
352 
354  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, bool& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
355 
357  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, long int& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
358 
360  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, int& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
361 
363  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, unsigned int& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
364 
366  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, short& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
367 
369  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, unsigned short& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
370 
372  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, char& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
373 
375  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, unsigned char& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
376 
378  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, float& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
379 
381  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, double& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
382 
384  bool getAttribute(const std::string& a_name, int a_index, const std::string& a_attribute, std::string& a_val) { if (gotoChild(a_name, a_index, false) < 0) return false; bool res = getAttribute(a_attribute, a_val); gotoParent(); return res; }
385 };
386 
388 
389 //------------------------------------------------------------------------------
390 } // namespace chai3d
391 //------------------------------------------------------------------------------
392 
393 //------------------------------------------------------------------------------
394 #endif
395 //------------------------------------------------------------------------------
396 
bool saveToFile()
Save the current internal XML data to the same file that was loaded with loadFromFile().
Definition: CFileXML.cpp:204
bool setValue(const unsigned short a_val)
Set the value of the current node.
Definition: CFileXML.h:138
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, std::string &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:384
bool setName(const std::string &a_name)
Set the name of the current node.
Definition: CFileXML.cpp:467
bool gotoNextSibling()
Set current node to the next sibling of the current node.
Definition: CFileXML.cpp:413
bool getAttribute(const std::string &a_attribute, unsigned int &a_val) const
Get the value of a specific attribute of the current node.
Definition: CFileXML.h:234
bool getName(std::string &a_name) const
Get the name of the current node.
Definition: CFileXML.cpp:443
bool getValue(unsigned char &a_val) const
Get the value of the current node.
Definition: CFileXML.h:213
bool setValue(const std::string &a_name, const unsigned char a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:279
bool setValue(const std::string &a_name, const int a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:264
bool getAttribute(const std::string &a_attribute, int &a_val) const
Get the value of a specific attribute of the current node.
Definition: CFileXML.h:231
bool getValue(char &a_val) const
Get the value of the current node.
Definition: CFileXML.h:210
bool getValue(const std::string &a_name, bool &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:321
bool getValue(const std::string &a_name, unsigned char &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:342
bool getAttribute(const std::string &a_attribute, unsigned short &a_val) const
Get the value of a specific attribute of the current node.
Definition: CFileXML.h:240
cFileXML()
Constructor.
Definition: CFileXML.cpp:123
bool setValue(const char a_val)
Set the value of the current node.
Definition: CFileXML.h:141
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, float a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:315
void gotoRoot()
Reset current node to the root node.
Definition: CFileXML.cpp:261
bool getValue(const std::string &a_name, int &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:327
bool setValue(const unsigned int a_val)
Set the value of the current node.
Definition: CFileXML.h:132
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, float &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:378
bool setAttribute(const std::string &a_attribute, const bool a_val)
Set an attribute of the current node.
Definition: CFileXML.cpp:861
bool getValue(const std::string &a_name, char &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:339
bool setAttribute(const std::string &a_attribute, const unsigned char a_val)
Set an attribute of the current node.
Definition: CFileXML.h:177
bool getValue(const std::string &a_name, short &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:333
bool setAttribute(const std::string &a_attribute, const int a_val)
Set an attribute of the current node.
Definition: CFileXML.h:162
bool getAttribute(const std::string &a_attribute, unsigned char &a_val) const
Get the value of a specific attribute of the current node.
Definition: CFileXML.h:246
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, std::string a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:318
bool getValue(unsigned int &a_val) const
Get the value of the current node.
Definition: CFileXML.h:201
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, bool &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:354
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, char a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:306
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, int &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:360
bool setValue(const std::string &a_name, const short a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:270
bool getValue(const std::string &a_name, unsigned int &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:330
bool setAttribute(const std::string &a_attribute, const char a_val)
Set an attribute of the current node.
Definition: CFileXML.h:174
bool setValue(const std::string &a_name, const unsigned short a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:273
bool setValue(const bool a_val)
Set the value of the current node.
Definition: CFileXML.cpp:629
void clear()
Clear internal XML data.
Definition: CFileXML.cpp:247
bool setAttribute(const std::string &a_attribute, const short a_val)
Set an attribute of the current node.
Definition: CFileXML.h:168
bool gotoFirstChild()
Set current node to the first child of the current node.
Definition: CFileXML.cpp:385
bool setValue(const std::string &a_name, const unsigned int a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:267
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, bool a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:288
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, unsigned char &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:375
bool setValue(const std::string &a_name, const double a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:282
bool setAttribute(const std::string &a_attribute, const float a_val)
Set an attribute of the current node.
Definition: CFileXML.h:183
bool setAttribute(const std::string &a_attribute, const unsigned int a_val)
Set an attribute of the current node.
Definition: CFileXML.h:165
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, short a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:300
bool setValue(const std::string &a_name, const long int a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:261
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, long int a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:291
bool getValue(const std::string &a_name, long int &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:324
Definition: CFileXML.h:73
bool removeChild(const std::string &a_name, int a_index=0)
Remove a specific child of the current node and all its children.
Definition: CFileXML.cpp:335
bool getAttribute(const std::string &a_attribute, float &a_val) const
Get the value of a specific attribute of the current node.
Definition: CFileXML.h:249
bool getValue(const std::string &a_name, float &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:345
bool getAttribute(const std::string &a_attribute, char &a_val) const
Get the value of a specific attribute of the current node.
Definition: CFileXML.h:243
bool loadFromFile(const std::string &a_filename)
Open an XML file and load its XML data internally.
Definition: CFileXML.cpp:171
bool getValue(float &a_val) const
Get the value of the current node.
Definition: CFileXML.h:216
bool getAttribute(const std::string &a_attribute, bool &a_val) const
Get the value of a specific attribute of the current node.
Definition: CFileXML.cpp:729
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, double &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:381
bool setValue(const std::string &a_name, const bool a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:258
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, long int &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:357
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, unsigned short &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:369
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, char &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:372
bool setAttribute(const std::string &a_attribute, const unsigned short a_val)
Set an attribute of the current node.
Definition: CFileXML.h:171
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, double a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:312
bool setValue(const unsigned char a_val)
Set the value of the current node.
Definition: CFileXML.h:144
bool setValue(const std::string &a_name, const std::string &a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:285
bool getValue(unsigned short &a_val) const
Get the value of the current node.
Definition: CFileXML.h:207
bool getValue(const std::string &a_name, unsigned short &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:336
Definition: CAudioBuffer.cpp:56
bool setValue(const int a_val)
Set the value of the current node.
Definition: CFileXML.h:129
bool getValue(const std::string &a_name, double &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:348
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, short &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:366
bool setValue(const short a_val)
Set the value of the current node.
Definition: CFileXML.h:135
bool setValue(const float a_val)
Set the value of the current node.
Definition: CFileXML.h:147
bool setValue(const std::string &a_name, const char a_val, int a_index=0)
Create or set a child node of the current node with a specific name and value.
Definition: CFileXML.h:276
bool getValue(short &a_val) const
Get the value of the current node.
Definition: CFileXML.h:204
bool gotoParent()
Set current node to the parent of the current node.
Definition: CFileXML.cpp:369
int gotoChild(const std::string &a_name, int a_index=0, bool a_create=false)
Set current node to a specific child of the current node.
Definition: CFileXML.cpp:285
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, unsigned int a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:297
bool getValue(const std::string &a_name, std::string &a_val, int a_index=0)
Get the value of a specific child node of the current node.
Definition: CFileXML.h:351
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, unsigned char a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:309
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, unsigned short a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:303
bool setAttribute(const std::string &a_name, const int a_index, const std::string &a_attribute, int a_val)
Create or set a specific attribute and its value for the current node .
Definition: CFileXML.h:294
virtual ~cFileXML()
Destructor.
Definition: CFileXML.cpp:152
bool getAttribute(const std::string &a_attribute, short &a_val) const
Get the value of a specific attribute of the current node.
Definition: CFileXML.h:237
bool getValue(bool &a_val) const
Get the value of the current node.
Definition: CFileXML.cpp:495
bool getAttribute(const std::string &a_name, int a_index, const std::string &a_attribute, unsigned int &a_val)
Get the value of a specific attribute of a specific child node of the current node.
Definition: CFileXML.h:363
bool getValue(int &a_val) const
Get the value of the current node.
Definition: CFileXML.h:198