11#ifndef __AUDACITY_WIDGETS_FILECONFIG__
12#define __AUDACITY_WIDGETS_FILECONFIG__
17#include <wx/fileconf.h>
23 FileConfig(
const wxString& appName = wxEmptyString,
24 const wxString& vendorName = wxEmptyString,
25 const wxString& localFilename = wxEmptyString,
26 const wxString& globalFilename = wxEmptyString,
27 long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
28 const wxMBConv& conv = wxConvAuto());
32 virtual void SetPath(
const wxString& strPath) wxOVERRIDE;
33 virtual const wxString& GetPath()
const wxOVERRIDE;
34 virtual bool GetFirstGroup(wxString&
str,
long& lIndex)
const wxOVERRIDE;
35 virtual bool GetNextGroup(wxString&
str,
long& lIndex)
const wxOVERRIDE;
36 virtual bool GetFirstEntry(wxString&
str,
long& lIndex)
const wxOVERRIDE;
37 virtual bool GetNextEntry(wxString&
str,
long& lIndex)
const wxOVERRIDE;
38 virtual size_t GetNumberOfEntries(
bool bRecursive =
false)
const wxOVERRIDE;
39 virtual size_t GetNumberOfGroups(
bool bRecursive =
false)
const wxOVERRIDE;
40 virtual bool HasGroup(
const wxString& strName)
const wxOVERRIDE;
41 virtual bool HasEntry(
const wxString& strName)
const wxOVERRIDE;
42 virtual bool Flush(
bool bCurrentOnly =
false) wxOVERRIDE;
43 virtual bool RenameEntry(
const wxString& oldName,
const wxString& newName) wxOVERRIDE;
44 virtual bool RenameGroup(
const wxString& oldName,
const wxString& newName) wxOVERRIDE;
45 virtual bool DeleteEntry(
const wxString&
key,
bool bDeleteGroupIfEmpty =
true) wxOVERRIDE;
46 virtual bool DeleteGroup(
const wxString&
key) wxOVERRIDE;
47 virtual bool DeleteAll() wxOVERRIDE;
52 mVersionMajorKeyInit = major;
53 mVersionMinorKeyInit = minor;
54 mVersionMicroKeyInit = micro;
58 major = mVersionMajorKeyInit;
59 minor = mVersionMinorKeyInit;
60 micro = mVersionMicroKeyInit;
64 virtual bool DoReadString(
const wxString&
key, wxString *pStr)
const wxOVERRIDE;
65 virtual bool DoReadLong(
const wxString&
key,
long *pl)
const wxOVERRIDE;
67 virtual bool DoReadBinary(
const wxString&
key, wxMemoryBuffer* buf)
const wxOVERRIDE;
70 virtual bool DoWriteString(
const wxString&
key,
const wxString& szValue) wxOVERRIDE;
71 virtual bool DoWriteLong(
const wxString&
key,
long lValue) wxOVERRIDE;
73 virtual bool DoWriteBinary(
const wxString&
key,
const wxMemoryBuffer& buf) wxOVERRIDE;
89 std::unique_ptr<wxMBConv>
mConv;
95 int mVersionMajorKeyInit{};
96 int mVersionMinorKeyInit{};
97 int mVersionMicroKeyInit{};
static const AudacityProject::AttachedObjects::RegisteredFactory key
const wxString mVendorName
void GetVersionKeysInit(int &major, int &minor, int µ) const
void SetVersionKeysInit(int major, int minor, int micro)
const FilePath & GetFilePath() const
const wxString mGlobalFilename
std::unique_ptr< wxMBConv > mConv
std::unique_ptr< wxFileConfig > mConfig
const wxString mLocalFilename