Code_TYMPAN  4.4.0
Industrial site acoustic simulation
DOMSave.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
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:145
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