diff options
author | crupest <crupest@outlook.com> | 2022-01-02 18:59:43 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-01-02 18:59:43 +0800 |
commit | da3098abe8377a4b7e1d5b00e41af48cccc5696e (patch) | |
tree | 4caf637eb71ea4f4e98d96e6abb8127ffde6ac3d /src/xml | |
parent | 18099ad8f5c24b1c2b1c92238dbc54912eab0406 (diff) | |
download | cru-da3098abe8377a4b7e1d5b00e41af48cccc5696e.tar.gz cru-da3098abe8377a4b7e1d5b00e41af48cccc5696e.tar.bz2 cru-da3098abe8377a4b7e1d5b00e41af48cccc5696e.zip |
...
Diffstat (limited to 'src/xml')
-rw-r--r-- | src/xml/XmlNode.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/xml/XmlNode.cpp b/src/xml/XmlNode.cpp index d6203973..51a861fa 100644 --- a/src/xml/XmlNode.cpp +++ b/src/xml/XmlNode.cpp @@ -1,6 +1,21 @@ #include "cru/xml/XmlNode.hpp" namespace cru::xml { + +XmlElementNode* XmlNode::AsElement() { + return static_cast<XmlElementNode*>(this); +} + +XmlTextNode* XmlNode::AsText() { return static_cast<XmlTextNode*>(this); } + +const XmlElementNode* XmlNode::AsElement() const { + return static_cast<const XmlElementNode*>(this); +} + +const XmlTextNode* XmlNode::AsText() const { + return static_cast<const XmlTextNode*>(this); +} + XmlElementNode::~XmlElementNode() { for (auto child : children_) { delete child; |