GGText class
#include <GGUI/Public/UIStrings.h>
Text passed to a widget: a key to look up (what strings convert to), a format with values, or verbatim data. Only valid for the duration of the call.
Public static functions
Constructors, destructors, conversion operators
- GGText() defaulted
- No text.
- GGText(std::string_view text)
- A key to look up: a string ID, or source-language text.
- GGText(const char* text)
- The same, from a C string.
- GGText(const std::string& text)
- The same, from a string.
- GGText(std::string_view format, std::initializer_list<GGTextArg> args)
- A format.
formatis looked up, then each{name}in the result is replaced by that argument.{{is a literal brace. A placeholder with no argument is left as written. - GGText(std::string_view format, std::span<const GGTextArg> args)
- The same, with arguments made at run time (a widget asset's).
Public functions
- auto Key() const -> std::string_view
- The key, the format, or the verbatim text.
- auto Args() const -> std::span<const GGTextArg>
- The format's arguments; empty for a plain key.
- auto IsVerbatim() const -> bool
- Whether it is data, never looked up.