Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
Athena YAML refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jackoalan committed Aug 22, 2016
1 parent 3bc81a3 commit 9b9dae6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion extern/athena
14 changes: 6 additions & 8 deletions lib/CVarManager.cpp
Expand Up @@ -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);
}


Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 9b9dae6

Please sign in to comment.