![]() |
NDEVR
API Documentation
|
The container for storing N-number of ApplicationOption for the program. More...
Public Member Functions | |
| ApplicationOptions () | |
| Constructs an empty ApplicationOptions container. | |
| void | addOption (const TranslatedString &group_name, const TranslatedString &name, ApplicationOptionBase *value) |
| Adds an option under a specific group name. | |
| void | addOption (const TranslatedString &name, ApplicationOptionBase *value) |
| Adds an option with no group, placing it in the default group. | |
| void | addToINI (const TranslatedString &group_name, INIFactory &factory) |
| Serializes a specific option group into the given INI factory. | |
| void | addToINI (INIFactory &factory) |
| Serializes all option groups into the given INI factory. | |
| const ApplicationOptionBase * | getOption (const TranslatedString &group, const TranslatedString &name) const |
| Retrieves an option by group and name. | |
| const ApplicationOptionBase * | getOption (const TranslatedString &name) const |
| Retrieves an option from the default group by name. | |
| void | logOptions (LogPtr &log, bool log_only_non_defaults) |
| Writes option names and values to the given log. | |
| Dictionary< TranslatedString, ApplicationOptionBase * > | optionGroup (TranslatedString) |
| Returns all options belonging to a specific group. | |
| void | setToDefaults () |
| Resets all options across all groups to their default values. | |
| void | setToDefaults (const TranslatedString &group_name) |
| Resets all options in a specific group to their default values. | |
Static Public Member Functions | |
| static ApplicationOptions & | UserOptions () |
| Returns the global user options container singleton. | |
Protected Attributes | |
| Dictionary< TranslatedString, Dictionary< TranslatedString, ApplicationOptionBase * > > | m_options |
| Nested dictionary mapping group names to option dictionaries. | |
The container for storing N-number of ApplicationOption for the program.
Almost all options are typically "user options" and are added to that container by default.
Stores data of any type that can easily be saved or retrieved at runtime. Option belongs to a specific group for easy sorting and can be used to automatically generate widgets.
Definition at line 64 of file ApplicationOptions.h.
|
inline |
Adds an option under a specific group name.
| [in] | group_name | The translated group name for categorization. |
| [in] | name | The translated display name of the option. |
| [in] | value | Pointer to the ApplicationOptionBase to register. |
Definition at line 88 of file ApplicationOptions.h.
|
inline |
Adds an option with no group, placing it in the default group.
| [in] | name | The translated display name of the option. |
| [in] | value | Pointer to the ApplicationOptionBase to register. |
Definition at line 77 of file ApplicationOptions.h.
References addOption(), and name.
Referenced by addOption().
| void ApplicationOptions::addToINI | ( | const TranslatedString & | group_name, |
| INIFactory & | factory ) |
Serializes a specific option group into the given INI factory.
| [in] | group_name | The translated group name to serialize. |
| [in] | factory | The INIFactory to write options into. |
| void ApplicationOptions::addToINI | ( | INIFactory & | factory | ) |
Serializes all option groups into the given INI factory.
| [in] | factory | The INIFactory to write options into. |
|
inline |
Retrieves an option by group and name.
| [in] | group | The translated group name. |
| [in] | name | The translated option name. |
Definition at line 100 of file ApplicationOptions.h.
References m_options, and name.
Referenced by getOption().
|
inline |
Retrieves an option from the default group by name.
| [in] | name | The translated option name. |
Definition at line 110 of file ApplicationOptions.h.
References getOption(), and name.
| void ApplicationOptions::logOptions | ( | LogPtr & | log, |
| bool | log_only_non_defaults ) |
Writes option names and values to the given log.
| [in] | log | The log to write to. |
| [in] | log_only_non_defaults | If true, only logs options that differ from their defaults. |
| Dictionary< TranslatedString, ApplicationOptionBase * > ApplicationOptions::optionGroup | ( | TranslatedString | ) |
Returns all options belonging to a specific group.
| [in] | group | The translated group name to look up. |
| void ApplicationOptions::setToDefaults | ( | const TranslatedString & | group_name | ) |
Resets all options in a specific group to their default values.
| [in] | group_name | The translated group name whose options should be reset. |
|
static |
Returns the global user options container singleton.
References ApplicationOptions().
Referenced by ApplicationOption< t_type >::ApplicationOption(), ApplicationOption< t_type >::ApplicationOption(), and ApplicationOption< t_type >::ApplicationOption().