Salome HOME
Updated copyright comment
[modules/kernel.git] / src / ModuleCatalog / SALOME_ModuleCatalog_Handler.hxx
index c12c49cef7c9a83b8dca8839515c98346673d74c..680e81784b83ebf0c3299915335cfe7d8771cd53 100644 (file)
-//  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
+//  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
 //  File   : SALOME_ModuleCatalog_Handler.hxx
 //  Author : Estelle Deville
 //  Module : SALOME
 //  $Header$
-
+//
 #ifndef SALOME_CATALOG_HANDLER_H
 #define SALOME_CATALOG_HANDLER_H
 
-#include "utilities.h"
+#include "SALOME_ModuleCatalog.hxx"
+
 #include "SALOME_ModuleCatalog_Parser.hxx"
-#include <qxml.h>
+
 #include <string>
-#include <vector>
+#include <stack>
+#include <map>
+
+#include <libxml/parser.h>
+
+#ifdef WIN32
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
 
-class SALOME_ModuleCatalog_Handler : public QXmlDefaultHandler 
+class MODULECATALOG_EXPORT SALOME_ModuleCatalog_Handler
 {
 public:
   //! standard constructor
-  SALOME_ModuleCatalog_Handler();
+  SALOME_ModuleCatalog_Handler(ParserPathPrefixes& pathList,ParserComponents& moduleList,ParserTypes& typeMap,TypeList& typeList);
 
   //! standard destructor
   virtual ~SALOME_ModuleCatalog_Handler();
 
-
-  //! method to overload handler function startDocument
-  /*! Is called before a xml file is parsed
-   \return true if no error was detected
-  */ 
-  virtual bool startDocument();
-
-
-  //! method to overload handler function startElement
-  /*! 
-   \param Qstring argument by value
-   \param Qstring argument by value
-   \param Qstring argument by value
-   \param QXmlAttributes argument by value
-   \return true if no error was detected
-  */
-  virtual bool startElement(const QString&, const QString &,
-                           const QString& qName, const QXmlAttributes& atts); 
-
-  //! method to overload handler function endElement
-  /*!
-   \param Qstring argument by value
-   \param Qstring argument by value
-   \param Qstring argument by value
-   \return true if no error was detected
-   \sa _Find
-  */   
-  virtual bool endElement(const QString&, const QString &,
-                         const QString& qName);
-  
-
-  //! method to overload handler function characters
-  /*!
-   \param Qstring argument by value
-   \return true if no error was detected
-  */
-  virtual bool characters(const QString& chars);
-  
-  //! method to overload handler function endDocument
-  /*! Is called at the end of the parsing
-   \return true if no error was detected
-  */
-  virtual bool endDocument();
-
-  //! method to overload handler function errorProtocol
- /*!
-   \return the error message
-  */
-  virtual QString errorProtocol();
-
-  //! method to overload handler function fatalError
-  /*!
-    \param QXmlParseExecption argument by value
-    \return true if no error was detected
-  */
-  virtual bool fatalError(const QXmlParseException& exception);
+  void ProcessXmlDocument(xmlDocPtr theDoc);
  
 private:
-  QString errorProt ;
-
-  string content;
-
-  const char* test_path_prefix_name ;
-  const char* test_computer_name ;
-  const char* test_path_prefix ;
 
-  const char* test_component_name;
-  const char* test_component_username;
-  const char* test_component_type ;
-  const char* test_component_multistudy ;
-  const char* test_component_icone ;
-
-  const char* test_interface_name;
-
-  const char* test_service_name;
-  const char* test_defaultservice;
-
-  const char* test_inParameter_type;
-  const char* test_inParameter_name;
-  const char* test_inParameter;
-  const char* test_inParameter_list;
-  const char* test_outParameter_type;
-  const char* test_outParameter_name;
-  const char* test_outParameter;
-  const char* test_outParameter_list;
-
-  const char* test_service;
-  const char* test_service_list;
-  const char* test_interface_list;
-  const char* test_constraint;
+  const char *test_path_prefix_name ;
+  const char *test_computer_name ;
+  const char *test_computer_list ;
+  const char *test_path_prefix ;
+  const char *test_path_prefix_list;
+
+  const char *test_component_name;
+  const char *test_component_username;
+  const char *test_component_type ;
+  const char *test_component_icon ;
+  const char *test_component_impltype;
+  const char *test_component_implname;
+  const char *test_component_version;
+  const char *test_component_comment;
   
-  const char* test_component;
-
-  ParserPathPrefix _path_prefix;
+  const char *test_interface_name;
+  
+  const char *test_service_name;
+  const char *test_defaultservice;
+  const char *test_typeofnode;
+  
+  const char *test_inParameter_type;
+  const char *test_inParameter_name;
+  const char *test_inParameter;
+  const char *test_inParameter_list;
+  
+  const char *test_outParameter_type;
+  const char *test_outParameter_name;
+  const char *test_outParameter;
+  const char *test_outParameter_list;
+  
+  const char *test_inDataStreamParameter_type;
+  const char *test_inDataStreamParameter_name;
+  const char *test_inDataStreamParameter_dependency;
+  const char *test_inDataStreamParameter;
+  const char *test_inDataStreamParameter_list;
+  
+  const char *test_outDataStreamParameter_type;
+  const char *test_outDataStreamParameter_name;
+  const char *test_outDataStreamParameter_dependency;
+  const char *test_outDataStreamParameter;
+  const char *test_outDataStreamParameter_list;
+  
+  const char *test_service;
+  const char *test_service_list;
+  const char *test_interface_list;
+  const char *test_constraint;
+  
+  const char *test_component_list;
+  const char *test_component;
+  
+  ParserPathPrefix _pathPrefix;
+  
+  ParserComponent _aModule;
+  
+  ParserPathPrefixes&  _pathList;
+  ParserComponents&    _moduleList;
+  
+  ParserInterfaces _interfaceList;
+  ParserInterface  _aInterface;
+  
+  ParserServices   _serviceList;
+  ParserService    _aService;
 
-  ParserComponent _amodule;
+  ParserParameters _inParamList;
+  ParserParameter  _inParam;
+  
+  ParserParameters _outParamList;
+  ParserParameter  _outParam;
+  
+  ParserDataStreamParameters _inDataStreamParamList;
+  ParserDataStreamParameter  _inDataStreamParam;
+  
+  ParserDataStreamParameters _outDataStreamParamList;
+  ParserDataStreamParameter  _outDataStreamParam;
 
+  ParserTypes& _typeMap;
+  TypeList& _typeList;
 
-  ListOfDefinitionInterface _interfacelist;
-  ParserDefInterface _aInterface;
-  ListOfParserServices _servicelist;
-  ParserService _aService;
-  ParserServParam _inparam;
-  ParserServParam _outparam;
-  ListOfParserServicesParameter _inparamlist;
-  ListOfParserServicesParameter _outparamlist;
+  ParserSequences _sequenceMap;
+  ParserObjrefs _objrefMap;
+  ParserStructs _structMap;
 };
 
 #endif // SALOME_CATALOG_HANDLER_H