| 994 | } |
| 995 | |
| 996 | bool SerializerService::serializeGenomeToFile(std::filesystem::path const& filename, std::vector<uint8_t> const& genome) |
| 997 | { |
| 998 | try { |
| 999 | log(Priority::Important, "save genome to " + filename.string()); |
| 1000 | //wrap constructor cell around genome |
| 1001 | ClusteredDataDescription data; |
| 1002 | if (!wrapGenome(data, genome)) { |
| 1003 | return false; |
| 1004 | } |
| 1005 | |
| 1006 | zstr::ofstream stream(filename.string(), std::ios::binary); |
| 1007 | if (!stream) { |
| 1008 | return false; |
| 1009 | } |
| 1010 | serializeDataDescription(data, stream); |
| 1011 | |
| 1012 | return true; |
| 1013 | } catch (...) { |
| 1014 | return false; |
| 1015 | } |
| 1016 | } |
| 1017 | |
| 1018 | bool SerializerService::deserializeGenomeFromFile(std::vector<uint8_t>& genome, std::filesystem::path const& filename) |
| 1019 | { |