AssetManifest class

Public types

struct Sidecar
struct ScanReport
enum class SidecarState: uint8_t { Ok, Missing, Legacy, Invalid }

Public static variables

static const char* kSidecarExtension constexpr
static const char* kBakedFileName constexpr

Public static functions

static auto ReadSidecar(const std::string& sidecarPath, const std::string& relativePath, Sidecar& out) -> SidecarState
static auto WriteSidecar(const std::string& sidecarPath, const Sidecar& sidecar) -> bool
static auto NormalizePath(const std::string& path) -> std::string
Content-relative path in the stored form: generic ('/') separators.
static auto DeriveUUID(const AssetGuid& guid) -> int64_t
Derived runtime UUID for a GUID: bit 47 set (built-in IDs keep it clear), 39 hashed bits.
static auto Bake(const std::string& contentRoot, const std::string& outPath, const AssetManifest* previousRelease, ScanReport* report = nullptr) -> bool
Scan + AssignIDs against previousRelease (may be null) + SaveBaked. The cook step's entry point.

Public functions

auto Scan(const std::string& contentRoot) -> ScanReport
Collect every asset under contentRoot that has a sidecar. Entries are sorted by path.
void Add(const AssetGuid& guid, AssetType type, const std::string& relativePath, const std::string& name = {})
Add or replace one entry (the editor importing a new asset). Call AssignIDs afterwards.
void AssignIDs(const AssetManifest* frozen = nullptr, int64_t(*)(const AssetGuid&) derive = &DeriveUUID)
auto SaveBaked(const std::string& path) const -> bool
auto LoadBaked(const std::string& path) -> bool
auto GetEntries() const -> const std::vector<AssetManifestEntry>&
auto FindByGuid(const AssetGuid& guid) const -> const AssetManifestEntry*
auto FindByPath(const std::string& relativePath) const -> const AssetManifestEntry*
void Clear()
void PublishTo(AssetRegistry& registry) const
Register every entry with the runtime registry.

Enum documentation

enum class AssetManifest::SidecarState: uint8_t

Enumerators
Ok

current text format

Missing

no sidecar: the asset has never been imported

Legacy

pre-GUID binary sidecar; GUID derived deterministically from it, rewrite to migrate

Invalid

unreadable

Function documentation

void AssetManifest::AssignIDs(const AssetManifest* frozen = nullptr, int64_t(*)(const AssetGuid&) derive = &DeriveUUID)

Resolve AssetIDs. Entries found in frozen (same GUID and type) keep its ID; the rest derive from their GUID, and on a collision probe forward in GUID order — deterministic for a given content set. derive is replaceable for tests.