|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
Classes | |
| struct | ChunkSpec |
| Stored form of a chunk annotation: the member's binary identity. More... | |
| class | ChunkWriter |
| Append-only chunk emission with size backpatching. More... | |
| struct | ContainerSpec |
| Stored form of container: the chunk payload is itself a chunk stream; the member is a nested chunked entity read recursively. More... | |
| struct | CountExactlySpec |
| Stored form of countExactly: the member's element count is fixed by the format (an ADT map chunk's 145 height samples). More... | |
| struct | CountMatchesSpec |
| Stored form of countMatches: when the member is engaged, its element count times scale must equal the named sibling member's count. More... | |
| struct | CountMultipleOfSpec |
| Stored form of countMultipleOf: the member's element count must be a multiple of divisor. More... | |
| struct | ExpectedValueSpec |
| Stored form of expectedValue: the (integral) data member must hold exactly this value (format-version fields). More... | |
| struct | GatedBySpec |
| Stored form of gatedBy (offset entities): the member occupies binary bytes only when the entity's globalFlags has any mask bit set. More... | |
| struct | HeaderSpec |
| Stored form of header: raw leading bytes of a container payload, memcpy'd before chunk scanning starts — not a chunk of its own. More... | |
| struct | IndexesInRootSpec |
| Stored form of indexesInRoot: every element of the (integral) vector member must be a valid index into the named member of the ASSEMBLY's root entity. More... | |
| struct | IndexesOptionalSpec |
| Stored form of indexesOptional: like indexes, but the client's "no reference" sentinel (a negative value, or the all-ones value of an unsigned element) is a legal element. More... | |
| struct | IndexesSpec |
| Stored form of indexes: every element of the (integral) vector member must be a valid index into the named sibling member. More... | |
| struct | NonemptySpec |
| Stored form of nonempty: the member must hold data for the file to be meaningful to the client, even though read() tolerates its absence. More... | |
| struct | OffsetAfterSpec |
| Stored form of offsetAfter (offset entities): the trait-base member's positional layout position — right after the named own member of the entity. More... | |
| struct | OptionalSpec |
| Stored form of optional: absence on read is not an error. More... | |
| struct | RepeatedTraits |
| Trait: is T a Repeated<U, N> (a repeats-annotated member)? More... | |
| struct | RepeatedTraits< Repeated< U, N > > |
| struct | RepeatingSpec |
| Stored form of repeating: the chunk appears once per element, any number of times (WDL MARE tiles, _mpv PVMI/PVPD/PVBD groups). More... | |
| struct | RepeatsSpec |
| Stored form of repeats: the chunk may appear up to max times. More... | |
| struct | SequenceDataSpec |
| Stored form of SequenceData (offset entities): the member's nested per-element data may live in an external buffer (M2 .anim files) — the engine resolves each outer element's base span/sink through the I/O context instead of assuming the entity's own buffer. More... | |
| struct | SinceSpec |
| Stored form of since: member active for entity versions >= v. More... | |
| struct | UntilSpec |
| Stored form of until: member active for entity versions < v. More... | |
Concepts | |
| concept | HasConvertStep |
| concept | HasValidateExtra |
| A type carrying the imperative half of its contracts (see the validateExtra hook). | |
| concept | SlotSequence |
| A container of independent SLOTS rather than one logical array — a chunk that may appear several times, each occurrence complete in itself (Repeated<>, opting in with ValidationSlots). | |
| concept | ValidatableSequence |
| A member the walker can iterate element-wise: std::vector, std::array, Repeated<> and std::string all qualify. | |
Functions | |
| consteval std::uint32_t | chunkMagicOf (std::meta::info member) |
| The chunk() fourcc of member member, or 0 if it carries none. | |
| template<typename E> | |
| consteval auto | writeOrder () |
| The member indices (into membersOf<E>) in the order fresh entities emit their chunks. | |
| std::unexpected< Error > | chunkError (ErrorCode code, std::uint32_t fourcc, std::size_t offset, std::string_view what, FourCCEndian endian=FourCCEndian::Reversed) |
| Build a chunk-scoped error value. | |
| template<typename E> | |
| consteval FourCCEndian | unknownFourccEndian () |
| The id layout to display for chunks the entity has no spec for (garbage magics, unknown chunks): the entity's declared UnknownFourccEndian when present (the forward-magic M2 file family), else the reversed common case. | |
| template<typename M> | |
| Result< void > | readValue (M &dst, std::span< const std::byte > payload, std::uint32_t fourcc, std::size_t offset, FourCCEndian endian) |
| Read one chunk payload into member dst, dispatching on the member kind (nested entity, self-serializing, array, raw binary struct). | |
| template<typename M> | |
| Result< void > | writeValue (const M &src, FileBuffer &out) |
| Append member src's chunk payload to out (payload only — the caller emits the chunk header). | |
| template<ChunkedEntity E> | |
| bool | entityEngaged (const E &entity) |
| Does a never-journaled nested entity hold anything worth a chunk? | |
| template<typename M> | |
| bool | engaged (const M &value) |
| Is the member's chunk written when it never appeared in the journal? | |
| template<ChunkedEntity E> | |
| Result< void > | readEntity (E &entity, std::span< const std::byte > data) |
| Deserialize data into entity — the engine behind ChunkedFile::read(); see that method for the full contract. | |
| template<ChunkedEntity E> | |
| Result< void > | writeEntity (const E &entity, FileBuffer &out) |
| Serialize entity, appending to out — the engine behind ChunkedFile::write(); see that method for the full contract. | |
| template<typename E> | |
| consteval std::int32_t | chunkMemberIndex (std::uint32_t magic) |
| The flattened member index (a JournalEntry::member value) of the chunk member carrying magic, or -1 when no member does. | |
| template<ChunkedEntity E> | |
| std::vector< JournalEntry > | freshJournal (const E &entity) |
| The journal a FRESH write of entity would produce: one entry per engaged (or required) chunk member in canonical write order, repeated/ repeating members expanded to one entry per element, no unknown-chunk or trailing entries. | |
| template<typename Spec, std::meta::info M> | |
| consteval std::optional< Spec > | annotation () |
| The first annotation of type Spec on reflected member M, if any. | |
| template<ClientVersion V, std::meta::info M> | |
| consteval bool | versionActive () |
| Whether member M participates for entity version V, per its since/until annotations (absent bounds mean unbounded). | |
| consteval void | collectMembers (std::meta::info type, std::vector< std::meta::info > &out) |
| Collect type's non-static data members with its public bases flattened in FIRST (recursively, declaration order) — mirroring how welder flattens a non-welded base's members into the derived binding. | |
| template<typename E> | |
| consteval auto | membersOf () |
| The reflected member list of E, public bases flattened in (see collectMembers). | |
| template<typename E> | |
| consteval std::meta::info | memberNamed (std::string_view name) |
| The reflected member of E named name (public bases flattened, like membersOf), or the null reflection when no member carries the name — how the sibling-naming annotations (countMatches, indexes, offsetAfter) resolve their target at compile time, so a typo is a static_assert at the use site rather than a silent no-op. | |
| consteval bool | nestedInStd (std::meta::info r) |
| Whether r is declared inside namespace std (at any nesting depth — libstdc++ hides types in inline namespaces like std::__cxx11). | |
| template<typename T> | |
| consteval bool | isStdType () |
| Whether T is a standard-library type (see nestedInStd). | |
| consteval bool | hasValidationAnnotation (std::meta::info member) |
| Whether member carries any validation annotation. | |
| template<typename T> | |
| consteval bool | hasValidationContent () |
| Whether validating a T can produce anything — it declares a validateExtra hook, carries an annotated member, or (recursively) holds something that does. | |
| template<typename Values> | |
| void | validateIndexElements (const Values &values, std::size_t targetCount, std::string_view member, std::string_view target, ValidationReport &report) |
| Report every element of values that is not a valid index into a targetCount-element target, capped so a corrupt file cannot flood the report. | |
| template<std::integral T> | |
| constexpr bool | isNoIndex (T value) |
| Whether value is the client's "no reference" sentinel for an index element: negative in a signed lookup, all-ones in an unsigned one (the 0xFFFF an M2 lookup table leaves in unused slots). | |
| template<typename Values> | |
| void | validateOptionalIndexElements (const Values &values, std::size_t targetCount, std::string_view member, std::string_view target, ValidationReport &report) |
| Report every non-sentinel element of values that is not a valid index into a targetCount-element target (see isNoIndex and the indexesOptional annotation); capped like validateIndexElements. | |
| void | validateCountMatches (std::size_t count, std::uint32_t scale, std::size_t targetCount, std::string_view member, std::string_view target, ValidationReport &report) |
| Apply one member's countMatches contract against its resolved sibling count (see the annotation): engaged (non-empty) values only. | |
| template<ClientVersion V, typename T> | |
| void | validateValue (const T &value, ValidationReport &report) |
| Validate one value of any shape: a versioned entity (gated by its OWN version), a plain record (gated by the enclosing V), or a sequence of either (walked element-wise, paths subscripted). | |
| template<ClientVersion V, typename T> | |
| void | validateMembers (const T &value, ValidationReport &report) |
| Walk value's annotation-declared contracts, gating members by client version V and descending into everything with validation content. | |
| template<VersionedEntity E> | |
| void | validateEntity (const E &entity, ValidationReport &report) |
| Validate a whole entity — the engine behind every validate() method; see ChunkedFile::validate() for the contract. | |
| template<std::size_t N> | |
| consteval std::size_t | indexOf (const std::array< ClientVersion, N > &versions, ClientVersion v) |
| template<template< ClientVersion > class E> | |
| consteval ClientVersion | nextCanonical (ClientVersion from, ClientVersion to) |
| The next CANONICAL version on E's ladder walking from from toward to — the first range boundary crossed in that direction. | |
Variables | |
| template<typename T> | |
| constexpr bool | IsVectorV = false |
| Trait: is T a std::vector (an array-chunk member)? | |
| template<typename U, typename A> | |
| constexpr bool | IsVectorV< std::vector< U, A > > = true |
|
consteval |
The first annotation of type Spec on reflected member M, if any.
| Spec | the annotation payload type (a *_spec struct). |
| M | the reflected member. |
Definition at line 32 of file entity_reflect.hpp.
Referenced by wowlib::formats::m2::M2OffsetBlock< Derived >::_memberPresent(), wowlib::formats::m2::M2OffsetBlock< Derived >::_readMembers(), wowlib::formats::m2::M2OffsetBlock< Derived >::_writeMembers(), entityEngaged(), freshJournal(), wowlib::formats::m2::layoutSize(), wowlib::formats::m2::M2OffsetBlock< Derived >::memberOffset(), wowlib::formats::adt::detail::ADT< V >::parseFile(), readEntity(), wowlib::formats::adt::detail::MapChunk< V >::readFrom(), wowlib::formats::wmo::detail::WMO< V >::validate(), validateMembers(), versionActive(), writeEntity(), wowlib::formats::adt::detail::ADT< V >::writeFile(), and wowlib::formats::adt::detail::MapChunk< V >::writeTo().
|
inline |
Build a chunk-scoped error value.
| code | the error category. |
| fourcc | the chunk id the error occurred in. |
| offset | the chunk's byte offset in the buffer being read. |
| what | the failure description. |
| endian | how the id is laid out on disk (matched members pass their declared layout; unknown-chunk paths default to reversed, the common case). |
Definition at line 289 of file chunked_file.hpp.
References wowlib::formats::fourcc(), wowlib::formats::fourccToString(), wowlib::makeError(), and wowlib::formats::Reversed.
Referenced by readEntity(), and readValue().
|
consteval |
The chunk() fourcc of member member, or 0 if it carries none.
Definition at line 248 of file chunked_file.hpp.
Referenced by chunkMemberIndex(), and writeOrder().
|
consteval |
The flattened member index (a JournalEntry::member value) of the chunk member carrying magic, or -1 when no member does.
For entity code that builds journal entries by fourcc (resequencedJournal hooks).
| E | the entity type. |
| magic | the chunk id (see fourCc()). |
Definition at line 630 of file chunked_file.hpp.
References chunkMagicOf(), chunkMemberIndex(), and membersOf().
Referenced by chunkMemberIndex(), wowlib::formats::wdl::detail::WDL< V >::oceanMaskTiles(), and wowlib::formats::wdl::detail::WDL< V >::resequencedJournal().
|
consteval |
Collect type's non-static data members with its public bases flattened in FIRST (recursively, declaration order) — mirroring how welder flattens a non-welded base's members into the derived binding.
Lets a versioned entity carry its version-gated chunk members in conditionally-inherited trait bases (present only for the versions they belong to) while the serializer still sees them. Base bookkeeping members (ChunkExtras: journal/unknown/trailing) come along but carry no chunk() annotation, so every chunk loop skips them.
| type | the reflected class to walk. |
| out | the member list being built. |
Definition at line 64 of file entity_reflect.hpp.
References collectMembers().
Referenced by collectMembers(), and membersOf().
| bool wowlib::formats::detail::engaged | ( | const M & | value | ) |
Is the member's chunk written when it never appeared in the journal?
Required chunks always write (clients ship size-0 required chunks); optional ones only when they hold data. A plain data-chunk member's engagement is not observable — it always writes, so optional plain data chunks must not be declared (single-record optional chunks like MDAL are modeled as vectors instead).
| value | the member value. |
Definition at line 346 of file chunked_file.hpp.
References entityEngaged(), IsVectorV, and wowlib::formats::detail::RepeatedTraits< T >::Value.
Referenced by freshJournal().
| bool wowlib::formats::detail::entityEngaged | ( | const E & | entity | ) |
Does a never-journaled nested entity hold anything worth a chunk?
An entity that came from a file has a journal; a fresh one engages once any of its container-shaped members (or nested entities) hold data. Plain data-chunk members do not engage a container by themselves — their content is not distinguishable from the default.
| entity | the nested entity. |
Definition at line 677 of file chunked_file.hpp.
References annotation(), entityEngaged(), IsVectorV, membersOf(), wowlib::formats::detail::RepeatedTraits< T >::Value, and versionActive().
Referenced by engaged(), entityEngaged(), and wowlib::formats::wdt::detail::WDT< V >::write().
| std::vector< JournalEntry > wowlib::formats::detail::freshJournal | ( | const E & | entity | ) |
The journal a FRESH write of entity would produce: one entry per engaged (or required) chunk member in canonical write order, repeated/ repeating members expanded to one entry per element, no unknown-chunk or trailing entries.
The starting point for a resequencedJournal hook, which reorders it (and re-appends the preserved unknown chunks) before handing it to writeEntity.
| entity | the entity to enumerate. |
Definition at line 646 of file chunked_file.hpp.
References annotation(), engaged(), freshJournal(), membersOf(), wowlib::formats::detail::RepeatedTraits< T >::Value, versionActive(), and writeOrder().
Referenced by freshJournal(), and wowlib::formats::wdl::detail::WDL< V >::resequencedJournal().
|
consteval |
Whether member carries any validation annotation.
Definition at line 228 of file validation.hpp.
Referenced by hasValidationContent().
|
consteval |
Whether validating a T can produce anything — it declares a validateExtra hook, carries an annotated member, or (recursively) holds something that does.
Drives where the walk descends, so an entity pays no runtime cost for members with no contracts at all.
Trivially-copyable types stop the recursion: binary structs carry no annotations by policy (their contracts live in the enclosing entity's hook), and scalars have none to carry. Standard-library class types stop it too — their internals are not our records — but sequences are followed into their element type first, so std::vector<M2Bone> is walked while std::string is not.
| T | the member or record type to classify. |
Definition at line 258 of file validation.hpp.
References hasValidationAnnotation(), hasValidationContent(), isStdType(), and membersOf().
Referenced by hasValidationContent(), validateMembers(), and validateValue().
|
consteval |
Definition at line 55 of file convert.hpp.
Referenced by wowlib::formats::convert(), wowlib::formats::hasConvertPath(), and nextCanonical().
|
constexpr |
Whether value is the client's "no reference" sentinel for an index element: negative in a signed lookup, all-ones in an unsigned one (the 0xFFFF an M2 lookup table leaves in unused slots).
| value | the index element. |
Definition at line 315 of file validation.hpp.
Referenced by validateOptionalIndexElements(), and wowlib::formats::m2::detail::validateProfileAgainstRoot().
|
consteval |
Whether T is a standard-library type (see nestedInStd).
| T | the type to classify. |
Definition at line 115 of file entity_reflect.hpp.
References nestedInStd().
Referenced by hasValidationContent().
|
consteval |
The reflected member of E named name (public bases flattened, like membersOf), or the null reflection when no member carries the name — how the sibling-naming annotations (countMatches, indexes, offsetAfter) resolve their target at compile time, so a typo is a static_assert at the use site rather than a silent no-op.
| E | the entity type. |
| name | the member identifier to find. |
Definition at line 91 of file entity_reflect.hpp.
References membersOf().
Referenced by wowlib::formats::wmo::detail::WMO< V >::validate(), and validateMembers().
|
consteval |
The reflected member list of E, public bases flattened in (see collectMembers).
Stable order, so the journal's member index is consistent between read and write.
| E | the entity type. |
Definition at line 76 of file entity_reflect.hpp.
References collectMembers().
Referenced by wowlib::formats::m2::M2OffsetBlock< Derived >::_memberOrder(), wowlib::formats::m2::M2OffsetBlock< Derived >::_readMembers(), wowlib::formats::m2::M2OffsetBlock< Derived >::_writeMembers(), chunkMemberIndex(), entityEngaged(), freshJournal(), hasValidationContent(), wowlib::formats::m2::M2OffsetBlock< Derived >::imageSize(), wowlib::formats::m2::layoutSize(), memberNamed(), wowlib::formats::m2::M2OffsetBlock< Derived >::memberOffset(), wowlib::formats::adt::detail::ADT< V >::parseFile(), readEntity(), wowlib::formats::adt::detail::MapChunk< V >::readFrom(), wowlib::formats::wmo::detail::WMO< V >::validate(), validateMembers(), writeEntity(), wowlib::formats::adt::detail::ADT< V >::writeFile(), writeOrder(), and wowlib::formats::adt::detail::MapChunk< V >::writeTo().
|
consteval |
Whether r is declared inside namespace std (at any nesting depth — libstdc++ hides types in inline namespaces like std::__cxx11).
The validation walker stops there: standard-library internals are not our records, and reflecting into them would walk implementation details.
| r | the reflected entity (typically a type). |
Definition at line 103 of file entity_reflect.hpp.
Referenced by isStdType().
|
consteval |
The next CANONICAL version on E's ladder walking from from toward to — the first range boundary crossed in that direction.
Definition at line 71 of file convert.hpp.
References wowlib::formats::canonicalVersion(), indexOf(), wowlib::formats::SupportedVersions, and wowlib::formats::VersionPivots.
Referenced by wowlib::formats::convert(), and wowlib::formats::hasConvertPath().
| Result< void > wowlib::formats::detail::readEntity | ( | E & | entity, |
| std::span< const std::byte > | data ) |
Deserialize data into entity — the engine behind ChunkedFile::read(); see that method for the full contract.
| entity | the destination entity; overwritten member-by-member. |
| data | the file (or container-chunk payload) bytes. |
Definition at line 396 of file chunked_file.hpp.
References annotation(), chunkError(), wowlib::ChunkMissing, wowlib::ChunkTruncated, wowlib::formats::fourcc(), wowlib::formats::fourccToString(), IsVectorV, wowlib::makeError(), membersOf(), readValue(), unknownFourccEndian(), wowlib::formats::detail::RepeatedTraits< T >::Value, and versionActive().
Referenced by wowlib::formats::ChunkedFile< Derived >::read(), and readValue().
| Result< void > wowlib::formats::detail::readValue | ( | M & | dst, |
| std::span< const std::byte > | payload, | ||
| std::uint32_t | fourcc, | ||
| std::size_t | offset, | ||
| FourCCEndian | endian ) |
Read one chunk payload into member dst, dispatching on the member kind (nested entity, self-serializing, array, raw binary struct).
| dst | the destination member. |
| payload | the chunk payload bytes. |
| fourcc | the chunk id (for diagnostics). |
| offset | the chunk's byte offset (for diagnostics). |
| endian | the chunk id's disk layout (for diagnostics). |
Definition at line 694 of file chunked_file.hpp.
References chunkError(), wowlib::ChunkSizeMismatch, wowlib::formats::fourcc(), IsVectorV, readEntity(), and readValue().
Referenced by wowlib::formats::adt::detail::ADT< V >::parseFile(), readEntity(), wowlib::formats::adt::detail::MapChunk< V >::readFrom(), and readValue().
|
consteval |
The id layout to display for chunks the entity has no spec for (garbage magics, unknown chunks): the entity's declared UnknownFourccEndian when present (the forward-magic M2 file family), else the reversed common case.
| E | the chunked entity. |
Definition at line 304 of file chunked_file.hpp.
References wowlib::formats::Reversed.
Referenced by readEntity().
|
inline |
Apply one member's countMatches contract against its resolved sibling count (see the annotation): engaged (non-empty) values only.
| count | the member's element count. |
| scale | the annotation's scale factor. |
| targetCount | the sibling's element count. |
| member | the checked member's path (for the findings). |
| target | the sibling's name (for the findings). |
| report | the report findings land in. |
Definition at line 363 of file validation.hpp.
References wowlib::formats::ValidationReport::addError().
Referenced by validateMembers().
| void wowlib::formats::detail::validateEntity | ( | const E & | entity, |
| ValidationReport & | report ) |
Validate a whole entity — the engine behind every validate() method; see ChunkedFile::validate() for the contract.
| entity | the entity to check. |
| report | the report findings land in. |
Definition at line 568 of file validation.hpp.
References validateValue().
Referenced by wowlib::formats::adt::detail::ADT< V >::validate(), wowlib::formats::ChunkedFile< Derived >::validate(), wowlib::formats::m2::detail::M2< V >::validate(), wowlib::formats::m2::M2OffsetBlock< Derived >::validate(), wowlib::formats::wdt::detail::WDT< V >::validate(), and wowlib::formats::wmo::detail::WMO< V >::validate().
| void wowlib::formats::detail::validateIndexElements | ( | const Values & | values, |
| std::size_t | targetCount, | ||
| std::string_view | member, | ||
| std::string_view | target, | ||
| ValidationReport & | report ) |
Report every element of values that is not a valid index into a targetCount-element target, capped so a corrupt file cannot flood the report.
| values | the index elements to check. |
| targetCount | the indexed member's element count. |
| member | the checked member's path (for the findings). |
| target | the indexed member's name (for the findings). |
| report | the report findings land in. |
Definition at line 288 of file validation.hpp.
References wowlib::formats::ValidationReport::addError().
Referenced by wowlib::formats::adt::detail::ADT< V >::validate(), wowlib::formats::wmo::detail::WMO< V >::validate(), wowlib::formats::wmo::group::detail::WMOGroupBody< canonicalVersion(V, WmoGroupPivots, WmoVersions)>::validateExtra(), validateMembers(), and wowlib::formats::m2::detail::validateProfileAgainstRoot().
| void wowlib::formats::detail::validateMembers | ( | const T & | value, |
| ValidationReport & | report ) |
Walk value's annotation-declared contracts, gating members by client version V and descending into everything with validation content.
The caller adds the validateExtra hook (see validateValue).
| V | the governing client version — the enclosing entity's, so records inherit the version gating of the file they sit in. |
| value | the entity or record to check. |
| report | the report findings land in. |
Definition at line 391 of file validation.hpp.
References wowlib::formats::ValidationReport::addError(), annotation(), wowlib::formats::ValidationReport::full(), hasValidationContent(), IsVectorV, memberNamed(), membersOf(), validateCountMatches(), validateIndexElements(), validateOptionalIndexElements(), validateValue(), and versionActive().
Referenced by validateValue().
| void wowlib::formats::detail::validateOptionalIndexElements | ( | const Values & | values, |
| std::size_t | targetCount, | ||
| std::string_view | member, | ||
| std::string_view | target, | ||
| ValidationReport & | report ) |
Report every non-sentinel element of values that is not a valid index into a targetCount-element target (see isNoIndex and the indexesOptional annotation); capped like validateIndexElements.
| values | the index elements to check. |
| targetCount | the indexed member's element count. |
| member | the checked member's path (for the findings). |
| target | the indexed member's name (for the findings). |
| report | the report findings land in. |
Definition at line 331 of file validation.hpp.
References wowlib::formats::ValidationReport::addError(), and isNoIndex().
Referenced by wowlib::formats::m2::detail::M2< V >::validate(), and validateMembers().
| void wowlib::formats::detail::validateValue | ( | const T & | value, |
| ValidationReport & | report ) |
Validate one value of any shape: a versioned entity (gated by its OWN version), a plain record (gated by the enclosing V), or a sequence of either (walked element-wise, paths subscripted).
Types with no validation content cost nothing — the walk is compiled out.
| V | the enclosing entity's client version. |
| value | the value to check. |
| report | the report findings land in. |
Definition at line 541 of file validation.hpp.
References wowlib::formats::ValidationReport::full(), hasValidationContent(), validateMembers(), and validateValue().
Referenced by validateEntity(), validateMembers(), and validateValue().
|
consteval |
Whether member M participates for entity version V, per its since/until annotations (absent bounds mean unbounded).
| V | the entity's client version. |
| M | the reflected member. |
Definition at line 43 of file entity_reflect.hpp.
References annotation().
Referenced by wowlib::formats::m2::M2OffsetBlock< Derived >::_readMembers(), wowlib::formats::m2::M2OffsetBlock< Derived >::_writeMembers(), entityEngaged(), freshJournal(), wowlib::formats::m2::M2OffsetBlock< Derived >::imageSize(), wowlib::formats::m2::layoutSize(), wowlib::formats::m2::M2OffsetBlock< Derived >::memberOffset(), readEntity(), validateMembers(), and writeEntity().
| Result< void > wowlib::formats::detail::writeEntity | ( | const E & | entity, |
| FileBuffer & | out ) |
Serialize entity, appending to out — the engine behind ChunkedFile::write(); see that method for the full contract.
| entity | the entity to serialize. |
| out | the destination buffer (appended, not cleared). |
Definition at line 499 of file chunked_file.hpp.
References annotation(), wowlib::formats::detail::ChunkWriter::append(), wowlib::formats::detail::ChunkWriter::beginChunk(), wowlib::ChunkSizeMismatch, wowlib::formats::detail::ChunkWriter::endChunk(), wowlib::formats::fourccToString(), wowlib::makeError(), membersOf(), wowlib::formats::detail::RepeatedTraits< T >::Value, versionActive(), and writeValue().
Referenced by wowlib::formats::ChunkedFile< Derived >::write(), and writeValue().
|
consteval |
The member indices (into membersOf<E>) in the order fresh entities emit their chunks.
When E declares a canonical ChunkOrder (a static array of fourccs — needed once an entity's chunk members are scattered across conditionally-inherited trait bases, whose flatten order is by-trait, not canonical), the chunk members follow it; otherwise members keep their declaration/flatten order. A ChunkOrder must list every chunk member exactly once (asserted).
Definition at line 261 of file chunked_file.hpp.
References chunkMagicOf(), and membersOf().
Referenced by freshJournal().
| Result< void > wowlib::formats::detail::writeValue | ( | const M & | src, |
| FileBuffer & | out ) |
Append member src's chunk payload to out (payload only — the caller emits the chunk header).
| src | the member to serialize. |
| out | the destination buffer. |
Definition at line 728 of file chunked_file.hpp.
References wowlib::formats::detail::ChunkWriter::append(), IsVectorV, writeEntity(), and writeValue().
Referenced by writeEntity(), wowlib::formats::adt::detail::ADT< V >::writeFile(), wowlib::formats::adt::detail::MapChunk< V >::writeTo(), and writeValue().
|
inlineconstexpr |
Trait: is T a std::vector (an array-chunk member)?
Definition at line 51 of file entity_reflect.hpp.
Referenced by engaged(), entityEngaged(), readEntity(), readValue(), validateMembers(), and writeValue().
|
inlineconstexpr |
Definition at line 53 of file entity_reflect.hpp.