Files
EchoionStandalone/include/echoion/standalone/ReleaseManifest.hpp
T
faumaray 11850b1a8d Update
Signed-off-by: faumaray <faumaray@gmail.com>
2026-07-16 19:59:57 +03:00

42 lines
1.0 KiB
C++

#pragma once
#include <Types.hpp>
#include <cstdint>
#include <filesystem>
#include <string>
#include <vector>
namespace Echoion::Standalone
{
enum class ReleaseFileType : std::uint8_t {
Regular,
Symlink,
};
struct ReleaseFileEntry {
std::filesystem::path path;
ReleaseFileType type{ReleaseFileType::Regular};
std::uintmax_t size{};
std::filesystem::perms mode{std::filesystem::perms::unknown};
std::string sha256;
std::filesystem::path target;
};
struct ReleaseManifest {
std::uint32_t schemaVersion{1};
std::string version;
std::filesystem::path root;
std::filesystem::path executable;
std::filesystem::path core;
std::string executableSha256;
std::string coreSha256;
std::vector<ReleaseFileEntry> files;
[[nodiscard]] static Api::Result<ReleaseManifest>
load(const std::filesystem::path& manifestPath);
[[nodiscard]] Api::Result<void> validate() const;
[[nodiscard]] Api::Result<void> validateInstallLayout() const;
};
} // namespace Echoion::Standalone