diff options
author | kerzum <kerzum@yandex-team.ru> | 2022-02-10 16:49:33 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:33 +0300 |
commit | 9a7232babfd763ccfe827bc70e82e0f50cfd8276 (patch) | |
tree | a39808b7482c4711a80f799a7281adb36d76a13a /library/cpp/xml/init | |
parent | 0e68ae909d3b76a5a001a07880eb0010dec6b2ea (diff) | |
download | ydb-9a7232babfd763ccfe827bc70e82e0f50cfd8276.tar.gz |
Restoring authorship annotation for <kerzum@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/xml/init')
-rw-r--r-- | library/cpp/xml/init/ptr.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/xml/init/ptr.h b/library/cpp/xml/init/ptr.h index 7387c7cc40..e8c2c8a785 100644 --- a/library/cpp/xml/init/ptr.h +++ b/library/cpp/xml/init/ptr.h @@ -1,6 +1,6 @@ -#pragma once - -#include <util/generic/ptr.h> +#pragma once + +#include <util/generic/ptr.h> #include <libxml/tree.h> #include <libxml/parser.h> #include <libxml/xpath.h> @@ -8,39 +8,39 @@ #include <libxml/xmlsave.h> #include <libxml/uri.h> #include <libxml/xmlschemas.h> - + template <class T, void (*DestroyFun)(T*)> -struct TFunctionDestroy { +struct TFunctionDestroy { static inline void Destroy(T* t) noexcept { - if (t) - DestroyFun(t); - } -}; - -namespace NXml { + if (t) + DestroyFun(t); + } +}; + +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 xmlDocPtr -> TxmlDocHolder TxmlDocPtr DEF_HOLDER(xmlDoc, xmlFreeDoc); DEF_PTR(xmlDoc, xmlFreeDoc); - + // xmlXPathContextPtr xpathCtx; DEF_HOLDER(xmlXPathContext, xmlXPathFreeContext); DEF_PTR(xmlXPathContext, xmlXPathFreeContext); - + // xmlXPathObjectPtr xpathObj; DEF_HOLDER(xmlXPathObject, xmlXPathFreeObject); DEF_PTR(xmlXPathObject, xmlXPathFreeObject); - + // xmlNodeSetPtr nodes DEF_HOLDER(xmlNodeSet, xmlXPathFreeNodeSet); DEF_PTR(xmlNodeSet, xmlXPathFreeNodeSet); - + // xmlSchemaParserCtxtPtr ctxt; DEF_HOLDER(xmlSchemaParserCtxt, xmlSchemaFreeParserCtxt); DEF_PTR(xmlSchemaParserCtxt, xmlSchemaFreeParserCtxt); - + // xmlSchemaPtr schema; DEF_HOLDER(xmlSchema, xmlSchemaFree); DEF_PTR(xmlSchema, xmlSchemaFree); @@ -63,7 +63,7 @@ namespace NXml { DEF_PTR(xmlParserInputBuffer, xmlFreeParserInputBuffer); DEF_PTR(xmlDtd, xmlFreeDtd); DEF_PTR(xmlValidCtxt, xmlFreeValidCtxt); - -#undef DEF_HOLDER -#undef DEF_PTR -} + +#undef DEF_HOLDER +#undef DEF_PTR +} |