diff options
author | crupest <crupest@outlook.com> | 2022-01-12 23:13:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 23:13:10 +0800 |
commit | 276ae73fa444c16f34a379ae9d8f58c883056b4a (patch) | |
tree | 96f4d7103976836e918b4fa1db0fdbb80777986e /include/cru/xml/XmlNode.hpp | |
parent | 01f98ce88950cdb729f5db58bf26f2fffa1c326c (diff) | |
parent | 65c799c5339ba37bea2217b168e96b15aceaef85 (diff) | |
download | cru-276ae73fa444c16f34a379ae9d8f58c883056b4a.tar.gz cru-276ae73fa444c16f34a379ae9d8f58c883056b4a.tar.bz2 cru-276ae73fa444c16f34a379ae9d8f58c883056b4a.zip |
Merge pull request #44 from crupest/dev
Windows development.
Diffstat (limited to 'include/cru/xml/XmlNode.hpp')
-rw-r--r-- | include/cru/xml/XmlNode.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/cru/xml/XmlNode.hpp b/include/cru/xml/XmlNode.hpp index cf2543c9..38f09d14 100644 --- a/include/cru/xml/XmlNode.hpp +++ b/include/cru/xml/XmlNode.hpp @@ -1,5 +1,7 @@ #pragma once +#include "Base.hpp" + #include "cru/common/String.hpp" #include <algorithm> @@ -10,7 +12,7 @@ namespace cru::xml { class XmlElementNode; class XmlTextNode; -class XmlNode { +class CRU_XML_API XmlNode { friend XmlElementNode; public: @@ -40,7 +42,7 @@ class XmlNode { XmlElementNode* parent_ = nullptr; }; -class XmlTextNode : public XmlNode { +class CRU_XML_API XmlTextNode : public XmlNode { public: XmlTextNode() : XmlNode(Type::Text) {} explicit XmlTextNode(String text) @@ -61,7 +63,7 @@ class XmlTextNode : public XmlNode { String text_; }; -class XmlElementNode : public XmlNode { +class CRU_XML_API XmlElementNode : public XmlNode { public: XmlElementNode() : XmlNode(Type::Element) {} explicit XmlElementNode(String tag, @@ -86,9 +88,9 @@ class XmlElementNode : public XmlNode { } const std::vector<XmlNode*> GetChildren() const { return children_; } - int GetChildCount() const { return children_.size(); } + Index GetChildCount() const { return children_.size(); } String GetAttribute(const String& key) const { return attributes_.at(key); } - XmlNode* GetChildAt(int index) const { return children_[index]; } + XmlNode* GetChildAt(Index index) const { return children_[index]; } void AddAttribute(String key, String value); void AddChild(XmlNode* child); |