Skip to content

Instantly share code, notes, and snippets.

@skejeton
Created April 20, 2020 13:46
Show Gist options
  • Save skejeton/0f1d22f982bf06e184dedc69f51384c7 to your computer and use it in GitHub Desktop.
Save skejeton/0f1d22f982bf06e184dedc69f51384c7 to your computer and use it in GitHub Desktop.
#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