Salome HOME
To customize processing of various XML files:
[modules/shaper.git] / src / Config / Config_XMLReader.h
1 /*
2  * Config_XMLReader.h
3  *
4  *  Created on: Mar 14, 2014
5  *      Author: sbh
6  */
7
8 #ifndef CONFIG_XMLREADER_H_
9 #define CONFIG_XMLREADER_H_
10
11 #include "Config.h"
12 #include "Config_Message.h"
13
14 #include <string>
15
16 //Forward declaration for xmlNodePtr.
17 typedef struct _xmlNode xmlNode;
18 typedef xmlNode *xmlNodePtr;
19 struct _xmlNode;
20
21 class CONFIG_EXPORT Config_XMLReader {
22 public:
23   Config_XMLReader(const std::string& theXmlFile);
24   virtual ~Config_XMLReader();
25
26   void readAll();
27
28 protected:
29   virtual void processNode(xmlNodePtr aNode);
30   virtual bool processChildren(xmlNodePtr aNode);
31
32   xmlNodePtr findRoot();
33   void readRecursively(xmlNodePtr theParent);
34
35   xmlNodePtr node(void* theNode);
36   std::string getProperty(xmlNodePtr theNode, const char* property);
37   bool isNode(xmlNodePtr theNode, const char* name);
38
39 private:
40   std::string m_DocumentPath;
41 };
42
43 #endif /* CONFIG_XMLREADER_H_ */