Database :: storeOption - Store option in database configuration
An option with the name (path) passed in sOption may be saved in a configuration, which is stored in the database. Usually, the configuration name is identical with the user or login name set in the configuration file or obtained from the system. Options from the configuration are usually initialized when opening a database.
When no configuration can be located, the default configuration is used instead. Since the default configuration is shared by different users, trying to update the default configuration will return an error (bState false). In order to change the default configuration explicitly, bDefault has to be set to true.
When the option value sOption does not yet exist in the selected configuration, it will be created before being set.
The value is true when the function was executed successfully. Otherwise the value is set to false.
Implementation overview
- Store option value to configuration
Database :: storeOption ( sConfiguration, sOption, sValue, bDefault ) - Save value currently set
Database :: storeOption ( sOption, bDefault ) - Store passed option value
Database :: storeOption ( sOption, sValue, bDefault )
Implementation details
-
Store option value to configuration
bool Database  :: storeOption ( odaba::String &sConfiguration, odaba::String &sOption, odaba::String &sValue, bool bDefault )
The function stores the value passed in sValue to the option sOption of the configuration passed in sConfiguration. The function does not change current settings for the internal option value. When no such configuration exists, the function returns an error (bState is true). When bDefault is set to true, the function tries to locate the default configuration, when the configuration requested does not exist.
- sConfiguration
- Configuration name
Database or XML configurations support multiple configurations. In order to initialize options from a special configuration, the configuration name is required.
- sOption
- Option name
Option names are names for variables (options) defined in the configuration or ini-file, in the system environment or set by the program. Option names can be provides as option paths in order to refer to an option value in the option hierarchy.
option("DICTIONARY");
option("ode.DICTIONARY");
- sValue - String value
- bDefault - Use/update default configuration
to list
- sConfiguration
- Configuration name
-
Save value currently set
bool Database  :: storeOption ( odaba::String &sOption, bool bDefault )
The function saves the value currently set for the option to the configuration located as user configuration in the database.
- sOption
- Option name
Option names are names for variables (options) defined in the configuration or ini-file, in the system environment or set by the program. Option names can be provides as option paths in order to refer to an option value in the option hierarchy.
option("DICTIONARY");
option("ode.DICTIONARY");
- bDefault - Use/update default configuration
to list
- sOption
- Option name
-
Store passed option value
bool Database  :: storeOption ( odaba::String &sOption, odaba::String &sValue, bool bDefault )
The function stores the value passed to the option to the configuration located as user configuration. The function does not change current settings for the internal option value.
- sOption
- Option name
Option names are names for variables (options) defined in the configuration or ini-file, in the system environment or set by the program. Option names can be provides as option paths in order to refer to an option value in the option hierarchy.
option("DICTIONARY");
option("ode.DICTIONARY");
- sValue - String value
- bDefault - Use/update default configuration
to list
- sOption
- Option name