1 // SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : GraphBase_XmlHandler.hxx
25 // Author : Arnaud RES
29 #define INCLUDE_MENUITEM_DEF
30 #define QT_ALTERNATE_QTSMANIP
33 #include <qstringlist.h>
37 //#include <SALOMEconfig.h>
38 //#include CORBA_CLIENT_HEADER(SALOME_SuperVision)
40 #include "DataFlowBase_Graph.hxx"
46 class XmlHandler : public QXmlDefaultHandler {
50 string fieldname[maxlevel] ;
51 string fieldvalue[maxlevel] ;
55 GraphBase::SNode aNode ;
56 SALOME_ModuleCatalog::ServicesParameter aParameter ;
57 GraphBase::InDataStreamParameter anInDataStreamParameter ;
58 GraphBase::OutDataStreamParameter anOutDataStreamParameter ;
59 // SALOME_ModuleCatalog::ServicesDataStreamParameter aDataStreamParameter ;
60 SUPERV::ListOfStrings aPythonFunction ;
61 GraphBase::SLink aLink ;
62 // SALOME_SuperVisionBase::ServicesParameterValue aLinkValue ;
63 CORBA::Any aLinkValue ;
72 GraphBase::ListOfSGraphs aListOfDataFlows ;
77 XmlHandler( CORBA::ORB_ptr Orb , const bool aConstructor );
78 virtual ~XmlHandler();
80 GraphBase::ListOfSGraphs & ListOfDataFlows() {
81 return aListOfDataFlows ; } ;
83 // return the error protocol if parsing failed
84 QString errorProtocol();
86 // overloaded handler functions
87 bool startDocument() ;
89 bool startElement( const QString& namespaceURI, const QString& localName,
90 const QString& qName, const QXmlAttributes& atts ) ;
91 bool endElement( const QString& namespaceURI, const QString& localName,
92 const QString& qName ) ;
93 bool characters( const QString& ch ) ;
95 QString errorString();
97 bool fatalError( const QXmlParseException& exception);
99 SUPERV::SDate StringToDate( QString& qstrDate) const;
101 const long getdepth() const { return depth ; } ;
102 const string getfieldname( const long adepth ) const { return fieldname[adepth] ; } ;
103 const string getfieldvalue( const long adepth ) const { return fieldvalue[adepth] ; } ;