10 #ifndef MPD_BASE_XML_SCOPED_XML_PTR_H_
11 #define MPD_BASE_XML_SCOPED_XML_PTR_H_
15 #include <libxml/tree.h>
16 #include <libxml/xmlschemas.h>
25 inline void operator()(xmlSchemaParserCtxtPtr ptr)
const {
26 xmlSchemaFreeParserCtxt(ptr);
28 inline void operator()(xmlSchemaValidCtxtPtr ptr)
const {
29 xmlSchemaFreeValidCtxt(ptr);
31 inline void operator()(xmlOutputBufferPtr ptr)
const {
32 xmlOutputBufferClose(ptr);
34 inline void operator()(xmlSchemaPtr ptr)
const { xmlSchemaFree(ptr); }
35 inline void operator()(xmlNodePtr ptr)
const { xmlFreeNode(ptr); }
36 inline void operator()(xmlDocPtr ptr)
const { xmlFreeDoc(ptr); }
37 inline void operator()(xmlChar* ptr)
const { xmlFree(ptr); }
40 template <
typename XmlType>
41 using scoped_xml_ptr = std::unique_ptr<XmlType, XmlDeleter>;
All the methods that are virtual are virtual for mocking.