Audacity 3.2.0
Prefs.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 Prefs.h
6
7 Dominic Mazzoni
8 Markus Meyer
9
10 Audacity uses wxWidgets' wxFileConfig class to handle preferences.
11 In Audacity versions prior to 1.3.1, it used wxConfig, which would
12 store the prefs in a platform-dependent way (e.g. in the registry
13 on Windows). Now it always stores the settings in a configuration file
14 in the Audacity Data Directory.
15
16 Every time we read a preference, we need to specify the default
17 value for that preference, to be used if the preference hasn't
18 been set before.
19
20 So, to avoid code duplication, we provide functions in this file
21 to read and write preferences which have a nonobvious default
22 value, so that if we later want to change this value, we only
23 have to change it in one place.
24
25 See Prefs.cpp for a (complete?) list of preferences we keep
26 track of...
27
28**********************************************************************/
29#ifndef __AUDACITY_PREFS__
30#define __AUDACITY_PREFS__
31
32#include <functional>
33#include <set>
34#include <vector>
35
36// Increment this every time the prefs need to be reset
37// the first part (before the r) indicates the version the reset took place
38// the second part (after the r) indicates the number of times the prefs have been reset within the same version
39#define AUDACITY_PREFS_VERSION_STRING "1.1.1r1"
40
41#include <functional>
42
44#include "wxArrayStringEx.h"
45
46#include <wx/filename.h>
47#include <wx/textfile.h>
48
49#include "GlobalVariable.h"
50
51#include "BasicSettings.h"
52#include "MemoryX.h"
53
54PREFERENCES_API void InitPreferences( std::unique_ptr<audacity::BasicSettings> uPrefs );
55PREFERENCES_API void GetPreferencesVersion(int& vMajor, int& vMinor, int& vMicro);
56PREFERENCES_API void SetPreferencesVersion(int vMajor, int vMinor, int vMicor);
58
62PREFERENCES_API void ResetPreferences();
63PREFERENCES_API void FinishPreferences();
64
65extern PREFERENCES_API audacity::BasicSettings *gPrefs;
66extern int gMenusDirty;
67
68
69struct ByColumns_t{};
70extern PREFERENCES_API ByColumns_t ByColumns;
71
74 operator const RegistryPath &() const { return mPath; }
75};
76
78/* The constructors are non-explicit for convenience */
79class PREFERENCES_API SettingBase
80{
81public:
82 SettingBase( const char *path ) : mPath{ path } {}
83 SettingBase( const wxChar *path ) : mPath{ path } {}
84 SettingBase( const wxString &path ) : mPath{ path } {}
85
87
88 const SettingPath &GetPath() const { return mPath; }
89
91 bool Delete();
92
93protected:
94 SettingBase( const SettingBase& ) = default;
96};
97
99{
100public:
102
103 virtual void Invalidate() = 0;
104
105protected:
106 // Methods below should only be callable
107 // from within a transaction.
108 friend class SettingTransaction;
109 friend class SettingScope;
110
111 virtual void EnterTransaction(size_t depth) = 0;
113 virtual bool Commit() = 0;
114 virtual void Rollback() noexcept = 0;
115};
116
118
119class PREFERENCES_API SettingScope /* not final */
120{
121public:
122 SettingScope();
123 ~SettingScope() noexcept;
124 SettingScope(const SettingScope&) = delete;
126
134 static AddResult Add( TransactionalSettingBase& setting );
135
136protected:
137 std::set< TransactionalSettingBase * > mPending;
138 bool mCommitted = false;
139};
140
142
148class PREFERENCES_API SettingTransaction final : public SettingScope
149{
150public:
152
154 bool Commit();
155};
156
160template< typename T >
162{
163public:
164 using TransactionalSettingBase::TransactionalSettingBase;
165 explicit CachingSettingBase( const SettingBase &path )
166 : TransactionalSettingBase{ path.GetPath() } {}
167
168protected:
170 mutable T mCurrentValue{};
171 mutable bool mValid{false};
172};
173
176template< typename T >
177class Setting : public CachingSettingBase< T >
178{
179public:
180 using ValueType = T;
181
183
184 using DefaultValueFunction = std::function< T() >;
185
187 Setting( const SettingBase &path, const T &defaultValue )
188 : CachingSettingBase< T >{ path }
189 , mDefaultValue{ defaultValue }
190 {}
191
193 Setting( const SettingBase &path, DefaultValueFunction function )
194 : CachingSettingBase< T >{ path }
195 , mFunction{ function }
196 {}
197
198
199 const T& GetDefault() const
200 {
201 if ( mFunction )
202 mDefaultValue = mFunction();
203 return mDefaultValue;
204 }
205
207 bool Read( T *pVar ) const
208 {
209 return ReadWithDefault( pVar, GetDefault() );
210 }
211
213 bool ReadWithDefault( T *pVar, const T& defaultValue ) const
214 {
215 if ( pVar )
216 *pVar = defaultValue;
217 if ( pVar && this->mValid ) {
218 *pVar = this->mCurrentValue;
219 return true;
220 }
221 const auto config = this->GetConfig();
222 if ( pVar && config ) {
223 if ((this->mValid = config->Read( this->mPath, &this->mCurrentValue )))
224 *pVar = this->mCurrentValue;
225 return this->mValid;
226 }
227 return (this->mValid = false);
228 }
229
231
233 T Read() const
234 {
235 return ReadWithDefault( GetDefault() );
236 }
237
239
241 T ReadWithDefault( const T &defaultValue ) const
242 {
243 if (this->mValid)
244 return this->mCurrentValue;
245 const auto config = this->GetConfig();
246 if (config) {
247 this->mCurrentValue =
248 config->ReadObject(this->mPath, defaultValue);
249 // If config file contains a value that agrees with the default, we
250 // can't detect that, so assume invalidity still
251 this->mValid = (this->mCurrentValue != defaultValue);
252 return this->mCurrentValue;
253 }
254 else
255 return T{};
256 }
257
259 bool Write( const T &value )
260 {
261 const auto config = this->GetConfig();
262
263 if (config == nullptr)
264 return false;
265
266 switch ( SettingScope::Add( *this ) ) {
267 // Eager writes, but not flushed, when there is no transaction
268 default:
270 this->mCurrentValue = value;
271 return DoWrite();
272 }
273
274 // Deferred writes, with flush, if there is a commit later
277 this->mCurrentValue = value;
278 this->mValid = true;
279 return true;
280 }
281 }
282
284 bool Reset()
285 {
286 return Write( GetDefault() );
287 }
288
289 void Invalidate() override
290 {
291 this->mValid = false;
292 }
293
294private:
295 void EnterTransaction(size_t depth) override
296 {
297 const T value = Read();
298
299 for (size_t i = mPreviousValues.size(); i < depth; ++i)
300 this->mPreviousValues.emplace_back( value );
301 }
302
303 bool Commit() override
304 {
305 // This can be only called from within the transaction
306 assert(!this->mPreviousValues.empty());
307
308 if (this->mPreviousValues.empty())
309 return false;
310
311 const auto result = this->mPreviousValues.size() > 1 || DoWrite();
312 mPreviousValues.pop_back();
313
314 return result;
315 }
316
317 void Rollback() noexcept override
318 {
319 // This can be only called from within the transaction
320 assert(!this->mPreviousValues.empty());
321
322 if (!this->mPreviousValues.empty())
323 {
324 this->mCurrentValue = std::move(this->mPreviousValues.back());
325 this->mPreviousValues.pop_back();
326 }
327 }
328
329protected:
331
332 bool DoWrite( )
333 {
334 const auto config = this->GetConfig();
335 return this->mValid =
336 config ? config->Write( this->mPath, this->mCurrentValue ) : false;
337 }
338
340 mutable T mDefaultValue{};
341 std::vector<T> mPreviousValues;
342};
343
345class PREFERENCES_API BoolSetting final : public Setting< bool >
346{
347public:
348 using Setting::Setting;
349
351 bool Toggle();
352};
353
355class IntSetting final : public Setting< int >
356{
357public:
358 using Setting::Setting;
359};
360
362class DoubleSetting final : public Setting< double >
363{
364public:
365 using Setting::Setting;
366};
367
369class StringSetting final : public Setting< wxString >
370{
371public:
372 using Setting::Setting;
373};
374
376
380class PREFERENCES_API EnumValueSymbols : public std::vector< EnumValueSymbol >
381{
382public:
383 EnumValueSymbols() = default;
384 EnumValueSymbols( std::initializer_list<EnumValueSymbol> symbols )
385 : vector( symbols )
386 {}
387 EnumValueSymbols( std::vector< EnumValueSymbol > symbols )
388 : vector( symbols )
389 {}
390
391 // columnwise constructor; arguments must have same size
392 // (Implicit constructor takes initial tag argument to avoid unintended
393 // overload resolution to the inherited constructor taking
394 // initializer_list, in the case that each column has exactly two strings)
397 const TranslatableStrings &msgids,
398 wxArrayStringEx internals
399 );
400
401 const TranslatableStrings &GetMsgids() const;
402 const wxArrayStringEx &GetInternals() const;
403
404private:
407};
408
411class PREFERENCES_API ChoiceSetting
412{
413public:
416 ChoiceSetting(const SettingPath &, EnumValueSymbols, long = -1) = delete;
417
420 long defaultSymbol = -1)
421 : mKey{ key.GetPath() }
422 , mSymbols{ move(symbols) }
423 , mpOtherSettings{ &key }
424 , mDefaultSymbol{ defaultSymbol }
425 {
426 assert(defaultSymbol < static_cast<long>(mSymbols.size()));
427 }
428
431 long defaultSymbol = -1)
432 : mKey{ key.GetPath() }
433 , mSymbols{ move(symbols) }
434 , mDefaultSymbol{ defaultSymbol }
435 {
436 assert(defaultSymbol < static_cast<long>(mSymbols.size()));
437 }
438
439 const wxString &Key() const { return mKey; }
440 const EnumValueSymbol &Default() const;
441 const EnumValueSymbols &GetSymbols() const { return mSymbols; }
442
443 wxString Read() const;
444
445 // new direct use is discouraged but it may be needed in legacy code:
446 // use a default in case the preference is not defined, which may not be
447 // the default-default stored in this object.
448 wxString ReadWithDefault( const wxString & ) const;
449
450 bool Write( const wxString &value ); // you flush gPrefs afterward
451
453 void SetDefault( long value );
454
455protected:
456 size_t Find( const wxString &value ) const;
457 virtual void Migrate( wxString& );
458
459 const wxString mKey;
461 TransactionalSettingBase *const mpOtherSettings{};
462
463 // stores an internal value
464 mutable bool mMigrated { false };
465
467};
468
473class PREFERENCES_API EnumSettingBase : public ChoiceSetting {
474public:
476 template<typename Key>
478 Key &&key, // moved string, or lvalue reference to another Setting
479 EnumValueSymbols symbols,
480 long defaultSymbol,
481
482 std::vector<int> intValues, // must have same size as symbols
483 const wxString &oldKey = {}
484 ) : ChoiceSetting{ std::forward<Key>(key), move(symbols), defaultSymbol }
485 , mIntValues{ move(intValues) }
486 , mOldKey{ oldKey }
487 {
488 assert (mIntValues.size() == mSymbols.size());
489 }
490
491protected:
492
493 // Read and write the encoded values
494 int ReadInt() const;
495
496 // new direct use is discouraged but it may be needed in legacy code:
497 // use a default in case the preference is not defined, which may not be
498 // the default-default stored in this object.
499 int ReadIntWithDefault( int defaultValue ) const;
500
501 bool WriteInt( int code ); // you flush gPrefs afterward
502
503 size_t FindInt( int code ) const;
504 void Migrate( wxString& ) override;
505
506private:
507 std::vector<int> mIntValues;
508 const wxString mOldKey;
509};
510
512template< typename Enum >
514{
515public:
516
518 template<typename Key>
520 Key &&key, // moved string, or lvalue reference to another Setting
521 EnumValueSymbols symbols,
522 long defaultSymbol,
523
524 std::vector< Enum > values, // must have same size as symbols
525 const wxString &oldKey = {}
526 )
528 std::forward<Key>(key), move(symbols), defaultSymbol,
529 ConvertValues(values), oldKey
530 }
531 {}
532
533 // Wrap ReadInt() and ReadIntWithDefault() and WriteInt()
534 Enum ReadEnum() const
535 { return static_cast<Enum>( ReadInt() ); }
536
537 // new direct use is discouraged but it may be needed in legacy code:
538 // use a default in case the preference is not defined, which may not be
539 // the default-default stored in this object.
540 Enum ReadEnumWithDefault( Enum defaultValue ) const
541 {
542 auto integer = static_cast<int>(defaultValue);
543 return static_cast<Enum>( ReadIntWithDefault( integer ) );
544 }
545
546 bool WriteEnum( Enum value )
547 { return WriteInt( static_cast<int>( value ) ); }
548
549private:
550 std::vector<int> ConvertValues( const std::vector< Enum > &values)
551 {
552 // To convert scoped enums. This would be easier with std::ranges
553 std::vector<int> result;
554 result.reserve(values.size());
555 for (auto value : values)
556 result.push_back(static_cast<int>(value));
557 return result;
558 }
559};
560
562class PREFERENCES_API PreferencesResetHandler
563{
564 static void Register(std::unique_ptr<PreferencesResetHandler> handler);
565public:
566
568 template<typename HandlerType>
569 struct Registration final
570 {
571 template<typename... Args>
572 Registration(Args&&... args) {
573 Register(std::make_unique<HandlerType>(std::forward<Args>(args)...));
574 }
575 };
576
578
580 virtual void OnSettingResetBegin() = 0;
582 virtual void OnSettingResetEnd() = 0;
583};
584
588template<typename SettingType>
589class StickySetting final
590{
592 {
593 using ValueType = typename SettingType::ValueType;
594
595 SettingType& mSetting;
596
597 std::optional<ValueType> mCapturedValue;
598
599 public:
600 ResetHandler(const ResetHandler&) = delete;
604
605 ResetHandler(SettingType& setting) : mSetting(setting) { }
606 ~ResetHandler() override { assert(!mCapturedValue.has_value()); }
607
608 void OnSettingResetBegin() override
609 {
610 assert(!mCapturedValue.has_value());
611 ValueType value;
612 if(mSetting.Read(&value))
613 mCapturedValue = value;
614 }
615
616 void OnSettingResetEnd() override
617 {
618 if(mCapturedValue.has_value())
619 {
620 auto Do = finally([=]{ mCapturedValue = std::nullopt; });
621 mSetting.Write(*mCapturedValue);
622 }
623 }
624 };
625 SettingType mSetting;
627public:
628 template<typename... Args>
629 StickySetting(Args&& ...args)
630 : mSetting(std::forward<Args>(args)...)
631 , mResetHandlerRegistration(mSetting)
632 { }
633 ~StickySetting() = default;
634
635 StickySetting(const StickySetting&) = delete;
639
640 SettingType& Get() noexcept { return mSetting; }
641 const SettingType& Get() const noexcept { return mSetting; }
642
643 SettingType* operator->() noexcept { return &mSetting; }
644 const SettingType* operator->() const noexcept { return &mSetting; }
645
646 SettingType& operator*() noexcept { return mSetting; }
647 const SettingType& operator*() const noexcept { return mSetting; }
648};
649
651class PREFERENCES_API PrefsListener
652{
653public:
655
662 static void Broadcast(int id = 0);
663
665 virtual ~PrefsListener();
666
667 // Called when all preferences should be updated.
668 // PrefsListener::UpdatePrefs() is defined, and does nothing
669 virtual void UpdatePrefs() = 0;
670
671protected:
672 // Called when only selected preferences are to be updated.
673 // id is some value generated by wxNewId() that identifies the portion
674 // of preferences.
675 // Default function does nothing.
676 virtual void UpdateSelectedPrefs( int id );
677
678private:
679 struct Impl;
680 std::unique_ptr<Impl> mpImpl;
681};
682
686PREFERENCES_API
687wxString WarningDialogKey(const wxString &internalDialogName);
688
693struct PREFERENCES_API PreferenceInitializer {
695 virtual ~PreferenceInitializer();
696 virtual void operator () () = 0;
697
698 static void ReinitializeAll();
699};
700
701// Special extra-sticky settings
703
704#endif
const wxChar * values
wxString RegistryPath
Definition: Identifier.h:218
static const AudacityProject::AttachedObjects::RegisteredFactory key
PREFERENCES_API void GetPreferencesVersion(int &vMajor, int &vMinor, int &vMicro)
Definition: Prefs.cpp:239
PREFERENCES_API wxString WarningDialogKey(const wxString &internalDialogName)
Definition: Prefs.cpp:510
PREFERENCES_API void SetPreferencesVersion(int vMajor, int vMinor, int vMicor)
Definition: Prefs.cpp:246
PREFERENCES_API void FinishPreferences()
Definition: Prefs.cpp:262
PREFERENCES_API void ResetPreferences()
Call this to reset preferences to an (almost)-"new" default state.
Definition: Prefs.cpp:253
PREFERENCES_API ByColumns_t ByColumns
Definition: Prefs.cpp:515
PREFERENCES_API StickySetting< BoolSetting > DefaultUpdatesCheckingFlag
Definition: Prefs.cpp:63
PREFERENCES_API void InitPreferences(std::unique_ptr< audacity::BasicSettings > uPrefs)
Definition: Prefs.cpp:231
int gMenusDirty
Definition: Prefs.cpp:69
PREFERENCES_API audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
std::vector< TranslatableString > TranslatableStrings
This specialization of Setting for bool adds a Toggle method to negate the saved value.
Definition: Prefs.h:346
Class template adds an in-memory cache of a value to TransactionalSettingBase and support for Setting...
Definition: Prefs.h:162
CachingSettingBase(const CachingSettingBase &)=default
CachingSettingBase(const SettingBase &path)
Definition: Prefs.h:165
const wxString & Key() const
Definition: Prefs.h:439
const wxString mKey
Definition: Prefs.h:459
ChoiceSetting(const SettingBase &key, EnumValueSymbols symbols, long defaultSymbol=-1)
Definition: Prefs.h:430
const EnumValueSymbols mSymbols
Definition: Prefs.h:460
ChoiceSetting(const SettingPath &, EnumValueSymbols, long=-1)=delete
const EnumValueSymbols & GetSymbols() const
Definition: Prefs.h:441
long mDefaultSymbol
Definition: Prefs.h:466
ChoiceSetting(TransactionalSettingBase &key, EnumValueSymbols symbols, long defaultSymbol=-1)
Definition: Prefs.h:419
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Specialization of Setting for double.
Definition: Prefs.h:363
const wxString mOldKey
Definition: Prefs.h:508
std::vector< int > mIntValues
Definition: Prefs.h:507
EnumSettingBase(Key &&key, EnumValueSymbols symbols, long defaultSymbol, std::vector< int > intValues, const wxString &oldKey={})
Definition: Prefs.h:477
Adapts EnumSettingBase to a particular enumeration type.
Definition: Prefs.h:514
std::vector< int > ConvertValues(const std::vector< Enum > &values)
Definition: Prefs.h:550
bool WriteEnum(Enum value)
Definition: Prefs.h:546
EnumSetting(Key &&key, EnumValueSymbols symbols, long defaultSymbol, std::vector< Enum > values, const wxString &oldKey={})
Definition: Prefs.h:519
Enum ReadEnumWithDefault(Enum defaultValue) const
Definition: Prefs.h:540
Enum ReadEnum() const
Definition: Prefs.h:534
EnumValueSymbols()=default
wxArrayStringEx mInternals
Definition: Prefs.h:406
EnumValueSymbols(std::vector< EnumValueSymbol > symbols)
Definition: Prefs.h:387
EnumValueSymbols(std::initializer_list< EnumValueSymbol > symbols)
Definition: Prefs.h:384
TranslatableStrings mMsgids
Definition: Prefs.h:405
Specialization of Setting for int.
Definition: Prefs.h:356
Allows custom logic for preferences reset event.
Definition: Prefs.h:563
virtual void OnSettingResetBegin()=0
Happens before preferences reset.
virtual void OnSettingResetEnd()=0
Happens after preferences reset.
virtual ~PreferencesResetHandler()
A listener notified of changes in preferences.
Definition: Prefs.h:652
std::unique_ptr< Impl > mpImpl
Definition: Prefs.h:679
Base class for settings objects. It holds a configuration key path.
Definition: Prefs.h:80
audacity::BasicSettings * GetConfig() const
Definition: Prefs.cpp:544
SettingBase(const wxChar *path)
Definition: Prefs.h:83
SettingBase(const wxString &path)
Definition: Prefs.h:84
SettingBase(const char *path)
Definition: Prefs.h:82
SettingBase(const SettingBase &)=default
const SettingPath & GetPath() const
Definition: Prefs.h:88
const SettingPath mPath
Definition: Prefs.h:95
Definition: Prefs.h:178
bool Write(const T &value)
Write value to config and return true if successful.
Definition: Prefs.h:259
T Read() const
overload of Read, always returning a value
Definition: Prefs.h:233
Setting(const SettingBase &path, const T &defaultValue)
Usual overload supplies a default value.
Definition: Prefs.h:187
T ReadWithDefault(const T &defaultValue) const
new direct use is discouraged but it may be needed in legacy code
Definition: Prefs.h:241
void EnterTransaction(size_t depth) override
Definition: Prefs.h:295
T ValueType
Definition: Prefs.h:180
void Invalidate() override
Definition: Prefs.h:289
bool ReadWithDefault(T *pVar, const T &defaultValue) const
overload of ReadWithDefault returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:213
void Rollback() noexcept override
Definition: Prefs.h:317
bool Reset()
Reset to the default value.
Definition: Prefs.h:284
bool DoWrite()
Write cached value to config and return true if successful.
Definition: Prefs.h:332
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207
std::function< T() > DefaultValueFunction
Definition: Prefs.h:184
std::vector< T > mPreviousValues
Definition: Prefs.h:341
const T & GetDefault() const
Definition: Prefs.h:199
Setting(const SettingBase &path, DefaultValueFunction function)
This overload causes recomputation of the default each time it is needed.
Definition: Prefs.h:193
bool Commit() override
Definition: Prefs.h:303
const DefaultValueFunction mFunction
Definition: Prefs.h:339
Makes temporary changes to preferences, then rolls them back at destruction.
Definition: Prefs.h:120
bool mCommitted
Definition: Prefs.h:138
static AddResult Add(TransactionalSettingBase &setting)
Definition: Prefs.cpp:297
SettingScope(const SettingScope &)=delete
~SettingScope() noexcept
Definition: Prefs.cpp:280
SettingScope & operator=(const SettingScope &)=delete
@ NotAdded
Definition: Prefs.h:133
@ PreviouslyAdded
Definition: Prefs.h:133
std::set< TransactionalSettingBase * > mPending
Definition: Prefs.h:137
Extend SettingScope with Commit() which flushes updates in a batch.
Definition: Prefs.h:149
SettingType & mSetting
Definition: Prefs.h:595
void OnSettingResetEnd() override
Happens after preferences reset.
Definition: Prefs.h:616
std::optional< ValueType > mCapturedValue
Definition: Prefs.h:597
ResetHandler(ResetHandler &&)=delete
ResetHandler(const ResetHandler &)=delete
ResetHandler(SettingType &setting)
Definition: Prefs.h:605
~ResetHandler() override
Definition: Prefs.h:606
void OnSettingResetBegin() override
Happens before preferences reset.
Definition: Prefs.h:608
ResetHandler & operator=(ResetHandler &&)=delete
ResetHandler & operator=(const ResetHandler &)=delete
SettingType mSetting
Definition: Prefs.h:625
~StickySetting()=default
StickySetting(StickySetting &&)=delete
SettingType * operator->() noexcept
Definition: Prefs.h:643
StickySetting(const StickySetting &)=delete
PreferencesResetHandler::Registration< ResetHandler > mResetHandlerRegistration
Definition: Prefs.h:626
SettingType & operator*() noexcept
Definition: Prefs.h:646
const SettingType * operator->() const noexcept
Definition: Prefs.h:644
StickySetting & operator=(const StickySetting &)=delete
StickySetting(Args &&...args)
Definition: Prefs.h:629
const SettingType & Get() const noexcept
Definition: Prefs.h:641
SettingType & Get() noexcept
Definition: Prefs.h:640
StringSetting & operator=(StickySetting &&)=delete
const SettingType & operator*() const noexcept
Definition: Prefs.h:647
Specialization of Setting for strings.
Definition: Prefs.h:370
friend class SettingScope
Definition: Prefs.h:109
virtual void Rollback() noexcept=0
virtual void EnterTransaction(size_t depth)=0
virtual void Invalidate()=0
virtual bool Commit()=0
Base class for objects that provide facility to store data persistently, and access it with string ke...
Definition: BasicSettings.h:31
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
PROJECT_FILE_IO_API void Add(const FilePath &path)
PROJECT_FILE_IO_API wxString Find(const FilePath &path)
bool GetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)
STL namespace.
Performs single-time global handler registration.
Definition: Prefs.h:570
RegistryPath mPath
Definition: Prefs.h:73