Add tag finder functions

To find each individual tag quickly, to optimize levels list loading.

I opted to not read the tags <Created>, <Modified>, and <Modifiers> as
they're actually pretty useless.

Also I've added a tag finder for <MetaData> but it's not meant to be
used directly, it's only used to check that the tag exists.
This commit is contained in:
Misa 2020-04-17 15:06:42 -07:00 committed by Ethan Lee
parent b4f56d39d7
commit 9aeb9ad739
1 changed files with 17 additions and 0 deletions

View File

@ -153,6 +153,23 @@ std::string find_tag(const std::string& buf, const std::string& start, const std
return value;
}
#define TAG_FINDER(NAME, TAG) \
std::string NAME(const std::string& buf) \
{ \
return find_tag(buf, "<" TAG ">", "</" TAG ">"); \
}
TAG_FINDER(find_metadata, "MetaData"); //only for checking that it exists
TAG_FINDER(find_creator, "Creator");
TAG_FINDER(find_title, "Title");
TAG_FINDER(find_desc1, "Desc1");
TAG_FINDER(find_desc2, "Desc2");
TAG_FINDER(find_desc3, "Desc3");
TAG_FINDER(find_website, "website");
#undef TAG_FINDER
void editorclass::getDirectoryData()
{