Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
TYXMLManager Class Reference

#include <TYXMLManager.h>

Public Member Functions

 TYXMLManager ()
 
 ~TYXMLManager ()
 
void createDoc (QString docName, QString version)
 
int load (const QString &fileName, LPTYElementArray &eltCollection)
 
int save (QString fileName)
 
int loadFromString (const QString &xmlString, LPTYElementArray &eltCollection)
 
QString saveToString ()
 
int getEltType (const QString &fileName, QString &eltType)
 
int addElements (LPTYElementArray &eltCollection)
 
int addElement (TYElement *pElt)
 
void resetDoc ()
 

Static Public Member Functions

static void setSavedFileName (QString savedFileName)
 
static QString getSavedFileName ()
 

Protected Member Functions

void create_tyelements (LPTYElementArray &eltCollection)
 

Protected Attributes

DOM_Document _domDocument
 Le document XML. More...
 
DOM_Element _rootElement
 L'element racine du document XML. More...
 

Static Protected Attributes

static QString _savedFileName = QString("")
 Le nom de fichier pdt la sauvegarde (util pour l'enregistrement du topofile en relatif. More...
 

Detailed Description

Classe pour la gestion de l'import et l'export des elements Tympan en XML.

Definition at line 32 of file TYXMLManager.h.

Constructor & Destructor Documentation

◆ TYXMLManager()

TYXMLManager::TYXMLManager ( )

Constructeur.

Definition at line 82 of file TYXMLManager.cpp.

◆ ~TYXMLManager()

TYXMLManager::~TYXMLManager ( )

Destructeur.

Definition at line 84 of file TYXMLManager.cpp.

Member Function Documentation

◆ addElement()

int TYXMLManager::addElement ( TYElement pElt)

Ajoute un nouvel element au document XML.

Parameters
pEltL'element a ajouter.
Returns
L'etat de reussite.

Definition at line 324 of file TYXMLManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addElements()

int TYXMLManager::addElements ( LPTYElementArray eltCollection)

Ajoute une collection de nouveaux elements au document XML.

Parameters
eltCollectionLa collection d'elements a ajouter.
Returns
L'etat de reussite.

Definition at line 312 of file TYXMLManager.cpp.

◆ create_tyelements()

void TYXMLManager::create_tyelements ( LPTYElementArray eltCollection)
protected

Crée les éléments métiers trouvés dans le document xml interne _domDocument et remplit la collection eltCollection avec ces éléments

Parameters
eltCollectionLa collection d'element a peupler.

Definition at line 178 of file TYXMLManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createDoc()

void TYXMLManager::createDoc ( QString  docName,
QString  version 
)

Creer un nouveau document XML. Remarque : un document n'est pas un fichier.

Parameters
docNameLe nom du noeud racine du document XML.
versionle numero de version

Definition at line 86 of file TYXMLManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEltType()

int TYXMLManager::getEltType ( const QString &  fileName,
QString &  eltType 
)

Indique le type d'element auquel correspond le fichier XML

Parameters
fileNameLe chemin du fichier XML a lire.
eltTypeLe type d'element que contient le fichier.
Returns
L'etat de reussite.

Definition at line 269 of file TYXMLManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSavedFileName()

static QString TYXMLManager::getSavedFileName ( )
inlinestatic

Permet le stockage du fichier de sauvegarde

Returns
savedFileName Le path de fichier de sauvegarde.

Definition at line 140 of file TYXMLManager.h.

Here is the caller graph for this function:

◆ load()

int TYXMLManager::load ( const QString &  fileName,
LPTYElementArray eltCollection 
)

Ouvre un fichier XML et parse le document. Une collection d'element est peuple par les noeuds Tympan valides trouves.

Parameters
fileNameLe chemin du fichier XML a lire.
eltCollectionLa collection d'element a peupler.
Returns
L'etat de reussite.

Definition at line 107 of file TYXMLManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFromString()

int TYXMLManager::loadFromString ( const QString &  xmlString,
LPTYElementArray eltCollection 
)

Ouvre uns string XML et parse le document. Une collection d'element est peuple par les noeuds Tympan valides trouves.

Parameters
xmlStringLa string XML a lire.
eltCollectionLa collection d'element a peupler.
Returns
L'etat de reussite.

Definition at line 247 of file TYXMLManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetDoc()

void TYXMLManager::resetDoc ( )

Enleve tous les elements du document DOM courant.

Definition at line 337 of file TYXMLManager.cpp.

Here is the caller graph for this function:

◆ save()

int TYXMLManager::save ( QString  fileName)

Sauvegarde le document XML en cours dans un fichier XML. Si le fichier existe, celui-ci sera ecrase.

Parameters
fileNameLe chemin du fichier XML a ecrire.
Returns
L'etat de reussite.

Definition at line 241 of file TYXMLManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveToString()

QString TYXMLManager::saveToString ( )

Sauvegarde le document XML en cours dans une string XML.

Returns
La string XML.

Definition at line 263 of file TYXMLManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSavedFileName()

static void TYXMLManager::setSavedFileName ( QString  savedFileName)
inlinestatic

Permet le stockage du fichier de sauvegarde

Parameters
savedFileNameLe path de fichier de sauvegarde.

Definition at line 131 of file TYXMLManager.h.

Here is the caller graph for this function:

Member Data Documentation

◆ _domDocument

DOM_Document TYXMLManager::_domDocument
protected

Le document XML.

Definition at line 157 of file TYXMLManager.h.

◆ _rootElement

DOM_Element TYXMLManager::_rootElement
protected

L'element racine du document XML.

Definition at line 160 of file TYXMLManager.h.

◆ _savedFileName

QString TYXMLManager::_savedFileName = QString("")
staticprotected

Le nom de fichier pdt la sauvegarde (util pour l'enregistrement du topofile en relatif.

Definition at line 163 of file TYXMLManager.h.


The documentation for this class was generated from the following files: