Athena YAML refactor

This commit is contained in:
Jack Andersen 2016-08-21 17:46:45 -10:00
parent 67bb64e7dd
commit f65e3d23b4
2 changed files with 7 additions and 9 deletions

2
hecl/extern/athena vendored

@ -1 +1 @@
Subproject commit b43c4af3a777d6baf43a6108764648e52f3b7ea6
Subproject commit cd9aa3eaf4904f2cbf5510a6f3a7c229f0020e34

View File

@ -105,10 +105,9 @@ void CVarManager::deserialize(CVar* cvar)
filename += _S(".yaml");
if (hecl::Stat(filename.c_str(), &st) || !S_ISREG(st.st_mode))
return;
FILE* f = hecl::Fopen(filename.c_str(), _S("rb"));
if (f)
container.fromYAMLFile(f);
fclose(f);
athena::io::FileReader reader(filename);
if (reader.isOpen())
container.fromYAMLStream(reader);
}
@ -163,10 +162,9 @@ void CVarManager::serialize()
else
{
filename += _S(".yaml");
FILE* f = hecl::Fopen(filename.c_str(), _S("wb"));
if (f)
container.toYAMLFile(f);
fclose(f);
athena::io::FileWriter writer(filename);
if (writer.isOpen())
container.toYAMLStream(writer);
}
}