Audacity  3.0.3
Public Member Functions | List of all members
StringSetting Class Referencefinal

Specialization of Setting for strings. More...

#include <Prefs.h>

Inheritance diagram for StringSetting:
[legend]
Collaboration diagram for StringSetting:
[legend]

Public Member Functions

 Setting (const SettingBase &path, const T &defaultValue)
 Usual overload supplies a default value. More...
 
 Setting (const SettingBase &path, DefaultValueFunction function)
 This overload causes recomputation of the default each time it is needed. More...
 
- Public Member Functions inherited from Setting< wxString >
 Setting (const SettingBase &path, const wxString &defaultValue)
 Usual overload supplies a default value. More...
 
 Setting (const SettingBase &path, DefaultValueFunction function)
 This overload causes recomputation of the default each time it is needed. More...
 
const wxString & GetDefault () const
 
bool Read (wxString *pVar) const
 overload of Read returning a boolean that is true if the value was previously defined *‍/ More...
 
wxString Read () const
 overload of Read, always returning a value More...
 
bool ReadWithDefault (wxString *pVar, const wxString &defaultValue) const
 overload of ReadWithDefault returning a boolean that is true if the value was previously defined *‍/ More...
 
wxString ReadWithDefault (const wxString &defaultValue) const
 new direct use is discouraged but it may be needed in legacy code More...
 
bool Write (const wxString &value)
 Write value to config and return true if successful. More...
 
bool Reset ()
 Reset to the default value. More...
 
- Public Member Functions inherited from CachingSettingBase< wxString >
 CachingSettingBase (const SettingBase &path)
 
- Public Member Functions inherited from SettingBase
 SettingBase (const char *path)
 
 SettingBase (const wxChar *path)
 
 SettingBase (const wxString &path)
 
wxConfigBase * GetConfig () const
 
const wxString & GetPath () const
 
bool Delete ()
 Delete the key if present, and return true iff it was. More...
 

Additional Inherited Members

- Public Types inherited from Setting< wxString >
using DefaultValueFunction = std::function< wxString() >
 
- Protected Member Functions inherited from Setting< wxString >
bool DoWrite ()
 Write cached value to config and return true if successful. More...
 
- Protected Member Functions inherited from CachingSettingBase< wxString >
 CachingSettingBase (const CachingSettingBase &)=default
 
- Protected Member Functions inherited from SettingBase
 SettingBase (const SettingBase &)=default
 
- Protected Attributes inherited from Setting< wxString >
wxString mDefaultValue
 
const DefaultValueFunction mFunction
 
- Protected Attributes inherited from CachingSettingBase< wxString >
wxString mCurrentValue
 
bool mValid
 
- Protected Attributes inherited from SettingBase
const RegistryPath mPath
 

Detailed Description

Specialization of Setting for strings.

Definition at line 227 of file Prefs.h.

Member Function Documentation

◆ Setting() [1/2]

Setting< T >::Setting
inline

Usual overload supplies a default value.

Definition at line 108 of file Prefs.h.

109  : CachingSettingBase< T >{ path }
110  , mDefaultValue{ defaultValue }
111  {}

◆ Setting() [2/2]

Setting< T >::Setting
inline

This overload causes recomputation of the default each time it is needed.

Definition at line 114 of file Prefs.h.

115  : CachingSettingBase< T >{ path }
116  , mFunction{ function }
117  {}

The documentation for this class was generated from the following file:
Setting< wxString >::mDefaultValue
wxString mDefaultValue
Definition: Prefs.h:198
Setting< wxString >::mFunction
const DefaultValueFunction mFunction
Definition: Prefs.h:199
CachingSettingBase
Class template adds an in-memory cache of a value to SettingBase.
Definition: Prefs.h:88