company logo

IniFile :: optionValue - Get option value

The function provides an option value for the currently selected configuration and section. In case of hierarchical configurations (typically XML files), the option name may consist of a hierarchical name sequence separated by dots.

Return value:  Option name ( odaba::String & )

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");

Implementation details

odaba::String IniFile  :: optionValue ( odaba::String &sOptionName )

The function searches for the option value for the option name passed in sOptionName in the currently selected section (section()) of the currently selected configuration (configuration()). Whenthe option has been found, the function returns the option value.

When the option is not defined in the currently located section of the selected configuration, the function returns an empty string.

Notes:

The function looks for the option value in the configuration file, which may differ from the option value currently set in the application.

  • sOptionName - Option name

    The name refers to an option set on the server or client side. Option names may be defined simply as an identifier (main option) or as an option hierarchy path when the option is defined on a lower level of the option hierarchy.