2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 22:27:43 +00:00

YAML RAII refactor

This commit is contained in:
Jack Andersen
2017-02-12 13:56:03 -10:00
parent 1b8baca988
commit 748e81ae6e
29 changed files with 1314 additions and 1842 deletions

View File

@@ -12,12 +12,13 @@ static void WriteTag(athena::io::YAMLDocWriter& cacheWriter,
{
char idStr[9];
snprintf(idStr, 9, "%08X", uint32_t(pathTag.id));
cacheWriter.enterSubVector(idStr);
cacheWriter.writeString(nullptr, pathTag.type.toString().c_str());
cacheWriter.writeString(nullptr, path.getAuxInfo().size() ?
(path.getRelativePathUTF8() + '|' + path.getAuxInfoUTF8()) :
path.getRelativePathUTF8());
cacheWriter.leaveSubVector();
if (auto v = cacheWriter.enterSubVector(idStr))
{
cacheWriter.writeString(nullptr, pathTag.type.toString().c_str());
cacheWriter.writeString(nullptr, path.getAuxInfo().size() ?
(path.getRelativePathUTF8() + '|' + path.getAuxInfoUTF8()) :
path.getRelativePathUTF8());
}
}
static void WriteNameTag(athena::io::YAMLDocWriter& nameWriter,