Salome HOME
Corrections in the documentation of the Config package
[modules/shaper.git] / src / Config / Config_XMLReader.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * Config_XMLReader.h
5  *
6  *  Created on: Mar 14, 2014
7  *      Author: sbh
8  */
9
10 #ifndef CONFIG_XMLREADER_H_
11 #define CONFIG_XMLREADER_H_
12
13 #include <Config_def.h>
14
15 #include <cstdarg>
16 #include <string>
17
18 //>> Forward declaration of xmlNodePtr.
19 typedef struct _xmlNode xmlNode;
20 typedef xmlNode *xmlNodePtr;
21 struct _xmlNode;
22 //<<
23
24 //>> Forward declaration of xmlDocPtr.
25 typedef struct _xmlDoc xmlDoc;
26 typedef xmlDoc *xmlDocPtr;
27 struct _xmlDoc;
28 //<<
29
30 /*!
31  * \class Config_XMLReader
32  * \brief Base class for all libxml readers. Provides high-level API
33  * for all xml operations.
34 */
35 class Config_XMLReader
36 {
37  public:
38   CONFIG_EXPORT Config_XMLReader(const std::string& theXmlFile);
39   CONFIG_EXPORT virtual ~Config_XMLReader();
40
41   CONFIG_EXPORT void readAll();
42
43  public:
44   CONFIG_EXPORT xmlNodePtr findRoot();
45
46  protected:
47   virtual void processNode(xmlNodePtr aNode);
48   virtual bool processChildren(xmlNodePtr aNode);
49
50   void readRecursively(xmlNodePtr theParent);
51
52   xmlNodePtr node(void* theNode);
53   std::string getNodeName(xmlNodePtr theNode);
54   void processValidator(xmlNodePtr theNode);
55   void processSelectionFilter(xmlNodePtr theNode);
56
57  protected:
58   std::string myCurrentFeature;
59
60  protected:
61   std::string myDocumentPath;
62   xmlDocPtr myXmlDoc;
63 };
64
65 #endif /* CONFIG_XMLREADER_H_ */