Salome HOME
Moved some functionality to VTKViewer_Utilities.h
[modules/kernel.git] / src / RessourcesCatalog / SALOME_RessourcesCatalog_Handler.hxx
1 //  SALOME RessourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SALOME_RessourcesCatalog_Handler.hxx
25 //  Author : Estelle Deville
26 //  Module : SALOME
27 //$Header$
28
29 #ifndef SALOME_RESSOURCES_CATALOG_HANDLER
30 #define SALOME_RESSOURCES_CATALOG_HANDLER
31
32 #include "SALOME_RessourcesCatalog_Parser.hxx"
33
34 #include <qxml.h>
35 #include <string>
36 #include <vector>
37
38 class SALOME_RessourcesCatalog_Handler : public QXmlDefaultHandler
39 {
40 public :
41   //! standard constructor
42   SALOME_RessourcesCatalog_Handler();
43
44   //! standard destructor
45   virtual ~SALOME_RessourcesCatalog_Handler();
46
47   //! method to overload handler function startDocument
48   /*! is called before a xml file is parsed
49     \return true if no error was detected
50   */
51   virtual bool startDocument();
52
53   //! method to overload handler function startElement
54   /*!
55     \param QString argument by value
56     \param QString argument by value
57     \param QString qName argument by value
58     \param QXmlAttributes atts argument by value
59     \return true if no error was detected
60   */
61   virtual bool startElement(const QString& , const QString& ,
62                             const QString& qName, const QXmlAttributes& atts);
63
64  //! method to overload handler function endElement
65   /*!
66     \param QString argument by value
67     \param QString argument by value
68     \param QString qName argument by value
69     \return true if no error was detected
70   */
71   virtual bool endElement(const QString&, const QString&,
72                           const QString& qName);
73
74  //! method to overload handler function characters
75   /*!
76     \param QString chars argument by value
77     \return true if no error was detected
78   */
79   virtual bool characters(const QString& chars);
80
81  //! method to overload handler function endDocument
82   /*! is called at the end of the parsing
83     \return true if no error was detected
84   */
85   virtual bool endDocument();
86
87  //! method to overload handler function errorProtocol
88   /*!
89     \return the error message
90   */
91   virtual QString errorProtocol();
92
93 //! method to overload handler function fatalError
94   /*!
95     \param QXmlParseException exception argument by value
96     \return true if no error was detected
97   */
98   virtual bool fatalError(const QXmlParseException& exception);
99
100
101 private :
102   QString errorProt;
103
104   std::string content;
105
106   const char* test_computer;
107   const char* test_computer_name;
108   const char* test_computer_OS;
109   const char* test_computer_OS_version;
110   const char* test_proc;
111   const char* test_proc_number;
112   const char* test_proc_model;
113   const char* test_proc_cpu;
114   const char* test_proc_cache;
115   const char* test_proc_list;
116   const char* test_container_type;
117   const char* test_container_type_list;
118
119   Parserressources _a_ressource;
120   
121   ListOfParserProc _procs_list;
122   ParserProc _a_proc;
123   ListOfParserContainerType _container_list;
124
125 };
126
127 #endif // SALOME_RESSOURCES_CATALOG_HANDLER