OpenTTD Source 20250220-master-gf89924a727
|
Container for an encoded string, created by GetEncodedString. More...
#include <strings_type.h>
Public Member Functions | |
auto | operator<=> (const EncodedString &) const =default |
std::string | GetDecodedString () const |
Decode the encoded string. | |
void | clear () |
bool | empty () const |
Private Member Functions | |
EncodedString (std::string &&string) | |
Private Attributes | |
std::string | string |
The encoded string. | |
Friends | |
EncodedString | GetEncodedStringWithArgs (StringID str, std::span< const StringParameter > params) |
Encode a string with its parameters into an encoded string. | |
Container for an encoded string, created by GetEncodedString.
Definition at line 98 of file strings_type.h.
|
inlineexplicitprivate |
Definition at line 113 of file strings_type.h.
|
inline |
Definition at line 106 of file strings_type.h.
|
inline |
Definition at line 107 of file strings_type.h.
std::string EncodedString::GetDecodedString | ( | ) | const |
Decode the encoded string.
Definition at line 153 of file strings.cpp.
References GetString().
Referenced by ErrmsgWindow::DrawWidget(), QueryWindow::DrawWidget(), QueryWindow::SetStringParameters(), ErrmsgWindow::UpdateWidgetSize(), TooltipsWindow::UpdateWidgetSize(), and QueryWindow::UpdateWidgetSize().
|
friend |
Encode a string with its parameters into an encoded string.
The encoded string can be stored and decoded later without requiring parameters to be stored separately.
str | The StringID to format. |
params | The parameters of the string. |
Definition at line 115 of file strings.cpp.
|
private |
The encoded string.
Definition at line 110 of file strings_type.h.