Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYXMLManager.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_XMLMANAGER__
24 #define __TY_XMLMANAGER__
25 
26 #include "TYElement.h"
28 
33 {
34  // Methodes
35 public:
39  TYXMLManager();
43  ~TYXMLManager();
44 
53  void createDoc(QString docName, QString version);
54 
64  int load(const QString& fileName, LPTYElementArray& eltCollection);
65 
74  int save(QString fileName);
75 
85  int loadFromString(const QString& xmlString, LPTYElementArray& eltCollection);
86 
92  QString saveToString();
93 
102  int getEltType(const QString& fileName, QString& eltType);
103 
111  int addElements(LPTYElementArray& eltCollection);
119  int addElement(TYElement* pElt);
120 
124  void resetDoc();
125 
131  static void setSavedFileName(QString savedFileName)
132  {
133  _savedFileName = savedFileName;
134  }
140  static QString getSavedFileName()
141  {
142  return _savedFileName;
143  }
144 
145  // Membres
146 protected:
154  void create_tyelements(LPTYElementArray& eltCollection);
155 
158 
161 
163  static QString _savedFileName;
164 };
165 
166 #endif // __TY_XMLMANAGER__
QDomDocument DOM_Document
Definition: QT2DOM.h:33
QDomElement DOM_Element
Definition: QT2DOM.h:30
std::vector< LPTYElement > LPTYElementArray
Definition: TYElement.h:345
static QString getSavedFileName()
Definition: TYXMLManager.h:140
static QString _savedFileName
Le nom de fichier pdt la sauvegarde (util pour l'enregistrement du topofile en relatif.
Definition: TYXMLManager.h:163
int save(QString fileName)
int load(const QString &fileName, LPTYElementArray &eltCollection)
int getEltType(const QString &fileName, QString &eltType)
void createDoc(QString docName, QString version)
QString saveToString()
int addElement(TYElement *pElt)
DOM_Document _domDocument
Le document XML.
Definition: TYXMLManager.h:157
static void setSavedFileName(QString savedFileName)
Definition: TYXMLManager.h:131
DOM_Element _rootElement
L'element racine du document XML.
Definition: TYXMLManager.h:160
int loadFromString(const QString &xmlString, LPTYElementArray &eltCollection)
int addElements(LPTYElementArray &eltCollection)
void create_tyelements(LPTYElementArray &eltCollection)