ConfigSchema::Section
Source locationmrx/core/config/ConfigSchema.hpp
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
Section& | required inline | Declares a required property. |
Section& | optional inline | Declares an optional property with a normalized default value. |
Section& | range inline | Adds an inclusive range constraint to the most recently declared property. |
Section& | validate | Adds a custom constraint to the most recently declared property. |
inline
required
Section titled “required”Source locationmrx/core/config/ConfigSchema.hpp
Declares a required property.
Returns
Section titled “Returns”This builder, allowing another property declaration or constraint.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
name | const QString& | Property name. |
inline
optional
Section titled “optional”Source locationmrx/core/config/ConfigSchema.hpp
Declares an optional property with a normalized default value.
Returns
Section titled “Returns”This builder, allowing another property declaration or constraint.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
name | const QString& | Property name. |
defaultValue | const T& | Value used when the property is absent; constraints also apply to it. |
inline
Source locationmrx/core/config/ConfigSchema.hpp
Adds an inclusive range constraint to the most recently declared property.
Returns
Section titled “Returns”This builder.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
minimum | const T& | Inclusive lower bound. |
maximum | const T& | Inclusive upper bound. |
validate
Section titled “validate”Source locationmrx/core/config/ConfigSchema.hpp
Adds a custom constraint to the most recently declared property.
Returns
Section titled “Returns”This builder.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
validator | const std::function<bool(const QVariant &, QString*)>& | Callback returning false when the value is invalid. The callback should write a descriptive reason to reason before returning false. |