Created
April 20, 2020 13:46
-
-
Save skejeton/0f1d22f982bf06e184dedc69f51384c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <vector> | |
namespace bn | |
{ | |
struct XMLTag | |
{ | |
std::string tagname; | |
std::vector<XMLTag*> children; | |
}; | |
class XMLResult | |
{ | |
public: | |
XMLTag *rootTag; | |
bool empty; | |
}; | |
enum XMLErrorCode | |
{ | |
TAG_MISPLACE | |
}; | |
class XMLError : public XMLResult | |
{ | |
public: | |
XMLError(std::string _desc, XMLErrorCode _code) : desc(_desc), code(_code) {} | |
std::string desc; | |
XMLErrorCode code; | |
}; | |
class XMLParser | |
{ | |
std::string parseName() | |
{ | |
} | |
XMLResult *parse(std::string *source) | |
{ | |
XMLResult *res = new XMLResult(); | |
bool xmlTagStart = false; | |
int ptr; | |
while (ptr < source->size()) | |
{ | |
if (source[ptr] == "<") | |
{ | |
if (!xmlTagStart) | |
{ | |
} | |
} | |
ptr++; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment