Soprano
2.7.6
|
Wraps one setting for Model creation. More...
#include <Soprano/BackendSetting>
Wraps one setting for Model creation.
A BackendSetting consists of an option type and an option value. The option type can either be a predefined value from Soprano::BackendOption or a user defined string value that depends on the Backend implementation. In the latter case option has to be set to Soprano::BackendOptionUser.
Create an empty setting.
Create a boolean setting with a default true value.
Soprano::BackendSetting::BackendSetting | ( | BackendOption | s, |
const QVariant & | value_ | ||
) |
Create a standard setting with option s
and value value_
.
Soprano::BackendSetting::BackendSetting | ( | const QString & | userOption, |
const QVariant & | value_ | ||
) |
Create a user setting with user option name userOption
and value value_
.
Soprano::BackendSetting::BackendSetting | ( | const BackendSetting & | other | ) |
Copy constructor.
Destructor.
BackendSetting& Soprano::BackendSetting::operator= | ( | const BackendSetting & | other | ) |
Copy operator.
BackendOption Soprano::BackendSetting::option | ( | ) | const |
The option that this setting sets. If Soprano::BackendOptionUser the option is identified by userOptionName().
The name of the user option if option() is Soprano::BackendOptionUser.
QVariant Soprano::BackendSetting::value | ( | ) | const |
The value of the setting.
void Soprano::BackendSetting::setValue | ( | const QVariant & | value | ) |
Set the value of the Setting.
SOPRANO_EXPORT bool isOptionInSettings | ( | const BackendSettings & | settings, |
BackendOption | option, | ||
const QString & | userOptionName = QString() |
||
) | [related] |
Check if a certain option is defined in a list of BackendSettings.
settings | The list to check. |
option | The option to check. |
userOptionName | If option is Soprano::BackendOptionUser, this defines the user option to be checked. |
true
if the option is defined.SOPRANO_EXPORT BackendSetting & settingInSettings | ( | BackendSettings & | settings, |
BackendOption | option, | ||
const QString & | userOptionName = QString() |
||
) | [related] |
Get a setting from the set, allowing to modify it.
settings | The list to check. |
option | The option to extract. |
userOptionName | If option is Soprano::BackendOptionUser, this defines the user option to be extracted. |
settings
in case the option is not found in settings
.SOPRANO_EXPORT BackendSetting & settingInSettings | ( | BackendSettings & | settings, |
const QString & | userOptionName | ||
) | [related] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
settings | The list to check. |
userOptionName | The user option to be extracted. |
settings
in case the option is not found in settings
.SOPRANO_EXPORT BackendSetting settingInSettings | ( | const BackendSettings & | settings, |
BackendOption | option, | ||
const QString & | userOptionName = QString() |
||
) | [related] |
Get a setting from the set.
settings | The list to check. |
option | The option to extract. |
userOptionName | If option is Soprano::BackendOptionUser, this defines the user option to be extracted. |
SOPRANO_EXPORT BackendSetting settingInSettings | ( | const BackendSettings & | settings, |
const QString & | userOptionName = QString() |
||
) | [related] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
settings | The list to check. |
userOptionName | The user option to be extracted. |
SOPRANO_EXPORT QVariant valueInSettings | ( | const BackendSettings & | settings, |
BackendOption | option, | ||
const QString & | userOptionName = QString() |
||
) | [related] |
Retrieve the value of an option.
settings | The list to check. |
option | The option to retrieve. |
userOptionName | If option is Soprano::BackendOptionUser, this defines the user option to be retrieved. |
SOPRANO_EXPORT QVariant valueInSettings | ( | const BackendSettings & | settings, |
const QString & | userOptionName, | ||
const QVariant & | defaultValue = QVariant() |
||
) | [related] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
settings | The list to check. |
userOptionName | The user option to retrieve. |
defaultValue | The default to use if option is not part of settings |
default
if settings
does not contain the option.SOPRANO_EXPORT QVariant valueInSettingsWithDefault | ( | const BackendSettings & | settings, |
BackendOption | option, | ||
const QVariant & | defaultValue | ||
) | [related] |
Retrieve the value of an option with a fallback default.
settings | The list to check. |
option | The option to retrieve. |
defaultValue | The default to use if option is not part of settings |
default
if settings
does not contain the option.