ludus::content::identity_records::MigrationManifest¶
Ludus Wiki · API overview · Browse API
Class
Validated, owned migration manifest.
Documents are sorted by path and objects by legacy ID, both in byte order, so writing a manifest is deterministic. Every UUID is a nonnil version-4 value and is unique across the whole manifest. The manifest is an explicit, committed record: rebuilding it from the same sources never reproduces it, because generation mints new values. Move-only; one owner; no internal synchronization.
#include <ludus/content/identity_records/migration_manifest.h>
class ludus::content::identity_records::MigrationManifest final
Methods¶
MigrationManifest¶
ludus::content::identity_records::MigrationManifest::MigrationManifest() noexcept=default
Empty manifest that owns no storage.
MigrationManifest¶
ludus::content::identity_records::MigrationManifest::MigrationManifest(const MigrationManifest &)=delete
Copying is disabled: a manifest is a unique committed record with one owner.
operator=¶
MigrationManifest & ludus::content::identity_records::MigrationManifest::operator=(const MigrationManifest &)=delete
Copying is disabled: a manifest is a unique committed record with one owner.
Related types: MigrationManifest
MigrationManifest¶
ludus::content::identity_records::MigrationManifest::MigrationManifest(MigrationManifest &&other) noexcept=default
Transfer the tables; the source becomes empty.
operator=¶
MigrationManifest & ludus::content::identity_records::MigrationManifest::operator=(MigrationManifest &&other) noexcept=default
Transfer the tables; the source becomes empty.
Related types: MigrationManifest
~MigrationManifest¶
ludus::content::identity_records::MigrationManifest::~MigrationManifest() noexcept=default
Release both tables.
GetDocuments¶
std::span< const MigrationDocument > ludus::content::identity_records::MigrationManifest::GetDocuments() const noexcept
All documents, sorted by path. Borrowed until the manifest changes or is destroyed.
Related types: MigrationDocument
GetObjects¶
std::span< const MigrationObject > ludus::content::identity_records::MigrationManifest::GetObjects(const MigrationDocument &document) const noexcept
Objects of one document of this manifest, sorted by legacy ID. Borrowed like GetDocuments().
Related types: MigrationDocument · MigrationObject
FindDocument¶
const MigrationDocument * ludus::content::identity_records::MigrationManifest::FindDocument(std::string_view path) const noexcept
Return the document with exactly this path, or null when the manifest has none.
Related types: MigrationDocument
FindObject¶
const MigrationObject * ludus::content::identity_records::MigrationManifest::FindObject(const MigrationDocument &document, std::string_view legacyId) const noexcept
Return the object of
document with exactly this legacy ID, or null when it has none. Related types: MigrationDocument · MigrationObject
Read¶
IdentityRecordStatus ludus::content::identity_records::MigrationManifest::Read(std::string_view json, IdentityRecordError &outError) noexcept
Replace this manifest with one parsed from canonical or hand-edited JSON.
Rejects unknown or duplicate members, an unsupported
format/version, invalid paths or legacy IDs, unsorted or repeated entries, and any UUID that is not a nonnil version-4 value or that repeats anywhere in the manifest. | Parameter | Description |
|---|---|
json |
Manifest text, at most MAX_MANIFEST_BYTES.
|
outError |
Receives the failure; reset to Success on success.
|
Returns
Success, or the failure; the manifest is unchanged on failure.
Related types: IdentityRecordStatus · IdentityRecordError
Write¶
IdentityRecordStatus ludus::content::identity_records::MigrationManifest::Write(Bytes &outJson) const noexcept
Write the canonical JSON form: fixed member order, two-space indentation, trailing newline.
| Parameter | Description |
|---|---|
outJson |
Replaced on success; unchanged on failure.
|
Returns
Success, Limit or OutOfMemory.
Related types: Bytes · IdentityRecordStatus