wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wowlib::db::SchemaCatalog Class Reference

The parsed, materialized form of one WDBS schema blob. More...

#include <wowlib/db/schema_catalog.hpp>

Public Member Functions

 SchemaCatalog (SchemaCatalog &&) noexcept=default
SchemaCatalog & operator= (SchemaCatalog &&) noexcept=default
 SchemaCatalog (const SchemaCatalog &)=delete
SchemaCatalog & operator= (const SchemaCatalog &)=delete
Result< TableSchema > lookup (std::string_view table, ClientVersion version) const
 Resolve the schema of table for client version.
std::size_t tableCount () const
std::string_view tableName (std::size_t i) const
 The identifier name of table i (name-sorted order) — enumeration for tooling and the bindings' listing surface.
std::span< const ClientVersion > eras () const
 The era table the blob was built against (index = mask bit).

Detailed Description

The parsed, materialized form of one WDBS schema blob.

Move-only (the column names point into the owned bytes).

Definition at line 50 of file schema_catalog.hpp.

Constructor & Destructor Documentation

◆ SchemaCatalog() [1/2]

wowlib::db::SchemaCatalog::SchemaCatalog ( SchemaCatalog && )
defaultnoexcept

◆ SchemaCatalog() [2/2]

wowlib::db::SchemaCatalog::SchemaCatalog ( const SchemaCatalog & )
delete

References SchemaCatalog().

Member Function Documentation

◆ eras()

std::span< const ClientVersion > wowlib::db::SchemaCatalog::eras ( ) const
inline

The era table the blob was built against (index = mask bit).

Returns
the era versions, ascending.

Definition at line 107 of file schema_catalog.hpp.

◆ lookup()

Result< TableSchema > wowlib::db::SchemaCatalog::lookup ( std::string_view table,
ClientVersion version ) const

Resolve the schema of table for client version.

Parameters
tablethe table identifier (case-sensitive, e.g. "Map").
versionthe client to resolve for (snapped to its era by major).
Returns
the schema views, or TableUnknown / UnsupportedClientVersion (no era shares the major, or the table has no range covering the era).

Definition at line 82 of file schema_catalog.cpp.

References wowlib::ClientVersion::build, wowlib::makeError(), wowlib::TableUnknown, and wowlib::UnsupportedClientVersion.

Referenced by operator=().

◆ operator=() [1/2]

SchemaCatalog & wowlib::db::SchemaCatalog::operator= ( const SchemaCatalog & )
delete

References lookup(), and SchemaCatalog().

◆ operator=() [2/2]

SchemaCatalog & wowlib::db::SchemaCatalog::operator= ( SchemaCatalog && )
defaultnoexcept

References SchemaCatalog().

◆ tableCount()

std::size_t wowlib::db::SchemaCatalog::tableCount ( ) const
inline
Returns
the number of tables the catalog knows.

Definition at line 97 of file schema_catalog.hpp.

References tableCount().

Referenced by tableCount().

◆ tableName()

std::string_view wowlib::db::SchemaCatalog::tableName ( std::size_t i) const
inline

The identifier name of table i (name-sorted order) — enumeration for tooling and the bindings' listing surface.

Parameters
ithe table index (< tableCount()).
Returns
the name, valid for the catalog's lifetime.

Definition at line 103 of file schema_catalog.hpp.


The documentation for this class was generated from the following files: