One legal value of an enum-style key: the value as stored, plus a stable token naming it. More...
#include <phosphor-config/include/PhosphorConfig/Schema.h>
Public Attributes | |
| QVariant | value |
| The value as persisted — an int for a C++ enum, a string for a token-valued key. | |
| QString | token |
| Stable identifier for this choice, e.g. | |
One legal value of an enum-style key: the value as stored, plus a stable token naming it.
The token is deliberately NOT user-facing text. A key's legal values are semantics and belong with the key; the words for them are presentation and belong to the consumer, which knows its own locale and audience. Keeping them apart is what lets this library stay free of any i18n dependency while still telling a caller that a setting takes one of three values.
Without this, enum-ness is only expressible inside KeyDef::validator as a range clamp, which no caller can read back: a consumer building a settings UI or a config diff has no way to learn that 2 is a legal value, let alone what distinguishes it from 1.
| QString PhosphorConfig::ChoiceDef::token |
Stable identifier for this choice, e.g.
"vertical". Never translated, never shown to a user, and never renamed once shipped: consumers key their label tables off it.
| QVariant PhosphorConfig::ChoiceDef::value |
The value as persisted — an int for a C++ enum, a string for a token-valued key.