![]() |
XmlDocument Class Reference#include <XmlDocument.h>
Detailed DescriptionDefinition at line 49 of file XmlDocument.h. Constructor & Destructor Documentation
Definition at line 43 of file XmlDocument.cpp. 00044 : m_doc(NULL) 00045 , m_ok(false) 00046 { 00047 xmlNodePtr cur; 00048 xmlNsPtr ns; 00049 00050 if (!(m_doc = xmlParseFile(filename.c_str() ))) 00051 { 00052 throw XmlException("Parse of file failed: " + filename); 00053 } 00054 if (!(cur = xmlDocGetRootElement(m_doc))) 00055 { 00056 xmlFreeDoc(m_doc); 00057 m_doc = NULL; 00058 throw XmlException("Document is empty: " + filename); 00059 } 00060 if (verify_ns.size()) 00061 { 00062 if (!(ns = xmlSearchNsByHref(m_doc, cur, (const xmlChar *) verify_ns.c_str() ))) 00063 { 00064 xmlFreeDoc(m_doc); 00065 m_doc = NULL; 00066 throw XmlException("Document namespace != " + verify_ns); 00067 } 00068 } 00069 if (verify_root.size()) 00070 { 00071 if (xmlStrcmp(cur -> name, (const xmlChar *) verify_root.c_str() )) 00072 { 00073 xmlFreeDoc(m_doc); 00074 m_doc = NULL; 00075 throw XmlException("Document root != " + verify_root); 00076 } 00077 } 00078 m_ok = true; 00079 }
Member Function Documentation
Definition at line 91 of file XmlDocument.cpp. References m_doc. 00092 { 00093 return m_doc; 00094 }
Member Data Documentation
Definition at line 66 of file XmlDocument.h. Referenced by operator xmlDocPtr(), XmlDocument(), and ~XmlDocument().
The documentation for this class was generated from the following files: |