From 21724766ba3020261e9b84155569214489e343e6 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 23 Oct 2015 12:23:04 -1000 Subject: [PATCH] added file handle accessor for file reader/writer --- include/Athena/DNAYaml.hpp | 7 +++++++ include/Athena/FileReader.hpp | 1 + include/Athena/FileWriter.hpp | 1 + 3 files changed, 9 insertions(+) diff --git a/include/Athena/DNAYaml.hpp b/include/Athena/DNAYaml.hpp index 4b7e456..a6488eb 100644 --- a/include/Athena/DNAYaml.hpp +++ b/include/Athena/DNAYaml.hpp @@ -11,6 +11,7 @@ #include #include #include "DNA.hpp" +#include "FileReader.hpp" namespace Athena { @@ -1226,6 +1227,12 @@ struct DNAYaml : DNA yaml_parser_delete(&parser); return retval; } + + template + static bool ValidateFromYAMLFile(Athena::io::FileReader& fin) + { + return ValidateFromYAMLFile(fin._fileHandle()); + } }; template diff --git a/include/Athena/FileReader.hpp b/include/Athena/FileReader.hpp index 461c1c2..bddd682 100644 --- a/include/Athena/FileReader.hpp +++ b/include/Athena/FileReader.hpp @@ -32,6 +32,7 @@ public: atUint64 readUBytesToBuf(void* buf, atUint64 len); void setCacheSize(const atInt32 blockSize); + FILE* _fileHandle() {return m_fileHandle;} protected: std::string m_filename; #if _WIN32 diff --git a/include/Athena/FileWriter.hpp b/include/Athena/FileWriter.hpp index e09c2fb..320e081 100644 --- a/include/Athena/FileWriter.hpp +++ b/include/Athena/FileWriter.hpp @@ -26,6 +26,7 @@ public: atUint64 length() const; void writeUBytes(const atUint8* data, atUint64 len); + FILE* _fileHandle() {return m_fileHandle;} private: std::string m_filename; #if _WIN32