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()(xmlSchemaPtr ptr)
const { xmlSchemaFree(ptr); }
32 inline void operator()(xmlNodePtr ptr)
const { xmlFreeNode(ptr); }
33 inline void operator()(xmlDocPtr ptr)
const { xmlFreeDoc(ptr); }
34 inline void operator()(xmlChar* ptr)
const { xmlFree(ptr); }
37 template <
typename XmlType>
38 using scoped_xml_ptr = std::unique_ptr<XmlType, XmlDeleter>;
43 #endif // MPD_BASE_XML_SCOPED_XML_PTR_H_
All the methods that are virtual are virtual for mocking.