added an explicit accessor to query the default key value

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-01-21 15:52:03 +00:00
parent c9b9e020ca
commit 50e42404fb
2 changed files with 6 additions and 3 deletions

View File

@@ -168,8 +168,11 @@ public:
wxRegKey& operator=(long lValue) wxRegKey& operator=(long lValue)
{ SetValue(NULL, lValue); return *this; } { SetValue(NULL, lValue); return *this; }
// conversion operators query the default value of the key // query the default value of the key: implicitly or explicitly
operator wxString() const; wxString QueryDefaultValue() const;
operator wxString() const { return QueryDefaultValue(); }
// named values
// set the string value // set the string value
bool SetValue(const wxChar *szValue, const wxString& strValue); bool SetValue(const wxChar *szValue, const wxString& strValue);

View File

@@ -930,7 +930,7 @@ bool wxRegKey::SetValue(const wxChar *szValue, const wxString& strValue)
return FALSE; return FALSE;
} }
wxRegKey::operator wxString() const wxString wxRegKey::QueryDefaultValue() const
{ {
wxString str; wxString str;
QueryValue(NULL, str); QueryValue(NULL, str);