mirror of https://github.com/libAthena/athena.git
Add PTMF YAML reader to go along with writer
This commit is contained in:
parent
779e741a91
commit
d3d63082d0
|
@ -1203,9 +1203,8 @@ struct DNAYaml : DNA<DNAE>
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (DNAYaml::*YAMLWriteMemFn)(YAMLDocWriter& out) const;
|
typedef void (DNAYaml::*YAMLWriteMemberFn)(YAMLDocWriter& out) const;
|
||||||
|
bool toYAMLStream(athena::io::IStreamWriter& fout, YAMLWriteMemberFn fn) const
|
||||||
bool toYAMLStream(athena::io::IStreamWriter& fout, YAMLWriteMemFn fn) const
|
|
||||||
{
|
{
|
||||||
YAMLDocWriter docWriter(DNATypeV());
|
YAMLDocWriter docWriter(DNATypeV());
|
||||||
|
|
||||||
|
@ -1228,6 +1227,16 @@ struct DNAYaml : DNA<DNAE>
|
||||||
return true;
|
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<class DNASubtype>
|
template<class DNASubtype>
|
||||||
static bool ValidateFromYAMLStream(athena::io::IStreamReader& fin)
|
static bool ValidateFromYAMLStream(athena::io::IStreamReader& fin)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue