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