GGUI::GGTextArg struct

A value for a named placeholder: an integer, a real, text, or a bound number.

Public types

enum class Kind: uint8_t { Whole, Real, Words, Bound }
What it holds.

Constructors, destructors, conversion operators

template<typename T>
GGTextArg(std::string_view name, T value)
An integer.
GGTextArg(std::string_view name, double value, uint8_t decimals = 2)
A real number, written with decimals places.
GGTextArg(std::string_view name, std::string_view words)
Text, put in as it is (not looked up).
GGTextArg(std::string_view name, const char* words)
The same, from a C string.
GGTextArg(std::string_view name, const GGBinding& bound, const NumberFormat& format = {})
Bound to data: the text updates when the value changes, with no re-run. At most one bound placeholder per text.

Public variables

std::string_view Name
the placeholder it fills: count for {count}
Kind What
which of the values below it holds
int64_t Whole
Whole.
double Real
Real.
std::string_view Words
Words.
GGBinding Bound
Bound.
uint8_t Decimals
Real and Bound: places shown.
NumberNotation Notation
Bound: how the number is written.

Enum documentation

enum class GGUI::GGTextArg::Kind: uint8_t

What it holds.

Enumerators
Whole

an integer

Real

a real number

Words

text, put in as it is

Bound

a bound number