| 30 | |
| 31 | template <typename Stream, typename Data> |
| 32 | bool SerializeDB(Stream& stream, const Data& data) |
| 33 | { |
| 34 | // Write and commit header, data |
| 35 | try { |
| 36 | HashedSourceWriter hashwriter{stream}; |
| 37 | hashwriter << Params().MessageStart() << data; |
| 38 | stream << hashwriter.GetHash(); |
| 39 | } catch (const std::exception& e) { |
| 40 | return error("%s: Serialize or I/O error - %s", __func__, e.what()); |
| 41 | } |
| 42 | |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | template <typename Data> |
| 47 | bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data& data, int version) |
no test coverage detected