6#include "phosphorconfig_export.h"
92 std::function<QVariant(
const QVariant& value)>
validator = {};
164 QVariant
defaultFor(
const QString& group,
const QString& key)
const;
168 QVector<ChoiceDef>
choicesFor(
const QString& group,
const QString& key)
const;
Optional plug-in for custom group name semantics.
Definition IGroupPathResolver.h:30
Definition HostDirectory.h:19
One legal value of an enum-style key: the value as stored, plus a stable token naming it.
Definition Schema.h:36
QVariant value
The value as persisted — an int for a C++ enum, a string for a token-valued key.
Definition Schema.h:39
QString token
Stable identifier for this choice, e.g.
Definition Schema.h:44
Declaration for a single configuration key.
Definition Schema.h:62
QVariant defaultValue
Definition Schema.h:64
QVector< ChoiceDef > choices
The legal values, for a key that takes one of a closed set.
Definition Schema.h:105
QString description
Human-readable description.
Definition Schema.h:75
QMetaType::Type expectedType
Definition Schema.h:65
std::function< QVariant(const QVariant &value)> validator
Coercion applied on every read and every write.
Definition Schema.h:92
QString key
Definition Schema.h:63
One step in a schema version migration chain.
Definition Schema.h:113
std::function< void(QJsonObject &)> migrate
Definition Schema.h:115
int fromVersion
Definition Schema.h:114
Declarative description of a configuration store.
Definition Schema.h:127
std::shared_ptr< IGroupPathResolver > pathResolver
Optional per-screen / custom name resolver.
Definition Schema.h:156
QString versionKey
JSON key used to persist the schema version.
Definition Schema.h:137
QMap< QString, QVector< KeyDef > > groups
Keys grouped by their group name.
Definition Schema.h:147
QVector< MigrationStep > migrations
Ordered migration chain.
Definition Schema.h:152
QVector< ChoiceDef > choicesFor(const QString &group, const QString &key) const
The legal values of a declared key.
int version
Current schema revision.
Definition Schema.h:131
const KeyDef * findKey(const QString &group, const QString &key) const
Look up a KeyDef by (group, key).
QVariant defaultFor(const QString &group, const QString &key) const
Convenience: default value for a declared key, or QVariant() if the key is undeclared.