Audacity  3.0.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SettingBase Class Reference

Base class for settings objects. It holds a configuration key path. More...

#include <Prefs.h>

Inheritance diagram for SettingBase:
[legend]

Public Member Functions

 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...
 

Protected Member Functions

 SettingBase (const SettingBase &)=default
 

Protected Attributes

const RegistryPath mPath
 

Detailed Description

Base class for settings objects. It holds a configuration key path.

Definition at line 66 of file Prefs.h.

Constructor & Destructor Documentation

◆ SettingBase() [1/4]

SettingBase::SettingBase ( const char *  path)
inline

Definition at line 69 of file Prefs.h.

69 : mPath{ path } {}

◆ SettingBase() [2/4]

SettingBase::SettingBase ( const wxChar *  path)
inline

Definition at line 70 of file Prefs.h.

70 : mPath{ path } {}

◆ SettingBase() [3/4]

SettingBase::SettingBase ( const wxString &  path)
inline

Definition at line 71 of file Prefs.h.

71 : mPath{ path } {}

◆ SettingBase() [4/4]

SettingBase::SettingBase ( const SettingBase )
protecteddefault

Member Function Documentation

◆ Delete()

bool SettingBase::Delete ( )

Delete the key if present, and return true iff it was.

Definition at line 454 of file Prefs.cpp.

455 {
456  auto config = GetConfig();
457  return config && config->DeleteEntry( GetPath() );
458 }

References GetConfig(), and GetPath().

Here is the call graph for this function:

◆ GetConfig()

wxConfigBase * SettingBase::GetConfig ( ) const

Definition at line 449 of file Prefs.cpp.

450 {
451  return gPrefs;
452 }

References gPrefs.

Referenced by Delete(), Setting< bool >::DoWrite(), Setting< bool >::ReadWithDefault(), and Setting< bool >::Write().

Here is the caller graph for this function:

◆ GetPath()

const wxString& SettingBase::GetPath ( ) const
inline

Member Data Documentation

◆ mPath

const RegistryPath SettingBase::mPath
protected

Definition at line 82 of file Prefs.h.

Referenced by Setting< bool >::DoWrite(), and Setting< bool >::ReadWithDefault().


The documentation for this class was generated from the following files:
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
SettingBase::GetPath
const wxString & GetPath() const
Definition: Prefs.h:75
SettingBase::mPath
const RegistryPath mPath
Definition: Prefs.h:82
SettingBase::GetConfig
wxConfigBase * GetConfig() const
Definition: Prefs.cpp:449