27 #ifndef RL_XML_DOMPARSER_H
28 #define RL_XML_DOMPARSER_H
32 #include <boost/shared_array.hpp>
33 #include <libxml/parser.h>
46 parser(::xmlNewParserCtxt(), ::xmlFreeParserCtxt)
54 ::xmlParserCtxtPtr
get()
const
64 Document readFile(const ::std::string& filename, const ::std::string& encoding =
"",
const int& options = 0)
const
66 ::xmlDocPtr doc = ::xmlCtxtReadFile(this->
parser.get(), filename.c_str(), encoding.c_str(), options);
76 Document readMemory(const ::std::string& buffer, const ::std::string& url =
"", const ::std::string& encoding =
"",
const int& options = 0)
const
78 ::xmlDocPtr doc = ::xmlCtxtReadMemory(this->
parser.get(), buffer.c_str(),
static_cast<int>(buffer.size()), url.c_str(), encoding.c_str(), options);
91 ::std::shared_ptr< ::xmlParserCtxt>
parser;
96 #endif // RL_XML_DOMPARSER_H