Audacity 3.2.0
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]
Collaboration diagram for SettingBase:
[legend]

Public Member Functions

 SettingBase (const char *path)
 
 SettingBase (const wxChar *path)
 
 SettingBase (const wxString &path)
 
audacity::BasicSettingsGetConfig () const
 
const SettingPathGetPath () 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 SettingPath mPath
 

Detailed Description

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

Definition at line 79 of file Prefs.h.

Constructor & Destructor Documentation

◆ SettingBase() [1/4]

SettingBase::SettingBase ( const char *  path)
inline

Definition at line 82 of file Prefs.h.

82: mPath{ path } {}
const SettingPath mPath
Definition: Prefs.h:95

◆ SettingBase() [2/4]

SettingBase::SettingBase ( const wxChar *  path)
inline

Definition at line 83 of file Prefs.h.

83: mPath{ path } {}

◆ SettingBase() [3/4]

SettingBase::SettingBase ( const wxString &  path)
inline

Definition at line 84 of file Prefs.h.

84: 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 549 of file Prefs.cpp.

550{
551 auto config = GetConfig();
552 return config && config->DeleteEntry( GetPath() );
553}
audacity::BasicSettings * GetConfig() const
Definition: Prefs.cpp:544
const SettingPath & GetPath() const
Definition: Prefs.h:88

References GetConfig(), and GetPath().

Referenced by TracksPrefs::Commit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetConfig()

audacity::BasicSettings * SettingBase::GetConfig ( ) const

Definition at line 544 of file Prefs.cpp.

545{
546 return gPrefs;
547}
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68

References gPrefs.

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

Here is the caller graph for this function:

◆ GetPath()

const SettingPath & SettingBase::GetPath ( ) const
inline

Member Data Documentation

◆ mPath

const SettingPath SettingBase::mPath
protected

Definition at line 95 of file Prefs.h.

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


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