// Copyright 2019 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include #include #include #include #include #include #include "Common/CommonTypes.h" // Refer to docs/autoupdate_overview.md for a detailed overview of the autoupdate process struct Manifest { using Filename = std::string; using Hash = std::array; std::map entries; }; // Represent the operations to be performed by the updater. struct TodoList { struct DownloadOp { Manifest::Filename filename; Manifest::Hash hash{}; }; std::vector to_download; struct UpdateOp { Manifest::Filename filename; std::optional old_hash; Manifest::Hash new_hash{}; }; std::vector to_update; struct DeleteOp { Manifest::Filename filename; Manifest::Hash old_hash{}; }; std::vector to_delete; void Log() const; }; void LogToFile(const char* fmt, ...); std::string HexEncode(const u8* buffer, size_t size); Manifest::Hash ComputeHash(const std::string& contents); bool RunUpdater(std::vector args);