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 | 3e57c324d47a3a202cb3c5a9648d2f92103d5213 (patch) | |
tree | 6913479b0d0b22ec99bbba7c96f2f930d9095600 /library/cpp/xml/document/xml-document.cpp | |
parent | bebbbda5c5ff4ec70d301ac897eb8d6c8da7a9a4 (diff) | |
download | ydb-3e57c324d47a3a202cb3c5a9648d2f92103d5213.tar.gz |
Restoring authorship annotation for <fippo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/xml/document/xml-document.cpp')
-rw-r--r-- | library/cpp/xml/document/xml-document.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/xml/document/xml-document.cpp b/library/cpp/xml/document/xml-document.cpp index 18a554d7321..93beed31997 100644 --- a/library/cpp/xml/document/xml-document.cpp +++ b/library/cpp/xml/document/xml-document.cpp @@ -209,15 +209,15 @@ namespace NXml { TNode TNode::Parent() { if (nullptr == NodePointer->parent) - THROW(XmlException, "Parent node not exists"); - - return TNode(DocPointer, NodePointer->parent); - } + THROW(XmlException, "Parent node not exists"); + return TNode(DocPointer, NodePointer->parent); + } + TConstNode TNode::Parent() const { - return const_cast<TNode*>(this)->Parent(); - } - + return const_cast<TNode*>(this)->Parent(); + } + TNode TNode::NextSibling(TZtStringBuf name) { if (IsNull()) THROW(XmlException, "Node is null"); @@ -255,13 +255,13 @@ namespace NXml { } void TNode::SetPrivate(void* priv) { - NodePointer->_private = priv; - } + NodePointer->_private = priv; + } void* TNode::GetPrivate() const { - return NodePointer->_private; - } - + return NodePointer->_private; + } + TNode TNode::Find(xmlNode* start, TZtStringBuf name) { for (; start; start = start->next) if (start->type == XML_ELEMENT_NODE && (name.empty() || !xmlStrcmp(start->name, XMLCHAR(name.c_str())))) @@ -286,20 +286,20 @@ namespace NXml { } xmlNode* TNode::GetPtr() { - return NodePointer; - } - + return NodePointer; + } + const xmlNode* TNode::GetPtr() const { - return NodePointer; - } - + return NodePointer; + } + bool TNode::IsText() const { if (IsNull()) THROW(XmlException, "Node is null"); - return NodePointer->type == XML_TEXT_NODE; - } - + return NodePointer->type == XML_TEXT_NODE; + } + void TNode::Remove() { xmlNode* nodePtr = GetPtr(); xmlUnlinkNode(nodePtr); |