diff options
| author | fippo <[email protected]> | 2022-02-10 16:50:08 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:50:08 +0300 | 
| commit | 7bf72dabd2102d9781c1ec7a754579757baa7b90 (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/xml/document/xml-document.cpp | |
| parent | 3e57c324d47a3a202cb3c5a9648d2f92103d5213 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 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 93beed31997..18a554d7321 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");  +            THROW(XmlException, "Parent node not exists"); + +        return TNode(DocPointer, NodePointer->parent); +    } -        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); | 
