From 4e92e8709b30c385e1a88d7d4f76c50ee4a3d736 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 31 Dec 2021 00:26:55 +0800 Subject: ... --- src/xml/XmlParser.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/xml/XmlParser.cpp (limited to 'src/xml/XmlParser.cpp') diff --git a/src/xml/XmlParser.cpp b/src/xml/XmlParser.cpp new file mode 100644 index 00000000..23407d11 --- /dev/null +++ b/src/xml/XmlParser.cpp @@ -0,0 +1,27 @@ +#include "cru/xml/XmlParser.hpp" + +namespace cru::xml { +XmlNode XmlParser::Parse() { + if (!root_node_) { + root_node_ = DoParse(); + } + return *root_node_; +} + +XmlNode XmlParser::DoParse() { + XmlNode root(XmlNode::Type::Element); + XmlNode* current = &root; + int current_position = 0; + + // TODO: Implement this. + while (current_position < xml_.size()) { + switch (xml_[current_position]) { + case '<': { + break; + } + } + } + + return root; +} +} // namespace cru::xml -- cgit v1.2.3