|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
Classes | |
| class | BitReader |
| A bounds-guarded little-endian bit reader over a record's byte span. More... | |
| class | BitWriter |
| A little-endian bit writer over a record buffer — the encode counterpart of BitReader. More... | |
| struct | Wdc1Header |
| The 84-byte WDC1 top header. More... | |
| struct | Wdc3Header |
| The 72-byte WDC3 top header (WDC4 reuses it verbatim; WDC5 prepends Wdc5HeaderPrefix in front of the fields after magic). More... | |
| struct | Wdc3SectionHeader |
| The 40-byte per-section header of WDC3/WDC4/WDC5. More... | |
| struct | Wdc5HeaderPrefix |
| The 132 bytes WDC5 splices between magic and recordCount: a numeric schema version and a zero-padded schema-name string (e.g. More... | |
| struct | WdcFieldStorage |
| The 24-byte field_storage_info entry: how one column is stored. More... | |
| struct | WdcFieldStructure |
| The 4-byte fieldStructure entry: (32 - size) / 8 is the field's storage byte width, position its byte offset in a record. More... | |
| struct | WdcImage |
| A parsed WDC-family file: the (normalized) header, shared tables, and located sections. More... | |
| struct | WdcSection |
| A located, structurally-validated section. More... | |
Enumerations | |
| enum | WdcFlags : std::uint16_t { WdcFlagSparse = 0x01 , WdcFlagSecondary = 0x02 , WdcFlagNoninlineId = 0x04 } |
| WDC header flag bits (shared by the whole family). More... | |
| enum class | WdcCompression : std::uint32_t { None = 0 , Bitpacked = 1 , CommonData = 2 , Pallet = 3 , PalletArray = 4 , BitpackedSigned = 5 } |
| How a column is packed (field_storage_info.storageType). More... | |
| enum class | StringRefMode : std::uint8_t { BlockRelative , FieldRelative } |
| How a record's string-reference fields address the string data. More... | |
Functions | |
| constexpr bool | isWdcMagic (std::uint32_t magic) |
| Whether magic names a format of the WDC family this codec speaks. | |
| Result< void > | readWdc (const TableInfo &info, std::span< const std::byte > data, RecordSink &sink, TableState &state) |
| Decode a WDC-family image onto the schema: every unencrypted section's records (inline fields via their compression kind, the id from the idList / an inline column / the sparse offset map, strings via the flavor's reference convention), relationship-map values onto the non-inline relation column, and copy-table rows as id-cloned records. | |
| Result< FileBuffer > | writeWdc (std::uint32_t magic, const TableInfo &info, const RecordSource &source, const TableState &state, EncryptedPolicy policy) |
| Encode a canonical image of flavor magic: one unencrypted section, integers bitpacked to their minimum width, floats/string references byte-aligned, pallet/common reproduced from the original compression, a re-derived copy table, and a relationship map when the schema carries a non-inline relation column. | |
Variables | |
| constexpr std::uint32_t | Wdc1Magic = formats::fourcc("WDC1", formats::FourCCEndian::Forward) |
| The WDC1 magic as memcpy'd off the file front (the bytes "WDC1"). | |
| constexpr std::uint32_t | Wdc3Magic = formats::fourcc("WDC3", formats::FourCCEndian::Forward) |
| The WDC3 magic as memcpy'd off the file front (the bytes "WDC3"). | |
| constexpr std::uint32_t | Wdc4Magic = formats::fourcc("WDC4", formats::FourCCEndian::Forward) |
| The WDC4 magic as memcpy'd off the file front (the bytes "WDC4"). | |
| constexpr std::uint32_t | Wdc5Magic = formats::fourcc("WDC5", formats::FourCCEndian::Forward) |
| The WDC5 magic as memcpy'd off the file front (the bytes "WDC5"). | |
|
strong |
|
strong |
How a column is packed (field_storage_info.storageType).
Definition at line 152 of file binary.hpp.
| enum wowlib::db::wdc::WdcFlags : std::uint16_t |
WDC header flag bits (shared by the whole family).
Definition at line 52 of file binary.hpp.
|
constexpr |
Whether magic names a format of the WDC family this codec speaks.
| magic | the file's leading four bytes. |
Definition at line 47 of file binary.hpp.
References Wdc1Magic, Wdc3Magic, Wdc4Magic, and Wdc5Magic.
Referenced by wowlib::db::TableCore::read().
| Result< void > wowlib::db::wdc::readWdc | ( | const TableInfo & | info, |
| std::span< const std::byte > | data, | ||
| RecordSink & | sink, | ||
| TableState & | state ) |
Decode a WDC-family image onto the schema: every unencrypted section's records (inline fields via their compression kind, the id from the idList / an inline column / the sparse offset map, strings via the flavor's reference convention), relationship-map values onto the non-inline relation column, and copy-table rows as id-cloned records.
Encrypted sections are reported (state.encrypted) but not decoded, and the raw image is kept for a verbatim re-emit.
| info | the table identity + schema. |
| data | the whole file content (any WDC flavor; the magic decides). |
| sink | the decode target. |
| state | the preserved-state store. |
Definition at line 390 of file read.cpp.
References wowlib::builds::Cata, wowlib::db::RecordSink::clear(), wowlib::db::TableState::encrypted, wowlib::db::wdc::Wdc3Header::fieldCount, wowlib::db::wdc::WdcImage::fieldStorage, wowlib::db::wdc::WdcImage::header, wowlib::db::detail::inlineColumnCount(), wowlib::db::wdc::Wdc3Header::layoutHash, wowlib::db::wdc::Wdc3Header::locale, wowlib::db::wdc::WdcImage::magic, wowlib::ClientVersion::major, wowlib::makeError(), wowlib::ClientVersion::minor, wowlib::db::TableInfo::name, None, wowlib::db::wdc::WdcImage::parse(), wowlib::db::TableState::reset(), wowlib::db::TableInfo::schema, wowlib::SchemaMismatch, wowlib::db::TableState::sourceMagic, wowlib::db::wdc::Wdc3Header::tableHash, wowlib::TableMagicUnknown, wowlib::db::TableInfo::version, wowlib::db::wdc::WdcImage::wdc5, Wdc5Magic, wowlib::db::TableState::wdc5Prefix, wowlib::db::TableState::wdcKinds, wowlib::db::TableState::wdcLayoutHash, wowlib::db::TableState::wdcLocale, wowlib::db::TableState::wdcOriginal, and wowlib::db::TableState::wdcTableHash.
Referenced by wowlib::db::TableCore::read().
| Result< FileBuffer > wowlib::db::wdc::writeWdc | ( | std::uint32_t | magic, |
| const TableInfo & | info, | ||
| const RecordSource & | source, | ||
| const TableState & | state, | ||
| EncryptedPolicy | policy ) |
Encode a canonical image of flavor magic: one unencrypted section, integers bitpacked to their minimum width, floats/string references byte-aligned, pallet/common reproduced from the original compression, a re-derived copy table, and a relationship map when the schema carries a non-inline relation column.
Semantic round-trip (write -> re-read decodes to identical values), not byte-perfect. A table still holding keyless sections is re-emitted verbatim under EncryptedPolicy::Preserve, or written as decoded plaintext under Drop.
| magic | the flavor to emit (a loaded table passes its source magic, a fresh one its version's canonical flavor). |
| info | the table identity + schema. |
| source | the records to encode. |
| state | the preserved-state store. |
| policy | keyless-section handling. |
Definition at line 664 of file write.cpp.
References wowlib::builds::Cata, wowlib::db::TableState::encrypted, wowlib::InvalidEntityState, wowlib::makeError(), wowlib::db::TableInfo::name, wowlib::NotSupported, wowlib::db::Preserve, wowlib::db::TableInfo::version, and wowlib::db::TableState::wdcOriginal.
|
inlineconstexpr |
The WDC1 magic as memcpy'd off the file front (the bytes "WDC1").
Definition at line 32 of file binary.hpp.
Referenced by isWdcMagic(), and wowlib::db::wdc::WdcImage::parse().
|
inlineconstexpr |
The WDC3 magic as memcpy'd off the file front (the bytes "WDC3").
Definition at line 35 of file binary.hpp.
Referenced by isWdcMagic(), and wowlib::db::wdc::WdcImage::parse().
|
inlineconstexpr |
The WDC4 magic as memcpy'd off the file front (the bytes "WDC4").
Definition at line 38 of file binary.hpp.
Referenced by isWdcMagic(), and wowlib::db::wdc::WdcImage::parse().
|
inlineconstexpr |
The WDC5 magic as memcpy'd off the file front (the bytes "WDC5").
Definition at line 41 of file binary.hpp.
Referenced by isWdcMagic(), wowlib::db::wdc::WdcImage::parse(), and readWdc().