Test for wxUSE_BASE64 in wxRegConfig

When you compile wxWidgets with base64 support disabled, then
wxConfigBase does not declare DoReadBinary and DoWriteBinary.
Add a guard to wxRegConfig, so wxOVERRIDE won't cause an error.
This commit is contained in:
René Kijewski
2017-01-10 18:24:50 +01:00
parent d69cfb083e
commit 92f80a18c6
2 changed files with 8 additions and 0 deletions

View File

@@ -91,11 +91,15 @@ protected:
// implement read/write methods // implement read/write methods
virtual bool DoReadString(const wxString& key, wxString *pStr) const wxOVERRIDE; virtual bool DoReadString(const wxString& key, wxString *pStr) const wxOVERRIDE;
virtual bool DoReadLong(const wxString& key, long *plResult) const wxOVERRIDE; virtual bool DoReadLong(const wxString& key, long *plResult) const wxOVERRIDE;
#if wxUSE_BASE64
virtual bool DoReadBinary(const wxString& key, wxMemoryBuffer* buf) const wxOVERRIDE; virtual bool DoReadBinary(const wxString& key, wxMemoryBuffer* buf) const wxOVERRIDE;
#endif // wxUSE_BASE64
virtual bool DoWriteString(const wxString& key, const wxString& szValue) wxOVERRIDE; virtual bool DoWriteString(const wxString& key, const wxString& szValue) wxOVERRIDE;
virtual bool DoWriteLong(const wxString& key, long lValue) wxOVERRIDE; virtual bool DoWriteLong(const wxString& key, long lValue) wxOVERRIDE;
#if wxUSE_BASE64
virtual bool DoWriteBinary(const wxString& key, const wxMemoryBuffer& buf) wxOVERRIDE; virtual bool DoWriteBinary(const wxString& key, const wxMemoryBuffer& buf) wxOVERRIDE;
#endif // wxUSE_BASE64
private: private:
// these keys are opened during all lifetime of wxRegConfig object // these keys are opened during all lifetime of wxRegConfig object

View File

@@ -624,6 +624,7 @@ bool wxRegConfig::DoReadLong(const wxString& key, long *plResult) const
return false; return false;
} }
#if wxUSE_BASE64
bool wxRegConfig::DoReadBinary(const wxString& key, wxMemoryBuffer *buf) const bool wxRegConfig::DoReadBinary(const wxString& key, wxMemoryBuffer *buf) const
{ {
wxCHECK_MSG( buf, false, wxT("wxRegConfig::Read(): NULL param") ); wxCHECK_MSG( buf, false, wxT("wxRegConfig::Read(): NULL param") );
@@ -657,6 +658,7 @@ bool wxRegConfig::DoReadBinary(const wxString& key, wxMemoryBuffer *buf) const
return false; return false;
} }
#endif // wxUSE_BASE64
bool wxRegConfig::DoWriteString(const wxString& key, const wxString& szValue) bool wxRegConfig::DoWriteString(const wxString& key, const wxString& szValue)
{ {
@@ -682,6 +684,7 @@ bool wxRegConfig::DoWriteLong(const wxString& key, long lValue)
return LocalKey().SetValue(path.Name(), lValue); return LocalKey().SetValue(path.Name(), lValue);
} }
#if wxUSE_BASE64
bool wxRegConfig::DoWriteBinary(const wxString& key, const wxMemoryBuffer& buf) bool wxRegConfig::DoWriteBinary(const wxString& key, const wxMemoryBuffer& buf)
{ {
wxConfigPathChanger path(this, key); wxConfigPathChanger path(this, key);
@@ -693,6 +696,7 @@ bool wxRegConfig::DoWriteBinary(const wxString& key, const wxMemoryBuffer& buf)
return LocalKey().SetValue(path.Name(), buf); return LocalKey().SetValue(path.Name(), buf);
} }
#endif // wxUSE_BASE64
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// renaming // renaming