diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/xml/init/ptr.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/xml/init/ptr.h')
-rw-r--r-- | library/cpp/xml/init/ptr.h | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/library/cpp/xml/init/ptr.h b/library/cpp/xml/init/ptr.h index 7387c7cc40..33e433a858 100644 --- a/library/cpp/xml/init/ptr.h +++ b/library/cpp/xml/init/ptr.h @@ -9,7 +9,7 @@ #include <libxml/uri.h> #include <libxml/xmlschemas.h> -template <class T, void (*DestroyFun)(T*)> +template <class T, void (*DestroyFun)(T*)> struct TFunctionDestroy { static inline void Destroy(T* t) noexcept { if (t) @@ -18,49 +18,49 @@ struct TFunctionDestroy { }; namespace NXml { -#define DEF_HOLDER(type, free) typedef THolder<type, TFunctionDestroy<type, free>> T##type##Holder -#define DEF_PTR(type, free) typedef TAutoPtr<type, TFunctionDestroy<type, free>> T##type##Ptr +#define DEF_HOLDER(type, free) typedef THolder<type, TFunctionDestroy<type, free>> T##type##Holder +#define DEF_PTR(type, free) typedef TAutoPtr<type, TFunctionDestroy<type, free>> T##type##Ptr - // define xmlDocPtr -> TxmlDocHolder TxmlDocPtr - DEF_HOLDER(xmlDoc, xmlFreeDoc); - DEF_PTR(xmlDoc, xmlFreeDoc); + // define xmlDocPtr -> TxmlDocHolder TxmlDocPtr + DEF_HOLDER(xmlDoc, xmlFreeDoc); + DEF_PTR(xmlDoc, xmlFreeDoc); - // xmlXPathContextPtr xpathCtx; - DEF_HOLDER(xmlXPathContext, xmlXPathFreeContext); - DEF_PTR(xmlXPathContext, xmlXPathFreeContext); + // xmlXPathContextPtr xpathCtx; + DEF_HOLDER(xmlXPathContext, xmlXPathFreeContext); + DEF_PTR(xmlXPathContext, xmlXPathFreeContext); - // xmlXPathObjectPtr xpathObj; - DEF_HOLDER(xmlXPathObject, xmlXPathFreeObject); - DEF_PTR(xmlXPathObject, xmlXPathFreeObject); + // xmlXPathObjectPtr xpathObj; + DEF_HOLDER(xmlXPathObject, xmlXPathFreeObject); + DEF_PTR(xmlXPathObject, xmlXPathFreeObject); - // xmlNodeSetPtr nodes - DEF_HOLDER(xmlNodeSet, xmlXPathFreeNodeSet); - DEF_PTR(xmlNodeSet, xmlXPathFreeNodeSet); + // xmlNodeSetPtr nodes + DEF_HOLDER(xmlNodeSet, xmlXPathFreeNodeSet); + DEF_PTR(xmlNodeSet, xmlXPathFreeNodeSet); - // xmlSchemaParserCtxtPtr ctxt; + // xmlSchemaParserCtxtPtr ctxt; DEF_HOLDER(xmlSchemaParserCtxt, xmlSchemaFreeParserCtxt); - DEF_PTR(xmlSchemaParserCtxt, xmlSchemaFreeParserCtxt); + DEF_PTR(xmlSchemaParserCtxt, xmlSchemaFreeParserCtxt); - // xmlSchemaPtr schema; + // xmlSchemaPtr schema; DEF_HOLDER(xmlSchema, xmlSchemaFree); - DEF_PTR(xmlSchema, xmlSchemaFree); + DEF_PTR(xmlSchema, xmlSchemaFree); - // xmlSchemaValidCtxt ctxt; + // xmlSchemaValidCtxt ctxt; DEF_HOLDER(xmlSchemaValidCtxt, xmlSchemaFreeValidCtxt); - DEF_PTR(xmlSchemaValidCtxt, xmlSchemaFreeValidCtxt); + DEF_PTR(xmlSchemaValidCtxt, xmlSchemaFreeValidCtxt); - // xmlSaveCtxtPtr - inline void xmlFreeSave(xmlSaveCtxt* c) { - // returns int - xmlSaveClose(c); - } - DEF_HOLDER(xmlSaveCtxt, xmlFreeSave); - DEF_PTR(xmlSaveCtxt, xmlFreeSave); + // xmlSaveCtxtPtr + inline void xmlFreeSave(xmlSaveCtxt* c) { + // returns int + xmlSaveClose(c); + } + DEF_HOLDER(xmlSaveCtxt, xmlFreeSave); + DEF_PTR(xmlSaveCtxt, xmlFreeSave); - DEF_PTR(xmlURI, xmlFreeURI); - DEF_PTR(xmlNode, xmlFreeNode); - DEF_PTR(xmlParserCtxt, xmlFreeParserCtxt); - DEF_PTR(xmlParserInputBuffer, xmlFreeParserInputBuffer); + DEF_PTR(xmlURI, xmlFreeURI); + DEF_PTR(xmlNode, xmlFreeNode); + DEF_PTR(xmlParserCtxt, xmlFreeParserCtxt); + DEF_PTR(xmlParserInputBuffer, xmlFreeParserInputBuffer); DEF_PTR(xmlDtd, xmlFreeDtd); DEF_PTR(xmlValidCtxt, xmlFreeValidCtxt); |