#include "athena/IStreamReader.hpp" #include "athena/IStreamWriter.hpp" #include "athena/FileWriter.hpp" #include "DGRP.hpp" namespace DataSpec::DNADGRP { template bool ExtractDGRP(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { athena::io::FileWriter writer(outPath.getAbsolutePath()); if (writer.isOpen()) { DGRP dgrp; dgrp.read(rs); athena::io::ToYAMLStream(dgrp, writer); return true; } return false; } template bool ExtractDGRP(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath); template bool ExtractDGRP(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath); template bool WriteDGRP(const DGRP& dgrp, const hecl::ProjectPath& outPath) { athena::io::FileWriter w(outPath.getAbsolutePath(), true, false); if (w.hasError()) return false; dgrp.write(w); int64_t rem = w.position() % 32; if (rem) for (int64_t i=0 ; i<32-rem ; ++i) w.writeUByte(0xff); return true; } template bool WriteDGRP(const DGRP& dgrp, const hecl::ProjectPath& outPath); template bool WriteDGRP(const DGRP& dgrp, const hecl::ProjectPath& outPath); }