Audacity 3.2.0
SettingsWX.h
Go to the documentation of this file.
1#pragma once
2
3#include "BasicSettings.h"
4
5#include <memory>
6#include <wx/string.h>
7#include <wx/arrstr.h>
8
9class wxConfigBase;
10
11class WX_INIT_API SettingsWX final : public audacity::BasicSettings
12{
13 wxArrayString mGroupStack;
14 std::shared_ptr<wxConfigBase> mConfig;
15protected:
16 void DoBeginGroup(const wxString& prefix) override;
17 void DoEndGroup() noexcept override;
18
19public:
20 explicit SettingsWX(std::shared_ptr<wxConfigBase> config);
23 explicit SettingsWX(const wxString& filepath);
24 ~SettingsWX() override;
25
26 wxString GetGroup() const override;
27 wxArrayString GetChildGroups() const override;
28 wxArrayString GetChildKeys() const override;
29
30 bool HasEntry(const wxString& key) const override;
31 bool HasGroup(const wxString& key) const override;
32 bool Remove(const wxString& key) override;
33 void Clear() override;
34
35 bool Read(const wxString& key, bool* value) const override;
36 bool Read(const wxString& key, int* value) const override;
37 bool Read(const wxString& key, long* value) const override;
38 bool Read(const wxString& key, long long* value) const override;
39 bool Read(const wxString& key, double* value) const override;
40 bool Read(const wxString& key, wxString* value) const override;
41
42 bool Write(const wxString& key, bool value) override;
43 bool Write(const wxString& key, int value) override;
44 bool Write(const wxString& key, long value) override;
45 bool Write(const wxString& key, long long value) override;
46 bool Write(const wxString& key, double value) override;
47 bool Write(const wxString& key, const wxString& value) override;
48
49
50 bool Flush() noexcept override;
51
52private:
53 wxString MakePath(const wxString& key) const;
54};
static const AudacityProject::AttachedObjects::RegisteredFactory key
std::shared_ptr< wxConfigBase > mConfig
Definition: SettingsWX.h:14
wxArrayString mGroupStack
Definition: SettingsWX.h:13
Base class for objects that provide facility to store data persistently, and access it with string ke...
Definition: BasicSettings.h:31
virtual void DoBeginGroup(const wxString &prefix)=0
virtual void DoEndGroup() noexcept=0
PROJECT_FILE_IO_API void Remove(const FilePath &path)
STL namespace.