Salome HOME
Issue #273: Add copyright string
[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  * Base class for all libxml readers. Provides high-level API
32  * for all xml operations.
33  *
34  */
35 class Config_XMLReader
36 {
37  public:
38   CONFIG_EXPORT Config_XMLReader(const std::string& theXmlFile);CONFIG_EXPORT virtual ~Config_XMLReader();
39
40   CONFIG_EXPORT void readAll();
41
42  public:
43   CONFIG_EXPORT xmlNodePtr findRoot();
44
45  protected:
46   virtual void processNode(xmlNodePtr aNode);
47   virtual bool processChildren(xmlNodePtr aNode);
48
49   void readRecursively(xmlNodePtr theParent);
50
51   xmlNodePtr node(void* theNode);
52   std::string getNodeName(xmlNodePtr theNode);
53   void processValidator(xmlNodePtr theNode);
54   void processSelectionFilter(xmlNodePtr theNode);
55
56  protected:
57   std::string myCurrentFeature;
58
59  protected:
60   std::string myDocumentPath;
61   xmlDocPtr myXmlDoc;
62 };
63
64 #endif /* CONFIG_XMLREADER_H_ */