diff options
author | crupest <crupest@outlook.com> | 2021-12-31 00:26:55 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-12-31 00:26:55 +0800 |
commit | 4e92e8709b30c385e1a88d7d4f76c50ee4a3d736 (patch) | |
tree | 2720fa8b17a9108617e54063b4fd06db7b28dbcb /src/xml/XmlParser.cpp | |
parent | aa923364615b77e152d532b021fe1536fcf96a50 (diff) | |
download | cru-4e92e8709b30c385e1a88d7d4f76c50ee4a3d736.tar.gz cru-4e92e8709b30c385e1a88d7d4f76c50ee4a3d736.tar.bz2 cru-4e92e8709b30c385e1a88d7d4f76c50ee4a3d736.zip |
...
Diffstat (limited to 'src/xml/XmlParser.cpp')
-rw-r--r-- | src/xml/XmlParser.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
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 |