|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
One column of a record schema, derived from a record member by reflection (typed records) or from the schema catalog (the generic table). More...
#include <wowlib/db/schema.hpp>
Public Member Functions | |
| Column ()=default | |
| User-declared (defaulted) so Column is NOT an aggregate: bindings would otherwise synthesize a field-wise constructor, and its const char* name parameter would store a pointer into the marshalling temporary — Column is read-only schema metadata, never constructed from a bound language. | |
| constexpr std::string_view | nameView () const |
| The member spelling as a view. | |
| constexpr std::string_view | dbdNameView () const |
| The verbatim WoWDBDefs spelling as a view. | |
| constexpr std::size_t | inlineBytes () const |
| The bytes the column occupies inside a fixed-stride (WDBC/WDB2) record image: zero when noninline, the flags field included for LocString. | |
| constexpr std::uint32_t | fieldSlots () const |
| The expanded on-disk field slots the column contributes to a WDBC/WDB2 header field count: arrays count each element, LocString counts every language slot plus the flags field, noninline columns count zero. | |
| constexpr std::size_t | stringSlots () const |
| The string-block references the column stores per record (the width of the engine's per-record offset journal). | |
Public Attributes | |
| const char * | name = nullptr |
| The column name: the snake_case spelling of the WoWDBDefs column ('MapName' -> 'map_name'). | |
| const char * | dbdName = nullptr |
| The verbatim WoWDBDefs spelling of the column ('MapName_lang'); column_index accepts it as an alias. | |
| ColumnType | type = ColumnType::Int |
| The logical value class. | |
| std::uint8_t | bits = 0 |
| Integer element width in bits; 32 for float/string refs. | |
| bool | isSigned = false |
| Integer signedness; false for non-Int columns. | |
| std::uint16_t | arrayLen = 1 |
| Element count; 1 for scalar columns. | |
| std::uint8_t | localeCount = 0 |
| LocString language slots (8 or 16); 0 otherwise. | |
| bool | isId = false |
| Whether this is the table's primary key ($id$). | |
| bool | isRelation = false |
| Whether this is a relationship key ($relation$). | |
| bool | noninline = false |
| Whether the column holds no bytes inside the record image ($noninline$). | |
One column of a record schema, derived from a record member by reflection (typed records) or from the schema catalog (the generic table).
Array columns are ONE Column with arrayLen > 1 — the WoWDBDefs view of the world, not the expanded on-disk field list. One column of a table schema: its name, value class, integer shape, array length and key roles.
Definition at line 46 of file schema.hpp.
|
default |
|
inlineconstexpr |
The verbatim WoWDBDefs spelling as a view.
Definition at line 83 of file schema.hpp.
References dbdName.
|
inlineconstexpr |
The expanded on-disk field slots the column contributes to a WDBC/WDB2 header field count: arrays count each element, LocString counts every language slot plus the flags field, noninline columns count zero.
Definition at line 105 of file schema.hpp.
References arrayLen, localeCount, wowlib::db::LocString, noninline, and type.
|
inlineconstexpr |
The bytes the column occupies inside a fixed-stride (WDBC/WDB2) record image: zero when noninline, the flags field included for LocString.
Definition at line 90 of file schema.hpp.
References arrayLen, bits, wowlib::db::Float, wowlib::db::Int, localeCount, wowlib::db::LocString, noninline, wowlib::db::String, and type.
|
inlineconstexpr |
The member spelling as a view.
Definition at line 79 of file schema.hpp.
References name.
Referenced by wowlib::db::DynTable::podColumn(), and wowlib::db::TableCore::validate().
|
inlineconstexpr |
The string-block references the column stores per record (the width of the engine's per-record offset journal).
Definition at line 115 of file schema.hpp.
References arrayLen, localeCount, wowlib::db::LocString, noninline, wowlib::db::String, and type.
Referenced by wowlib::db::TableCore::validate().
| std::uint16_t wowlib::db::Column::arrayLen = 1 |
Element count; 1 for scalar columns.
Definition at line 60 of file schema.hpp.
Referenced by wowlib::db::detail::classifyMember(), wowlib::db::detail::ColumnRows::ColumnRows(), fieldSlots(), inlineBytes(), and stringSlots().
| std::uint8_t wowlib::db::Column::bits = 0 |
Integer element width in bits; 32 for float/string refs.
Definition at line 56 of file schema.hpp.
Referenced by wowlib::db::detail::classifyMember(), wowlib::db::detail::ColumnRows::ColumnRows(), and inlineBytes().
| const char* wowlib::db::Column::dbdName = nullptr |
The verbatim WoWDBDefs spelling of the column ('MapName_lang'); column_index accepts it as an alias.
Empty for columns without a DBD identity (reflection-derived schemas). The upstream spelling (interned; null = none).
Definition at line 52 of file schema.hpp.
Referenced by dbdNameView().
| bool wowlib::db::Column::isId = false |
Whether this is the table's primary key ($id$).
Definition at line 64 of file schema.hpp.
Referenced by wowlib::db::detail::ColumnRows::ColumnRows(), wowlib::db::schemaOf(), and wowlib::db::TableCore::validate().
| bool wowlib::db::Column::isRelation = false |
Whether this is a relationship key ($relation$).
Definition at line 66 of file schema.hpp.
Referenced by wowlib::db::schemaOf().
| bool wowlib::db::Column::isSigned = false |
Integer signedness; false for non-Int columns.
Definition at line 58 of file schema.hpp.
Referenced by wowlib::db::detail::classifyMember(), and wowlib::db::DynTable::podColumn().
| std::uint8_t wowlib::db::Column::localeCount = 0 |
LocString language slots (8 or 16); 0 otherwise.
Definition at line 62 of file schema.hpp.
Referenced by wowlib::db::detail::classifyMember(), wowlib::db::detail::ColumnRows::ColumnRows(), fieldSlots(), inlineBytes(), and stringSlots().
| const char* wowlib::db::Column::name = nullptr |
The column name: the snake_case spelling of the WoWDBDefs column ('MapName' -> 'map_name').
This spelling is a stable cross-release contract on every binding surface. The member spelling (interned, never dangling).
Definition at line 48 of file schema.hpp.
Referenced by nameView(), and wowlib::db::schemaOf().
| bool wowlib::db::Column::noninline = false |
Whether the column holds no bytes inside the record image ($noninline$).
Definition at line 68 of file schema.hpp.
Referenced by fieldSlots(), inlineBytes(), wowlib::db::schemaOf(), and stringSlots().
| ColumnType wowlib::db::Column::type = ColumnType::Int |
The logical value class.
Definition at line 54 of file schema.hpp.
Referenced by wowlib::db::detail::classifyMember(), wowlib::db::detail::ColumnRows::ColumnRows(), fieldSlots(), inlineBytes(), wowlib::db::DynTable::podColumn(), and stringSlots().