|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
A structural view over one WDBS blob. More...
#include <wowlib/db/schema_blob.hpp>
Public Member Functions | |
| constexpr | View (std::span< const unsigned char > bytes) |
| Bind the view to bytes (unvalidated — call valid). | |
| constexpr bool | valid () const |
| Whether the bytes are a structurally valid WDBS v2 blob: magic, version, and every section (plus the string pool's terminating NUL discipline at the section level) inside bounds. | |
| constexpr std::size_t | eraCount () const |
| constexpr std::size_t | tableCount () const |
| constexpr std::size_t | rangeCount () const |
| constexpr std::size_t | columnCount () const |
| constexpr std::size_t | strpoolSize () const |
| constexpr ClientVersion | era (std::size_t i) const |
| The client version of era slot i. | |
| constexpr TableEntry | table (std::size_t i) const |
| The directory entry of table i (name-sorted order). | |
| constexpr RangeEntry | range (std::size_t i) const |
| The range entry i (blob-global index). | |
| constexpr ColumnEntry | column (std::size_t i) const |
| The column entry i (blob-global index). | |
| std::string_view | stringAt (std::uint32_t off) const |
| The pool string at off as a view into the blob (runtime only — the pointer cast out of the byte pool is not a constant expression). | |
| constexpr std::string | copyStringAt (std::uint32_t off) const |
| The pool string at off, copied byte by byte — the consteval-safe twin of stringAt. | |
| constexpr std::optional< std::size_t > | findTable (std::string_view name) const |
| Binary-search the (name-sorted) table directory for name. | |
| constexpr std::span< const unsigned char > | bytes () const |
A structural view over one WDBS blob.
Construction never throws and never reads out of bounds: valid reports whether the bytes are a well-formed blob, and every accessor presumes it returned true.
The view neither owns nor copies — the caller keeps the bytes alive (the embedded blob has static storage; the catalog owns its file buffer).
Definition at line 99 of file schema_blob.hpp.
|
inlineexplicitconstexpr |
Bind the view to bytes (unvalidated — call valid).
| bytes | the complete blob. |
Definition at line 103 of file schema_blob.hpp.
References bytes().
|
inlineconstexpr |
Definition at line 210 of file schema_blob.hpp.
Referenced by View().
|
inlineconstexpr |
The column entry i (blob-global index).
| i | the column index (< columnCount()). |
Definition at line 156 of file schema_blob.hpp.
References wowlib::db::blob::ColumnEntry::arrayLen, wowlib::db::blob::ColumnEntry::bits, wowlib::db::blob::ColumnBytes, wowlib::db::blob::ColumnEntry::dbdNameOff, wowlib::db::blob::ColumnEntry::isId, wowlib::db::blob::ColumnEntry::isRelation, wowlib::db::blob::ColumnEntry::isSigned, wowlib::db::blob::ColumnEntry::localeCount, wowlib::db::blob::ColumnEntry::nameOff, wowlib::db::blob::ColumnEntry::noninline, and wowlib::db::blob::ColumnEntry::type.
Referenced by wowlib::db::detail::typedColumnIndex(), and wowlib::db::detail::typedValidate().
|
inlineconstexpr |
Definition at line 125 of file schema_blob.hpp.
Referenced by valid().
|
inlineconstexpr |
The pool string at off, copied byte by byte — the consteval-safe twin of stringAt.
| off | the pool offset. |
Definition at line 186 of file schema_blob.hpp.
Referenced by wowlib::db::detail::typedColumnIndex().
|
inlineconstexpr |
The client version of era slot i.
| i | the era index (< eraCount()). |
Definition at line 132 of file schema_blob.hpp.
References wowlib::db::blob::EraBytes, and wowlib::db::blob::HeaderBytes.
Referenced by wowlib::db::detail::typedRangeOf().
|
inlineconstexpr |
Definition at line 119 of file schema_blob.hpp.
Referenced by wowlib::db::detail::typedRangeOf(), and valid().
|
inlineconstexpr |
Binary-search the (name-sorted) table directory for name.
| name | the table identifier (case-sensitive, e.g. "Map"). |
Definition at line 196 of file schema_blob.hpp.
References table(), and tableCount().
Referenced by wowlib::db::detail::typedRangeOf().
|
inlineconstexpr |
The range entry i (blob-global index).
| i | the range index (< rangeCount()). |
Definition at line 148 of file schema_blob.hpp.
References wowlib::db::blob::RangeBytes.
Referenced by wowlib::db::detail::typedRangeOf().
|
inlineconstexpr |
Definition at line 123 of file schema_blob.hpp.
Referenced by valid().
|
inline |
The pool string at off as a view into the blob (runtime only — the pointer cast out of the byte pool is not a constant expression).
| off | the pool offset (a *_off field). |
Definition at line 177 of file schema_blob.hpp.
|
inlineconstexpr |
Definition at line 127 of file schema_blob.hpp.
Referenced by valid().
|
inlineconstexpr |
The directory entry of table i (name-sorted order).
| i | the table index (< tableCount()). |
Definition at line 140 of file schema_blob.hpp.
References wowlib::db::blob::TableBytes.
Referenced by findTable(), and wowlib::db::detail::typedRangeOf().
|
inlineconstexpr |
Definition at line 121 of file schema_blob.hpp.
Referenced by findTable(), and valid().
|
inlineconstexpr |
Whether the bytes are a structurally valid WDBS v2 blob: magic, version, and every section (plus the string pool's terminating NUL discipline at the section level) inside bounds.
Definition at line 109 of file schema_blob.hpp.
References wowlib::db::blob::ColumnBytes, columnCount(), wowlib::db::blob::EraBytes, eraCount(), wowlib::db::blob::FormatVersion, wowlib::db::blob::HeaderBytes, wowlib::db::blob::Magic, wowlib::db::blob::RangeBytes, rangeCount(), strpoolSize(), wowlib::db::blob::TableBytes, and tableCount().