Salome HOME
Update Config after merging with master
[modules/shaper.git] / src / Config / Config_ValidatorReader.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * Config_ValidatorReader.h
5  *
6  *  Created on: Mar 20, 2015
7  *      Author: sbh
8  */
9
10 #ifndef CONFIG_VALIDATORREADER_H_
11 #define CONFIG_VALIDATORREADER_H_
12
13 #include <Config_def.h>
14 #include <Config_XMLReader.h>
15
16 #include <cstdarg>
17 #include <string>
18
19 /*!
20  * \class Config_ValidatorReader
21  * \ingroup Config
22  * \brief Base class for all libxml readers. Provides high-level API
23  * for all xml operations.
24 */
25 class Config_ValidatorReader : public Config_XMLReader
26 {
27  public:
28   /*!
29    * Constructor
30    * \param theXmlFile - full path to the xml file which will be processed by the reader
31    */
32   CONFIG_EXPORT Config_ValidatorReader(const std::string& theXmlFile);
33   CONFIG_EXPORT virtual ~Config_ValidatorReader();
34
35  protected:
36   /*!
37    * \brief Allows to customize reader's behavior for a node. Virtual.
38    * The default implementation process "source", "validator" and
39    * "selection_filter" nodes.
40    */
41   virtual void processNode(xmlNodePtr aNode);
42   /*!
43    * \brief Defines which nodes should be processed recursively. Virtual.
44    * The default impl is to read all nodes.
45    */
46   virtual bool processChildren(xmlNodePtr aNode);
47
48   /*!
49    * Cleans the cached information about parent feature or attribute (widget)
50    */
51   virtual void cleanup(xmlNodePtr theNode);
52
53   /*!
54    * \brief Retrieves all the necessary info from the validator node.
55    * Sends ValidatorLoaded event
56    */
57   void processValidator(xmlNodePtr theNode);
58   /*!
59    * \brief Retrieves all the necessary info from the SelectionFilter node.
60    * Sends SelectionFilterLoaded event
61    */
62   void processSelectionFilter(xmlNodePtr theNode);
63
64  private:
65   std::string myCurrentWidget;
66 };
67
68 #endif /* CONFIG_VALIDATORREADER_H_ */