Config
Stores the normalized values returned after successful schema validation.
A Config is read-only from the consumer’s perspective. Values are keyed internally by their dotted section/property path and can be retrieved either as QVariant or through value<T>(). A Config returned by a successful ConfigResult has already passed schema validation, so concise typed reads are guarded as programmer-error preconditions instead of per-read validation decisions.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
bool | contains const | Checks whether a validated property is available. |
T | value const inline | Returns a normalized property from a successfully validated Config snapshot. |
T | value const inline | Probes a normalized property only when its stored type exactly matches the requested type. |
const
contains
Section titled “contains”Checks whether a validated property is available.
Returns
Section titled “Returns”true when the normalized configuration contains the property.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
section | const QString& | Section name. |
property | const QString& | Property name. |
const inline
Returns a normalized property from a successfully validated Config snapshot.
Returns
Section titled “Returns”Typed property value.
This accessor is intentionally concise for the normal consumer path: call it only on Config instances returned by a successful ConfigResult, and request the same type declared in ConfigSchema. The method checks the schema-recorded metatype exactly, so debug builds assert if the path is absent or the requested type differs from the declared type. Use contains() or this overload when intentionally probing optional paths outside that validated-snapshot contract.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
section | const QString& | Section name. |
property | const QString& | Property name. |
const inline
Probes a normalized property only when its stored type exactly matches the requested type.
Returns
Section titled “Returns”Typed property value, or T() when the property is absent or stores another type.
QVariant can perform broad implicit conversions, such as converting an integer to bool. ConfigSchema stores normalized values with the declared schema type, so this overload deliberately checks the stored metatype before returning a value. Prefer the two-argument value<T>() accessor for ordinary reads from successful ConfigResult snapshots; keep this overload for diagnostics or compatibility code that deliberately probes a path.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
section | const QString& | Section name. |
property | const QString& | Property name. |
ok | bool& | Output flag set to true only when the property exists and stores T. |