Code_TYMPAN  4.4.0
Industrial site acoustic simulation
DOMSave.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 __DOM_SAVE__
24 #define __DOM_SAVE__
25 
26 #ifdef _MSC_VER
27  #pragma warning(disable : 4786)
28 #endif
29 
30 #include "QT2DOM.h"
31 #include <QXmlStreamWriter>
32 
40 class DOMSave
41 {
42  // Methodes
43 public:
53  static int saveNodeToFile(DOM_Node& nodeToSave, const char* fileName);
54 
63  static QString saveNodeToString(DOM_Node& nodeToSave);
64 
73  static DOMString getIndent(int indentNb);
74 
75 protected:
79  DOMSave(){};
80 
84  ~DOMSave(){};
85 
86 private:
97  static bool writeElementToStream(const QDomElement& pElement, QXmlStreamWriter& pStream);
98 };
99 
100 #endif // __DOM_SAVE__
QDomNode DOM_Node
Definition: QT2DOM.h:32
QString DOMString
Definition: QT2DOM.h:31
Classe utilitaire XML pour la sauvegarde d'une arborescence DOM.
Definition: DOMSave.h:41
static QString saveNodeToString(DOM_Node &nodeToSave)
Methode pour la sauvegarde d'un noeud DOM dans une string XML.
Definition: DOMSave.cpp:144
static bool writeElementToStream(const QDomElement &pElement, QXmlStreamWriter &pStream)
Methode qui ecrit recursivement les noeuds d'un document xml dans un flux de type QXmlStreamWriter.
Definition: DOMSave.cpp:91
DOMSave()
Definition: DOMSave.h:79
static DOMString getIndent(int indentNb)
Methode utilitaire pour la gestion de l'indentation.
static int saveNodeToFile(DOM_Node &nodeToSave, const char *fileName)
La methode principale pour la sauvegarde d'un noeud DOM dans un fichier XML.
Definition: DOMSave.cpp:37
~DOMSave()
Definition: DOMSave.h:84