4#include <unordered_map>
10 const std::string &tileset_name,
const std::vector<ArtifactKey> &artifact_keys)
const
15 std::vector<ArtifactKey> mismatched_keys;
16 for (
const auto &key : artifact_keys) {
17 const auto checksum_for_key = checksums.contains(key) ? checksums.at(key) :
"";
18 const auto cached_checksum_for_key = cached_checksums.contains(key) ? cached_checksums.at(key) :
"";
20 if (checksum_for_key != cached_checksum_for_key) {
21 mismatched_keys.push_back(key);
24 return mismatched_keys;
28 const std::string &tileset_name,
const std::vector<ArtifactKey> &artifact_keys)
const
virtual std::unordered_map< ArtifactKey, std::string > compute_tileset_artifact_checksums(const std::string &tileset_name) const =0
Computes checksums for the artifacts that belong to the given Tileset.
virtual std::vector< ArtifactKey > find_unsynced_tileset_artifacts(const std::string &tileset_name, const std::vector< ArtifactKey > &artifact_keys) const
Finds all artifacts for the given Tileset with unsynced changes compared to cached checksums.
virtual bool all_checksums_tileset_match(const std::string &tileset_name, const std::vector< ArtifactKey > &artifact_keys) const
Checks if all artifact checksums for the given Tileset match their cached values.
virtual std::unordered_map< ArtifactKey, std::string > load_cached_tileset_checksums(const std::string &tileset_name) const =0
Loads the cached checksums for the given Tileset.