wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wowlib::db::LocString< Langs > Struct Template Reference

A decoded pre-Cataclysm localized string column: Langs language slots (8 before TBC 2.1.0.6692 added ruRU, 16 after) plus the trailing locale flags field. More...

#include <wowlib/db/locstring.hpp>

Public Member Functions

std::string_view at (Locale locale) const
 The string stored for locale.
Result< void > set (Locale locale, std::string_view value)
 Store value in the slot of locale.
constexpr bool operator== (const LocString &) const =default

Public Attributes

std::array< std::string, Langs > values {}
 The language slot values in client column order (0 enUS, 1 koKR, 2 frFR, 3 deDE, 4 zhCN, 5 zhTW, 6 esES, 7 esMX, then ruRU/ptBR/itIT for 16-slot eras); empty for languages the file does not carry.
std::uint32_t flags = 0
 The trailing locale flags field; a bitmask the client never reads, preserved verbatim.

Detailed Description

template<std::size_t Langs>
struct wowlib::db::LocString< Langs >

A decoded pre-Cataclysm localized string column: Langs language slots (8 before TBC 2.1.0.6692 added ruRU, 16 after) plus the trailing locale flags field.

On disk each slot is a string-block offset; empty slots reference offset 0.

Template Parameters
Langsthe client era's language slot count (8 or 16).

Definition at line 52 of file locstring.hpp.

Member Function Documentation

◆ at()

template<std::size_t Langs>
std::string_view wowlib::db::LocString< Langs >::at ( Locale locale) const
inlinenodiscard

The string stored for locale.

Parameters
localethe locale to look up.
Returns
the slot value, or empty when the locale has no slot in this era (jaJP-adjacent slots, ruRU+ on an 8-slot column). The string stored for a locale; empty when the locale has no slot in this client era.
the slot value, empty when absent
Parameters
localethe locale to look up

Definition at line 68 of file locstring.hpp.

◆ operator==()

template<std::size_t Langs>
bool wowlib::db::LocString< Langs >::operator== ( const LocString< Langs > & ) const
constexprdefault

◆ set()

template<std::size_t Langs>
Result< void > wowlib::db::LocString< Langs >::set ( Locale locale,
std::string_view value )
inline

Store value in the slot of locale.

Parameters
localethe locale to write.
valuethe string to store.
Returns
nothing, or NotSupported when the locale has no slot in this client era. Store a string in a locale's slot.
nothing; raises when the locale has no slot in this client era
Parameters
localethe locale to write
valuethe string to store

Definition at line 83 of file locstring.hpp.

Member Data Documentation

◆ flags

template<std::size_t Langs>
std::uint32_t wowlib::db::LocString< Langs >::flags = 0

The trailing locale flags field; a bitmask the client never reads, preserved verbatim.

Definition at line 57 of file locstring.hpp.

◆ values

template<std::size_t Langs>
std::array<std::string, Langs> wowlib::db::LocString< Langs >::values {}

The language slot values in client column order (0 enUS, 1 koKR, 2 frFR, 3 deDE, 4 zhCN, 5 zhTW, 6 esES, 7 esMX, then ruRU/ptBR/itIT for 16-slot eras); empty for languages the file does not carry.

Definition at line 54 of file locstring.hpp.


The documentation for this struct was generated from the following file: