neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::settings Class Reference

#include <settings.hpp>

Inheritance diagram for neolib::settings:
neolib::reference_counted< i_settings > neolib::i_settings neolib::i_reference_counted

Public Member Functions

 define_declared_event (SettingChanging, setting_changing, const i_setting &) define_declared_event(SettingChanged
 
const i_settingdefine_declared_event (SettingDeleted, setting_deleted, const i_setting &) define_declared_event(SettingsChanged
 
 settings (const i_string &aFileName)
 
 settings (const i_application &aApp, const i_string &aFileName=string{ "settings.xml" })
 
void register_category (i_string const &aCategorySubkey, i_string const &aCategoryTitle=string{}) override
 
void register_group (i_string const &aGroupSubkey, i_string const &aGroupTitle=string{}) override
 
void register_setting (i_setting &aSetting) override
 
category_titles constall_categories () const override
 
i_string constcategory_title (i_string const &aCategorySubkey) const override
 
group_titles constall_groups () const override
 
i_string constgroup_title (i_string const &aGroupSubkey) const override
 
setting_list constall_settings () const override
 
setting_ordered_list constall_settings_ordered () const override
 
i_setting constsetting (i_string const &aKey) const override
 
i_settingsetting (i_string const &aKey) override
 
void change_setting (i_setting &aExistingSetting, const i_setting_value &aValue, bool aApplyNow=true) override
 
void delete_setting (i_setting &aExistingSetting) override
 
void apply_changes () override
 
void discard_changes () override
 
bool modified () const override
 
void register_friendly_text (i_setting const &aSetting, i_string const &aText, i_string const &aFriendlyText) override
 
i_string constfriendly_text (i_setting const &aSetting, i_string const &aText) const override
 
void load () override
 
void save () const override
 
void changing_setting (i_setting const &aSetting) override
 
void changed_setting (i_setting const &aSetting) override
 
virtual void register_category (i_string const &aCategorySubkey, i_string const &aCategoryTitle=string{})=0
 
void register_category (string const &aCategorySubkey, string const &aCategoryTitle=string{})
 
virtual void register_group (i_string const &aGroupSubkey, i_string const &aGroupTitle=string{})=0
 
void register_group (string const &aGroupSubkey, string const &aGroupTitle=string{})
 
virtual void register_setting (i_setting &aSetting)=0
 
template<typename T >
i_settingregister_setting (string const &aKey, T const &aDefaultValue, setting_constraints< as_setting_t< T > > const &aSettingConstraints, string const &aFormat={})
 
template<typename T >
i_settingregister_setting (string const &aKey, T const &aDefaultValue, string const &aFormat={})
 
- Public Member Functions inherited from neolib::reference_counted< i_settings >
 reference_counted () noexcept
 
 reference_counted (const reference_counted &aOther) noexcept
 
 ~reference_counted ()
 
reference_countedoperator= (const reference_counted &)
 
void add_ref () const noexcept override
 
void release () const override
 
int32_t use_count () const noexcept override
 
const base_typerelease_and_take_ownership () const override
 
base_typerelease_and_take_ownership () override
 
void pin () const noexcept override
 
void unpin () const override
 
i_ref_control_blockcontrol_block () override
 
- Public Member Functions inherited from neolib::i_settings
 declare_event (setting_changing, const i_setting &) declare_event(setting_changed
 
const i_settingdeclare_event (setting_deleted, const i_setting &) declare_event(settings_changed
 
void register_category (string const &aCategorySubkey, string const &aCategoryTitle=string{})
 
void register_group (string const &aGroupSubkey, string const &aGroupTitle=string{})
 
template<typename T >
i_settingregister_setting (string const &aKey, T const &aDefaultValue, setting_constraints< as_setting_t< T > > const &aSettingConstraints, string const &aFormat={})
 
template<typename T >
i_settingregister_setting (string const &aKey, T const &aDefaultValue, string const &aFormat={})
 
template<typename T >
void change_setting (i_setting &aExistingSetting, T const &aValue, bool aApplyNow=true)
 
- Public Member Functions inherited from neolib::i_reference_counted
virtual ~i_reference_counted ()=default
 

Public Attributes

 setting_changed
 
const i_setting settings_changed
 

Additional Inherited Members

- Public Types inherited from neolib::i_settings
typedef i_settings abstract_type
 
- Static Public Member Functions inherited from neolib::i_settings
static uuid constiid ()
 

Detailed Description

Definition at line 55 of file settings.hpp.

Constructor & Destructor Documentation

◆ settings() [1/2]

neolib::settings::settings ( const i_string aFileName)

◆ settings() [2/2]

neolib::settings::settings ( const i_application aApp,
const i_string aFileName = string{ "settings.xml" } 
)

Member Function Documentation

◆ all_categories()

category_titles const & neolib::settings::all_categories ( ) const
overridevirtual

Implements neolib::i_settings.

◆ all_groups()

group_titles const & neolib::settings::all_groups ( ) const
overridevirtual

Implements neolib::i_settings.

◆ all_settings()

setting_list const & neolib::settings::all_settings ( ) const
overridevirtual

Implements neolib::i_settings.

◆ all_settings_ordered()

setting_ordered_list const & neolib::settings::all_settings_ordered ( ) const
overridevirtual

Implements neolib::i_settings.

◆ apply_changes()

void neolib::settings::apply_changes ( )
overridevirtual

Implements neolib::i_settings.

◆ category_title()

i_string const & neolib::settings::category_title ( i_string const aCategorySubkey) const
overridevirtual

Implements neolib::i_settings.

◆ change_setting()

void neolib::settings::change_setting ( i_setting aExistingSetting,
const i_setting_value aValue,
bool  aApplyNow = true 
)
overridevirtual

Implements neolib::i_settings.

◆ changed_setting()

void neolib::settings::changed_setting ( i_setting const aSetting)
overridevirtual

Implements neolib::i_settings.

◆ changing_setting()

void neolib::settings::changing_setting ( i_setting const aSetting)
overridevirtual

Implements neolib::i_settings.

◆ define_declared_event() [1/2]

neolib::settings::define_declared_event ( SettingChanging  ,
setting_changing  ,
const i_setting  
)

◆ define_declared_event() [2/2]

const i_setting & neolib::settings::define_declared_event ( SettingDeleted  ,
setting_deleted  ,
const i_setting  
)

◆ delete_setting()

void neolib::settings::delete_setting ( i_setting aExistingSetting)
overridevirtual

Implements neolib::i_settings.

◆ discard_changes()

void neolib::settings::discard_changes ( )
overridevirtual

Implements neolib::i_settings.

◆ friendly_text()

i_string const & neolib::settings::friendly_text ( i_setting const aSetting,
i_string const aText 
) const
overridevirtual

Implements neolib::i_settings.

◆ group_title()

i_string const & neolib::settings::group_title ( i_string const aGroupSubkey) const
overridevirtual

Implements neolib::i_settings.

◆ load()

void neolib::settings::load ( )
overridevirtual

Implements neolib::i_settings.

◆ modified()

bool neolib::settings::modified ( ) const
overridevirtual

Implements neolib::i_settings.

◆ register_category() [1/3]

void neolib::settings::register_category ( i_string const aCategorySubkey,
i_string const aCategoryTitle = string{} 
)
overridevirtual

Implements neolib::i_settings.

◆ register_category() [2/3]

virtual void neolib::i_settings::register_category ( i_string const aCategorySubkey,
i_string const aCategoryTitle = string{} 
)
virtual

Implements neolib::i_settings.

◆ register_category() [3/3]

void neolib::i_settings::register_category ( string const aCategorySubkey,
string const aCategoryTitle = string{} 
)
inline

Definition at line 107 of file i_settings.hpp.

◆ register_friendly_text()

void neolib::settings::register_friendly_text ( i_setting const aSetting,
i_string const aText,
i_string const aFriendlyText 
)
overridevirtual

Implements neolib::i_settings.

◆ register_group() [1/3]

void neolib::settings::register_group ( i_string const aGroupSubkey,
i_string const aGroupTitle = string{} 
)
overridevirtual

Implements neolib::i_settings.

◆ register_group() [2/3]

virtual void neolib::i_settings::register_group ( i_string const aGroupSubkey,
i_string const aGroupTitle = string{} 
)
virtual

Implements neolib::i_settings.

◆ register_group() [3/3]

void neolib::i_settings::register_group ( string const aGroupSubkey,
string const aGroupTitle = string{} 
)
inline

Definition at line 111 of file i_settings.hpp.

◆ register_setting() [1/4]

void neolib::settings::register_setting ( i_setting aSetting)
overridevirtual

Implements neolib::i_settings.

◆ register_setting() [2/4]

virtual void neolib::i_settings::register_setting ( i_setting aSetting)
virtual

Implements neolib::i_settings.

◆ register_setting() [3/4]

template<typename T >
i_setting & neolib::i_settings::register_setting ( string const aKey,
T const aDefaultValue,
setting_constraints< as_setting_t< T > > const aSettingConstraints,
string const aFormat = {} 
)
inline

Definition at line 116 of file i_settings.hpp.

◆ register_setting() [4/4]

template<typename T >
i_setting & neolib::i_settings::register_setting ( string const aKey,
T const aDefaultValue,
string const aFormat = {} 
)
inline

Definition at line 123 of file i_settings.hpp.

◆ save()

void neolib::settings::save ( ) const
overridevirtual

Implements neolib::i_settings.

◆ setting() [1/2]

i_setting const & neolib::settings::setting ( i_string const aKey) const
overridevirtual

Implements neolib::i_settings.

◆ setting() [2/2]

i_setting & neolib::settings::setting ( i_string const aKey)
overridevirtual

Implements neolib::i_settings.

Member Data Documentation

◆ setting_changed

neolib::settings::setting_changed

Definition at line 59 of file settings.hpp.

◆ settings_changed

const i_setting neolib::settings::settings_changed

Definition at line 61 of file settings.hpp.


The documentation for this class was generated from the following file: