2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:07:42 +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

@@ -207,18 +207,20 @@ void PAKRouter<BRIDGETYPE>::build(std::vector<BRIDGETYPE>& bridges, std::functio
{
if (namedEntry.name == "holo_cinf")
continue; /* Problematic corner case */
catalogWriter.enterSubRecord(namedEntry.name.c_str());
hecl::ProjectPath working = getWorking(namedEntry.id);
if (working.getAuxInfoUTF8().size())
if (auto rec = catalogWriter.enterSubRecord(namedEntry.name.c_str()))
{
catalogWriter.enterSubVector(nullptr);
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
catalogWriter.writeString(nullptr, working.getAuxInfoUTF8().c_str());
catalogWriter.leaveSubVector();
hecl::ProjectPath working = getWorking(namedEntry.id);
if (working.getAuxInfoUTF8().size())
{
if (auto v = catalogWriter.enterSubVector(nullptr))
{
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
catalogWriter.writeString(nullptr, working.getAuxInfoUTF8().c_str());
}
}
else
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
}
else
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
catalogWriter.leaveSubRecord();
}
/* Write catalog */