diff options
author | fippo <fippo@yandex-team.ru> | 2022-02-10 16:50:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:08 +0300 |
commit | 7bf72dabd2102d9781c1ec7a754579757baa7b90 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/xml/document/node-attr.h | |
parent | 3e57c324d47a3a202cb3c5a9648d2f92103d5213 (diff) | |
download | ydb-7bf72dabd2102d9781c1ec7a754579757baa7b90.tar.gz |
Restoring authorship annotation for <fippo@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/xml/document/node-attr.h')
-rw-r--r-- | library/cpp/xml/document/node-attr.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/xml/document/node-attr.h b/library/cpp/xml/document/node-attr.h index baf2812d95..6e74403943 100644 --- a/library/cpp/xml/document/node-attr.h +++ b/library/cpp/xml/document/node-attr.h @@ -182,28 +182,28 @@ namespace NXml { return TNode(DocPointer, child); } - template <class T> + template <class T> typename std::enable_if<!std::is_convertible_v<T, TStringBuf>, TNode>::type TNode::AddText(const T& value) { - TStringStream ss; - ss << value; - return AddText(ss.Str()); - } - + TStringStream ss; + ss << value; + return AddText(ss.Str()); + } + inline TNode TNode::AddText(TStringBuf value) { if (IsNull()) { THROW(XmlException, "addChild [value=" << value << "]: can't add child to null node"); - } - - xmlNode* child = xmlNewTextLen((xmlChar*)value.data(), value.size()); - child = xmlAddChild(NodePointer, child); - + } + + xmlNode* child = xmlNewTextLen((xmlChar*)value.data(), value.size()); + child = xmlAddChild(NodePointer, child); + if (!child) { THROW(XmlException, "addChild [value=" << value << "]: xmlNewTextChild returned NULL"); - } - - return TNode(DocPointer, child); - } + } + + return TNode(DocPointer, child); + } } |