wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wdc.hpp File Reference

The WDC-family codec: the non-templated entry points Table<Record> dispatches to for every column-compressed .db2 flavor — WDC1 (Legion 7.3.5), WDC3 (BfA 8.1 . More...

#include <cstdint>
#include <span>
#include <wowlib/core/buffer.hpp>
#include <wowlib/core/error.hpp>
#include <wowlib/db/codec.hpp>
#include <wowlib/db/wdc/image.hpp>
Include dependency graph for wdc.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  wowlib
namespace  wowlib::db
namespace  wowlib::db::wdc

Functions

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.
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.

Detailed Description

The WDC-family codec: the non-templated entry points Table<Record> dispatches to for every column-compressed .db2 flavor — WDC1 (Legion 7.3.5), WDC3 (BfA 8.1 .

. DF 10.1, all of 8.3.7/9.2.7), WDC4 (DF 10.1 .. 10.2.5) and WDC5 (10.2.5+, all of 10.2.7/11.x). The flavor differences are normalized by WdcImage::parse (image.hpp), so one schema-driven decoder and one encoder serve the whole family; the codec compiles once, not per generated table, and drives records through RecordSink / RecordSource (codec.hpp).

Definition in file wdc.hpp.