aboutsummaryrefslogtreecommitdiff
path: root/src/xml/XmlNode.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-02 18:59:43 +0800
committercrupest <crupest@outlook.com>2022-01-02 18:59:43 +0800
commitda3098abe8377a4b7e1d5b00e41af48cccc5696e (patch)
tree4caf637eb71ea4f4e98d96e6abb8127ffde6ac3d /src/xml/XmlNode.cpp
parent18099ad8f5c24b1c2b1c92238dbc54912eab0406 (diff)
downloadcru-da3098abe8377a4b7e1d5b00e41af48cccc5696e.tar.gz
cru-da3098abe8377a4b7e1d5b00e41af48cccc5696e.tar.bz2
cru-da3098abe8377a4b7e1d5b00e41af48cccc5696e.zip
...
Diffstat (limited to 'src/xml/XmlNode.cpp')
-rw-r--r--src/xml/XmlNode.cpp15
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;