00001 #ifndef _BASEXMLFILE_H 00002 #define _BASEXMLFILE_H 00003 00004 #include <string> 00005 #include <libxml/xmlmemory.h> 00006 #include <libxml/parser.h> 00007 00008 00009 class BaseXMLFile 00010 { 00011 public: 00012 BaseXMLFile(const std::string& filename,const std::string& verify_ns = "",const std::string& verify_root = ""); 00013 ~BaseXMLFile(); 00014 00015 xmlDocPtr GetDocument() { return m_doc; } 00016 xmlNodePtr GetRootElement(); 00017 std::string GetProperty(const std::string& ); 00018 xmlNodePtr GetChildrenNode(); 00019 xmlNodePtr GetNextNode(); 00020 const std::string& GetNodeName(); 00021 void SetCurrent(xmlNodePtr p) { m_current = p; } 00022 xmlNsPtr GetNodeNs(); 00023 const std::string& GetNodeNsPrefix(); 00024 const std::string& GetNodeNsHref(); 00025 00026 xmlNodePtr GetFirstElement(const std::string& ); 00027 xmlNodePtr GetFirstElement(xmlNodePtr,const std::string& ); 00028 xmlNodePtr GetNextElement(xmlNodePtr,const std::string& ); 00029 00030 bool IsOk() { return m_ok; } 00031 00032 private: 00033 xmlDocPtr m_doc; 00034 xmlNodePtr m_current; 00035 std::string m_current_name; 00036 std::string m_ns_prefix; 00037 std::string m_ns_href; 00038 bool m_ok; 00039 }; 00040 00041 00042 00043 00044 #endif // _BASEXMLFILE_H