Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYXMLTools.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 /*
17  *
18  *
19  *
20  *
21  */
22 
23 #ifndef __TY_XML_TOOLS__
24 #define __TY_XML_TOOLS__
25 
27 
28 #include "Tympan/core/macros.h"
29 
34 {
35  // Methodes
36 public:
44  static void addElementStringValue(DOM_Element& parentElem, DOMString nodeName, DOMString nodeValue);
45 
46 #if TY_ARCH_TYPE == TY_ARCHITECTURE_64
54  static void addElementUIntValue(DOM_Element& parentElem, DOMString nodeName, unsigned int nodeValue);
55 
63  static void addElementUIntValue(DOM_Element& parentElem, DOMString nodeName, size_t nodeValue);
64  #if TY_COMPILER == TY_COMPILER_MSVC
72  static void addElementUIntValue(DOM_Element& parentElem, DOMString nodeName, unsigned long nodeValue);
73  #endif
74 #else
82  static void addElementUIntValue(DOM_Element& parentElem, DOMString nodeName, size_t nodeValue);
83 
91  static void addElementUIntValue(DOM_Element& parentElem, DOMString nodeName, unsigned long nodeValue);
92 #endif
93 
101  static void addElementIntValue(DOM_Element& parentElem, DOMString nodeName, int nodeValue);
102 
110  static void addElementBoolValue(DOM_Element& parentElem, DOMString nodeName, bool nodeValue);
111 
119  static void addElementFloatValue(DOM_Element& parentElem, DOMString nodeName, float nodeValue);
120 
128  static void addElementDoubleValue(DOM_Element& parentElem, DOMString nodeName, double nodeValue);
129 
140  static bool getElementStringValue(DOM_Element parentElem, DOMString nodeName, QString& nodeValue);
151  static void getElementStringValue(DOM_Element parentElem, DOMString nodeName, QString& nodeValue,
152  bool& ok);
153 
164  static bool getElementIntValue(DOM_Element parentElem, DOMString nodeName, int& nodeValue);
175  static void getElementIntValue(DOM_Element parentElem, DOMString nodeName, int& nodeValue, bool& ok);
176 
187  static void getElementUIntValue(DOM_Element parentElem, DOMString nodeName, unsigned int& nodeValue,
188  bool& ok);
189 
200  static bool getElementBoolValue(DOM_Element parentElem, DOMString nodeName, bool& nodeValue);
211  static void getElementBoolValue(DOM_Element parentElem, DOMString nodeName, bool& nodeValue, bool& ok);
212 
223  static bool getElementFloatValue(DOM_Element parentElem, DOMString nodeName, float& nodeValue);
234  static void getElementFloatValue(DOM_Element parentElem, DOMString nodeName, float& nodeValue, bool& ok);
235 
246  static bool getElementDoubleValue(DOM_Element parentElem, DOMString nodeName, double& nodeValue);
257  static void getElementDoubleValue(DOM_Element parentElem, DOMString nodeName, double& nodeValue,
258  bool& ok);
259 
268  static QString getElementAttributeToString(DOM_Element parentElem, DOMString attName);
269 
279  static double getElementAttributeToDouble(DOM_Element parentElem, DOMString attName, bool* ok = NULL);
280 
290  static int getElementAttributeToInt(DOM_Element parentElem, DOMString attName, bool* ok = NULL);
291 
292  static unsigned getElementAttributeToUnsigned(DOM_Element parentElem, DOMString attName, bool* ok = NULL);
293 };
294 
295 #endif // __TY_XML_TOOLS__
QString DOMString
Definition: QT2DOM.h:31
QDomElement DOM_Element
Definition: QT2DOM.h:30
static int getElementAttributeToInt(DOM_Element parentElem, DOMString attName, bool *ok=NULL)
Definition: TYXMLTools.cpp:293
static void addElementDoubleValue(DOM_Element &parentElem, DOMString nodeName, double nodeValue)
Definition: TYXMLTools.cpp:87
static bool getElementBoolValue(DOM_Element parentElem, DOMString nodeName, bool &nodeValue)
Definition: TYXMLTools.cpp:179
static bool getElementStringValue(DOM_Element parentElem, DOMString nodeName, QString &nodeValue)
Definition: TYXMLTools.cpp:93
static unsigned getElementAttributeToUnsigned(DOM_Element parentElem, DOMString attName, bool *ok=NULL)
Definition: TYXMLTools.cpp:298
static QString getElementAttributeToString(DOM_Element parentElem, DOMString attName)
Definition: TYXMLTools.cpp:276
static void addElementIntValue(DOM_Element &parentElem, DOMString nodeName, int nodeValue)
Definition: TYXMLTools.cpp:72
static bool getElementFloatValue(DOM_Element parentElem, DOMString nodeName, float &nodeValue)
Definition: TYXMLTools.cpp:211
static void getElementUIntValue(DOM_Element parentElem, DOMString nodeName, unsigned int &nodeValue, bool &ok)
Definition: TYXMLTools.cpp:161
static bool getElementIntValue(DOM_Element parentElem, DOMString nodeName, int &nodeValue)
Definition: TYXMLTools.cpp:129
static double getElementAttributeToDouble(DOM_Element parentElem, DOMString attName, bool *ok=NULL)
Definition: TYXMLTools.cpp:288
static bool getElementDoubleValue(DOM_Element parentElem, DOMString nodeName, double &nodeValue)
Definition: TYXMLTools.cpp:243
static void addElementUIntValue(DOM_Element &parentElem, DOMString nodeName, unsigned int nodeValue)
Definition: TYXMLTools.cpp:42
static void addElementBoolValue(DOM_Element &parentElem, DOMString nodeName, bool nodeValue)
Definition: TYXMLTools.cpp:77
static void addElementStringValue(DOM_Element &parentElem, DOMString nodeName, DOMString nodeValue)
Definition: TYXMLTools.cpp:24
static void addElementFloatValue(DOM_Element &parentElem, DOMString nodeName, float nodeValue)
Definition: TYXMLTools.cpp:82