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

WdcImage — the structural parser of the WDC family (WDC1/WDC3/WDC4/WDC5) and the per-field value decoder. More...

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

Go to the source code of this file.

Classes

struct  wowlib::db::wdc::WdcSection
 A located, structurally-validated section. More...
struct  wowlib::db::wdc::WdcImage
 A parsed WDC-family file: the (normalized) header, shared tables, and located sections. More...

Namespaces

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

Enumerations

enum class  wowlib::db::wdc::StringRefMode : std::uint8_t { wowlib::db::wdc::BlockRelative , wowlib::db::wdc::FieldRelative }
 How a record's string-reference fields address the string data. More...

Detailed Description

WdcImage — the structural parser of the WDC family (WDC1/WDC3/WDC4/WDC5) and the per-field value decoder.

parse() locates every block of every section and validates that the structure closes within the file; the fieldRaw()/elemBitWidth()/fieldIsSigned() methods then decode individual column values over all six compression kinds.

The flavor differences are normalized at parse time so everything downstream (the schema-driven codec in read.cpp/write.cpp) handles one shape:

  • WDC1's implicit single section becomes sections[0]; its dense minId..maxId offset map is filtered to the present entries with the ids made explicit (owned by the image), matching WDC3's compact form.
  • WDC1's Bitpacked + flags 0x01 signed spelling is rewritten to BitpackedSigned.
  • The only difference the decoder still has to branch on is the string reference convention (stringMode): WDC1 offsets are relative to the string block start, WDC2+ offsets to the referencing field's position. Encrypted sections (tactKeyHash != 0, records zeroed because the local storage lacks the key) are located and PRESERVED but not decoded.

Definition in file image.hpp.