diff --git a/include/athena/DNAYaml.hpp b/include/athena/DNAYaml.hpp index 789335e..8499153 100644 --- a/include/athena/DNAYaml.hpp +++ b/include/athena/DNAYaml.hpp @@ -1203,9 +1203,8 @@ struct DNAYaml : DNA return true; } - typedef void (DNAYaml::*YAMLWriteMemFn)(YAMLDocWriter& out) const; - - bool toYAMLStream(athena::io::IStreamWriter& fout, YAMLWriteMemFn fn) const + typedef void (DNAYaml::*YAMLWriteMemberFn)(YAMLDocWriter& out) const; + bool toYAMLStream(athena::io::IStreamWriter& fout, YAMLWriteMemberFn fn) const { YAMLDocWriter docWriter(DNATypeV()); @@ -1228,6 +1227,16 @@ struct DNAYaml : DNA return true; } + typedef void (DNAYaml::*YAMLReadMemberFn)(YAMLDocReader& in); + bool fromYAMLStream(athena::io::IStreamReader& fin, YAMLReadMemberFn fn) + { + YAMLDocReader docReader; + if (!docReader.parse(&fin)) + return false; + (this->*fn)(docReader); + return true; + } + template static bool ValidateFromYAMLStream(athena::io::IStreamReader& fin) {