3#include <NDEVR/String.h>
4#include <NDEVR/GenericOption.h>
5#include <NDEVR/INIFactory.h>
6#include <NDEVR/Dictionary.h>
11 class ResourceListener;
51 lib_assert(!m_options[group_name].hasKey(name),
"Duplicate entry");
52 m_options[group_name][name] = value;
56 return m_options[
group][name];
66 void logOptions(
ProgressInfo* log,
bool log_only_non_defaults);
81 template<
class t_type>
110 void set(
const t_type& value,
bool make_default =
false)
122 m_value.addListener(listener, silent_add);
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
The core of the default object to store data of any type that should persist through sessions of the ...
Definition ApplicationOptions.h:23
virtual bool isDefault() const =0
virtual void setToDefaultValue()=0
virtual INIOption * iniOption()=0
virtual String toString() const =0
virtual void fromString(const String &)=0
virtual ~ApplicationOptionBase()
Definition ApplicationOptions.h:25
The default object to store data of any type that should persist through sessions of the application.
Definition Button.h:57
Resource< t_type > & getResource()
Definition ApplicationOptions.h:106
ApplicationOptions & m_options
Definition ApplicationOptions.h:156
virtual void fromString(const String &value) override
Definition ApplicationOptions.h:128
void set(const t_type &value, bool make_default=false)
Definition ApplicationOptions.h:110
virtual void setToDefaultValue() override
Definition ApplicationOptions.h:136
virtual INIOption * iniOption() override
Definition ApplicationOptions.h:140
const TranslatedString m_group
Definition ApplicationOptions.h:153
ApplicationOption(const TranslatedString &group, const TranslatedString &label, const t_type &value, ApplicationOptions &options=ApplicationOptions::UserOptions())
Definition ApplicationOptions.h:85
virtual String toString() const override
Definition ApplicationOptions.h:124
const TranslatedString m_label
Definition ApplicationOptions.h:154
t_type m_default_value
Definition ApplicationOptions.h:157
ApplicationOption(const TranslatedString &label, const t_type &value, ApplicationOptions &options=ApplicationOptions::UserOptions())
Definition ApplicationOptions.h:94
const TranslatedString & label() const
Definition ApplicationOptions.h:144
void addListener(ResourceListener *listener, bool silent_add=false)
Definition ApplicationOptions.h:120
const TranslatedString & group() const
Definition ApplicationOptions.h:148
t_type get() const
Definition ApplicationOptions.h:102
virtual bool isDefault() const override
Definition ApplicationOptions.h:132
Resource< t_type > m_value
Definition ApplicationOptions.h:155
void setDefaultValue(const t_type &value)
Definition ApplicationOptions.h:116
The container for storing N-number of ApplicationOption for the program. Almost all options are typic...
Definition ApplicationOptions.h:42
const ApplicationOptionBase * getOption(const TranslatedString &group, const TranslatedString &name) const
Definition ApplicationOptions.h:54
const ApplicationOptionBase * getOption(const TranslatedString &name) const
Definition ApplicationOptions.h:58
void addOption(const TranslatedString &group_name, const TranslatedString &name, ApplicationOptionBase *value)
Definition ApplicationOptions.h:49
void addOption(const TranslatedString &name, ApplicationOptionBase *value)
Definition ApplicationOptions.h:45
static ApplicationOptions & UserOptions()
Definition ApplicationOptions.cpp:77
Dictionary< TranslatedString, Dictionary< TranslatedString, ApplicationOptionBase * > > m_options
Definition ApplicationOptions.h:69
Definition Dictionary.h:48
Definition INIReader.h:57
static INIOption * ToOption(t_type &mem_loc)
Definition INIReader.h:225
Definition INIReader.h:45
Definition ProgressInfo.hpp:43
Definition ResourceListener.h:55
t_type getAs() const
Definition String.h:334
Definition TranslatedString.h:9