From f65e3d23b4e74b38ff733404c70feb6898ff66e8 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 21 Aug 2016 17:46:45 -1000 Subject: [PATCH] Athena YAML refactor --- hecl/extern/athena | 2 +- hecl/lib/CVarManager.cpp | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hecl/extern/athena b/hecl/extern/athena index b43c4af3a..cd9aa3eaf 160000 --- a/hecl/extern/athena +++ b/hecl/extern/athena @@ -1 +1 @@ -Subproject commit b43c4af3a777d6baf43a6108764648e52f3b7ea6 +Subproject commit cd9aa3eaf4904f2cbf5510a6f3a7c229f0020e34 diff --git a/hecl/lib/CVarManager.cpp b/hecl/lib/CVarManager.cpp index e4600d940..b7fc61664 100755 --- a/hecl/lib/CVarManager.cpp +++ b/hecl/lib/CVarManager.cpp @@ -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); } }