Audacity 3.2.0
|
#include <SettingsWX.h>
Public Member Functions | |
SettingsWX (std::shared_ptr< wxConfigBase > config) | |
SettingsWX (const wxString &filepath) | |
Constructs BasicSettings object to access BasicSettings stored in the file, using platform-specific format. More... | |
~SettingsWX () override | |
wxString | GetGroup () const override |
Returns current group prefix. More... | |
wxArrayString | GetChildGroups () const override |
Returns all child groups within the current group. More... | |
wxArrayString | GetChildKeys () const override |
Returns all child keys within the current group. More... | |
bool | HasEntry (const wxString &key) const override |
Checks whether specified key exists within the current group. More... | |
bool | HasGroup (const wxString &key) const override |
Checks whether specified group exists relative to the current group. More... | |
bool | Remove (const wxString &key) override |
Removes group or entry within the current group, if exists. Pass empty string to remove each entry in the current group. More... | |
void | Clear () override |
Remove all groups and keys. More... | |
bool | Read (const wxString &key, bool *value) const override |
bool | Read (const wxString &key, int *value) const override |
bool | Read (const wxString &key, long *value) const override |
bool | Read (const wxString &key, long long *value) const override |
bool | Read (const wxString &key, double *value) const override |
bool | Read (const wxString &key, wxString *value) const override |
bool | Write (const wxString &key, bool value) override |
bool | Write (const wxString &key, int value) override |
bool | Write (const wxString &key, long value) override |
bool | Write (const wxString &key, long long value) override |
bool | Write (const wxString &key, double value) override |
bool | Write (const wxString &key, const wxString &value) override |
bool | Flush () noexcept override |
Public Member Functions inherited from audacity::BasicSettings | |
BasicSettings () | |
virtual | ~BasicSettings () |
BasicSettings (const BasicSettings &)=delete | |
BasicSettings (BasicSettings &&)=default | |
BasicSettings & | operator= (const BasicSettings &)=delete |
BasicSettings & | operator= (BasicSettings &&)=default |
virtual wxString | GetGroup () const =0 |
Returns current group prefix. More... | |
virtual wxArrayString | GetChildGroups () const =0 |
Returns all child groups within the current group. More... | |
virtual wxArrayString | GetChildKeys () const =0 |
Returns all child keys within the current group. More... | |
virtual bool | HasEntry (const wxString &key) const =0 |
Checks whether specified key exists within the current group. More... | |
virtual bool | HasGroup (const wxString &key) const =0 |
Checks whether specified group exists relative to the current group. More... | |
virtual bool | Exists (const wxString &key) const |
Returns true if group or entry exists. More... | |
virtual bool | Remove (const wxString &key)=0 |
Removes group or entry within the current group, if exists. Pass empty string to remove each entry in the current group. More... | |
virtual void | Clear ()=0 |
Remove all groups and keys. More... | |
bool | DeleteGroup (const wxString &key) |
Deletes specified group if exists. More... | |
bool | DeleteEntry (const wxString &key) |
Deletes specified entry if exists. More... | |
GroupScope | BeginGroup (const wxString &prefix) |
Appends a prefix to the current group or sets a new absolute path. Group that was set as current before BeginGroup is called, will be restored once GroupScope is destroyed. More... | |
virtual bool | Read (const wxString &key, bool *value) const =0 |
virtual bool | Read (const wxString &key, int *value) const =0 |
virtual bool | Read (const wxString &key, long *value) const =0 |
virtual bool | Read (const wxString &key, long long *value) const =0 |
virtual bool | Read (const wxString &key, double *value) const =0 |
virtual bool | Read (const wxString &key, wxString *value) const =0 |
virtual bool | Read (const wxString &key, float *value) const |
template<typename T > | |
bool | Read (const wxString &key, T *value) const |
Uses wxFromString to read object. More... | |
template<typename T > | |
std::enable_if_t< std::is_scalar_v< T >, bool > | Read (const wxString &key, T *value, T defaultValue) const |
template<typename T > | |
std::enable_if_t<!std::is_scalar_v< T >, bool > | Read (const wxString &key, T *value, const T &defaultValue) |
wxString | Read (const wxString &key, const wxString &defaultValue=wxEmptyString) const |
wxString | Read (const wxString &key, const char *defaultValue) const |
wxString | Read (const wxString &key, const wchar_t *defaultValue) const |
template<typename T > | |
std::enable_if_t< std::is_scalar_v< T >, T > | Read (const wxString &key, T defaultValue) const |
template<typename T > | |
std::enable_if_t<!std::is_scalar_v< T >, T > | Read (const wxString &key, const T &defaultValue) const |
virtual bool | Write (const wxString &key, bool value)=0 |
virtual bool | Write (const wxString &key, int value)=0 |
virtual bool | Write (const wxString &key, long value)=0 |
virtual bool | Write (const wxString &key, long long value)=0 |
virtual bool | Write (const wxString &key, double value)=0 |
virtual bool | Write (const wxString &key, const wxString &value)=0 |
virtual bool | Write (const wxString &key, float value) |
virtual bool | Write (const wxString &key, const char *value) |
virtual bool | Write (const wxString &key, const wchar_t *value) |
template<typename T > | |
bool | Write (const wxString &key, const T &value) |
Uses wxToString to convert object into string. More... | |
virtual bool | Flush () noexcept=0 |
bool | ReadBool (const wxString &key, bool defaultValue) const |
long | ReadLong (const wxString &key, long defaultValue) const |
double | ReadDouble (const wxString &key, double defaultValue) const |
template<typename T > | |
T | ReadObject (const wxString &key, const T &defaultValue) const |
Protected Member Functions | |
void | DoBeginGroup (const wxString &prefix) override |
void | DoEndGroup () noexcept override |
virtual void | DoBeginGroup (const wxString &prefix)=0 |
virtual void | DoEndGroup () noexcept=0 |
Private Member Functions | |
wxString | MakePath (const wxString &key) const |
Private Attributes | |
wxArrayString | mGroupStack |
std::shared_ptr< wxConfigBase > | mConfig |
Definition at line 11 of file SettingsWX.h.
|
explicit |
Definition at line 32 of file SettingsWX.cpp.
References mGroupStack.
|
explicit |
Constructs BasicSettings object to access BasicSettings stored in the file, using platform-specific format.
Definition at line 38 of file SettingsWX.cpp.
References mConfig, and mGroupStack.
|
override |
|
overridevirtual |
Remove all groups and keys.
Implements audacity::BasicSettings.
Definition at line 119 of file SettingsWX.cpp.
References mConfig.
|
overrideprotectedvirtual |
Implements audacity::BasicSettings.
Definition at line 7 of file SettingsWX.cpp.
References mConfig, and mGroupStack.
|
overrideprotectedvirtualnoexcept |
Implements audacity::BasicSettings.
Definition at line 22 of file SettingsWX.cpp.
References mConfig, and mGroupStack.
|
overridevirtualnoexcept |
Implements audacity::BasicSettings.
Definition at line 190 of file SettingsWX.cpp.
References mConfig.
|
overridevirtual |
Returns all child groups within the current group.
Implements audacity::BasicSettings.
Definition at line 60 of file SettingsWX.cpp.
References mConfig.
Referenced by Remove().
|
overridevirtual |
Returns all child keys within the current group.
Implements audacity::BasicSettings.
Definition at line 76 of file SettingsWX.cpp.
Referenced by Remove().
|
overridevirtual |
Returns current group prefix.
Implements audacity::BasicSettings.
Definition at line 49 of file SettingsWX.cpp.
References mGroupStack.
|
overridevirtual |
Checks whether specified key exists within the current group.
Implements audacity::BasicSettings.
Definition at line 91 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Checks whether specified group exists relative to the current group.
Implements audacity::BasicSettings.
Definition at line 96 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
private |
Definition at line 203 of file SettingsWX.cpp.
References key, and mGroupStack.
Referenced by HasEntry(), HasGroup(), Read(), Remove(), and Write().
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 124 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 150 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 129 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 134 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 139 of file SettingsWX.cpp.
References key, MakePath(), mConfig, and str.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 155 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Removes group or entry within the current group, if exists. Pass empty string to remove each entry in the current group.
Implements audacity::BasicSettings.
Definition at line 101 of file SettingsWX.cpp.
References entry, GetChildGroups(), GetChildKeys(), key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 160 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 185 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 180 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 165 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 175 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
overridevirtual |
Implements audacity::BasicSettings.
Definition at line 170 of file SettingsWX.cpp.
References key, MakePath(), and mConfig.
|
private |
Definition at line 14 of file SettingsWX.h.
Referenced by Clear(), DoBeginGroup(), DoEndGroup(), Flush(), GetChildGroups(), GetChildKeys(), HasEntry(), HasGroup(), Read(), Remove(), SettingsWX(), Write(), and ~SettingsWX().
|
private |
Definition at line 13 of file SettingsWX.h.
Referenced by DoBeginGroup(), DoEndGroup(), GetGroup(), MakePath(), and SettingsWX().