10 #ifndef MPD_BASE_XML_SCOPED_XML_PTR_H_
11 #define MPD_BASE_XML_SCOPED_XML_PTR_H_
13 #include <libxml/tree.h>
14 #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>;
46 #endif // MPD_BASE_XML_SCOPED_XML_PTR_H_