|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
The welded supertype of every generated table class: the whole table surface — decode, encode, validation, the preserved-state getters — bound ONCE and inherited, in every language, by all ~4200 generated (table x era) classes. More...
#include <wowlib/db/table_core.hpp>
Public Member Functions | |
| Result< void > | read (std::span< const std::byte > data) |
| Decode a table file image. | |
| Result< void > | read (fs::FileSystem &fs, const FileKey &key) |
| Load the table from a client filesystem. | |
| Result< FileBuffer > | write (EncryptedPolicy policy=EncryptedPolicy::Preserve) const |
| Serialize the table to a file image; a loaded table re-emits the format it was read from. | |
| Result< void > | write (fs::FileSystem &fs, const FileKey &key, EncryptedPolicy policy=EncryptedPolicy::Preserve) const |
| Serialize the table into a client filesystem (project overlay); the target path's extension picks .dbc/.db2 in the mixed eras. | |
| const formats::StringBlock & | strings () const |
| The preserved string block the record string fields were decoded from; offsets never move, write() appends new strings past its end. | |
| const std::vector< EncryptedSection > & | encryptedSections () const |
| The encrypted sections skipped on read: their records are not in records, but the file re-writes them verbatim. | |
| bool | fullyDecoded () const |
| Whether the whole table decoded — false when encrypted sections were skipped. | |
| formats::ValidationReport | validate () const |
| Result< void > | ensureValid () const |
| Validate and raise on the first error instead of returning a report — the assert-style face of validate(). | |
| const TableCore & | core () const |
| The erased engine (bindings build live record views off it). | |
Protected Attributes | |
| TableCore | _core |
The welded supertype of every generated table class: the whole table surface — decode, encode, validation, the preserved-state getters — bound ONCE and inherited, in every language, by all ~4200 generated (table x era) classes.
Family bases (the per-table supertypes dbdgen emits) derive this; the per-era classes derive those and wire the protected core with their typed records vector at construction. The common surface of every client-database table: decode (read), encode (write), validation, and the preserved decode state. Concrete tables add their typed records.
Definition at line 132 of file table_core.hpp.
|
inline |
The erased engine (bindings build live record views off it).
Excluded from every binding: TableCore is deliberately not welded — the bound face IS this class.
Definition at line 198 of file table_core.hpp.
References _core.
|
inline |
The encrypted sections skipped on read: their records are not in records, but the file re-writes them verbatim.
Definition at line 177 of file table_core.hpp.
References _core.
|
inlinenodiscard |
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
Definition at line 193 of file table_core.hpp.
References _core.
|
inline |
Whether the whole table decoded — false when encrypted sections were skipped.
Definition at line 182 of file table_core.hpp.
References _core.
|
inline |
Load the table from a client filesystem.
| fs | the filesystem gateway |
| key | the file to read |
Definition at line 146 of file table_core.hpp.
References _core.
|
inline |
Decode a table file image.
| data | the whole file content |
Definition at line 138 of file table_core.hpp.
References _core.
|
inline |
The preserved string block the record string fields were decoded from; offsets never move, write() appends new strings past its end.
Definition at line 174 of file table_core.hpp.
References _core.
|
inlinenodiscard |
Definition at line 186 of file table_core.hpp.
References _core.
|
inline |
Serialize the table to a file image; a loaded table re-emits the format it was read from.
policy decides how keyless encrypted sections are handled.
| policy | keyless-section handling (WDC only) |
Definition at line 155 of file table_core.hpp.
References _core, and wowlib::db::Preserve.
|
inline |
Serialize the table into a client filesystem (project overlay); the target path's extension picks .dbc/.db2 in the mixed eras.
| fs | the filesystem gateway |
| key | the file to write |
| policy | keyless-section handling (WDC only) |
Definition at line 165 of file table_core.hpp.
References _core, and wowlib::db::Preserve.
|
protected |
Definition at line 201 of file table_core.hpp.
Referenced by core(), encryptedSections(), ensureValid(), fullyDecoded(), read(), read(), strings(), validate(), write(), and write().