]> SALOME platform Git repositories - modules/yacs.git/blob - src/RessourcesCatalog/SALOME_RessourcesCatalog_Handler.hxx
Salome HOME
79e785560ac2e927b753afa801b8a8663deb4857
[modules/yacs.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 #if defined RESSOURCESCatalog_EXPORTS
39 #if defined WIN32
40 #define RESSOURCESCatalog_EXPORT __declspec( dllexport )
41 #else
42 #define RESSOURCESCatalog_EXPORT
43 #endif
44 #else
45 #if defined WNT
46 #define RESSOURCESCatalog_EXPORT __declspec( dllimport )
47 #else
48 #define RESSOURCESCatalog_EXPORT
49 #endif
50 #endif
51
52 class RESSOURCESCatalog_EXPORT SALOME_RessourcesCatalog_Handler : public QXmlDefaultHandler
53 {
54 public :
55   //! standard constructor
56   SALOME_RessourcesCatalog_Handler();
57
58   //! standard destructor
59   virtual ~SALOME_RessourcesCatalog_Handler();
60
61   //! method to overload handler function startDocument
62   /*! is called before a xml file is parsed
63     \return true if no error was detected
64   */
65   virtual bool startDocument();
66
67   //! method to overload handler function startElement
68   /*!
69     \param QString argument by value
70     \param QString argument by value
71     \param QString qName argument by value
72     \param QXmlAttributes atts argument by value
73     \return true if no error was detected
74   */
75   virtual bool startElement(const QString& , const QString& ,
76                             const QString& qName, const QXmlAttributes& atts);
77
78  //! method to overload handler function endElement
79   /*!
80     \param QString argument by value
81     \param QString argument by value
82     \param QString qName argument by value
83     \return true if no error was detected
84   */
85   virtual bool endElement(const QString&, const QString&,
86                           const QString& qName);
87
88  //! method to overload handler function characters
89   /*!
90     \param QString chars argument by value
91     \return true if no error was detected
92   */
93   virtual bool characters(const QString& chars);
94
95  //! method to overload handler function endDocument
96   /*! is called at the end of the parsing
97     \return true if no error was detected
98   */
99   virtual bool endDocument();
100
101  //! method to overload handler function errorProtocol
102   /*!
103     \return the error message
104   */
105   virtual QString errorProtocol();
106
107 //! method to overload handler function fatalError
108   /*!
109     \param QXmlParseException exception argument by value
110     \return true if no error was detected
111   */
112   virtual bool fatalError(const QXmlParseException& exception);
113
114
115 private :
116   QString errorProt;
117
118   std::string content;
119
120   const char* test_computer;
121   const char* test_computer_name;
122   const char* test_computer_OS;
123   const char* test_computer_OS_version;
124   const char* test_proc;
125   const char* test_proc_number;
126   const char* test_proc_model;
127   const char* test_proc_cpu;
128   const char* test_proc_cache;
129   const char* test_proc_list;
130   const char* test_container_type;
131   const char* test_container_type_list;
132
133   Parserressources _a_ressource;
134   
135   ListOfParserProc _procs_list;
136   ParserProc _a_proc;
137   ListOfParserContainerType _container_list;
138
139 };
140
141 #endif // SALOME_RESSOURCES_CATALOG_HANDLER