dao::WString

class

A std::wstring with the memory layout the game uses (MSVC 2005’s, see dao/core/Msvc8.h).

The game’s own functions fill it in and free it, because text longer than seven characters is stored on the game’s heap.

It calls game code, so use it only in a build the library knows (Module::IsKnownExecutable).

Declared in dao/String.h.

Functions

Assign()

void Assign(std::wstring_view text)

Replaces the text with a copy of text, using the game’s own operator=.

Engine()

core::WStringRep * Engine()

Returns the string as the game’s std::wstring, to pass to a game function that takes or fills one in.

operator=()

WString & operator=(const WString &)=delete

View()

std::wstring_view View() const

Returns the text. The view is valid until the string is changed or destroyed.

WString()

WString()=default

Makes an empty string.

WString()

WString(const WString &)=delete

WString()

WString(std::wstring_view text)

Makes a string holding a copy of text.

~WString()

~WString()

Frees the text through the game’s own code.