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)
 
wxConfigBase * GetConfig () 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 74 of file Prefs.h.

Constructor & Destructor Documentation

◆ SettingBase() [1/4]

SettingBase::SettingBase ( const char *  path)
inline

Definition at line 77 of file Prefs.h.

77: mPath{ path } {}
const SettingPath mPath
Definition: Prefs.h:90

◆ SettingBase() [2/4]

SettingBase::SettingBase ( const wxChar *  path)
inline

Definition at line 78 of file Prefs.h.

78: mPath{ path } {}

◆ SettingBase() [3/4]

SettingBase::SettingBase ( const wxString &  path)
inline

Definition at line 79 of file Prefs.h.

79: 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 507 of file Prefs.cpp.

508{
509 auto config = GetConfig();
510 return config && config->DeleteEntry( GetPath() );
511}
wxConfigBase * GetConfig() const
Definition: Prefs.cpp:502
const SettingPath & GetPath() const
Definition: Prefs.h:83

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()

wxConfigBase * SettingBase::GetConfig ( ) const

Definition at line 502 of file Prefs.cpp.

503{
504 return gPrefs;
505}
FileConfig * gPrefs
Definition: Prefs.cpp:70

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 90 of file Prefs.h.

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


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