HasGroup/Entry added

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1998-07-08 17:56:43 +00:00
parent 6a6c0a8bda
commit 6d8335660f
2 changed files with 26 additions and 8 deletions

View File

@@ -42,6 +42,10 @@ public:
virtual bool GetFirstEntry(wxString& str, long& lIndex);
virtual bool GetNextEntry (wxString& str, long& lIndex);
// tests for existence
virtual bool HasGroup(const wxString& strName) const;
virtual bool HasEntry(const wxString& strName) const;
// read/write
virtual bool Read(wxString&, const char *, const char * = 0) const;
virtual bool Read(long&, const char *, long = 0) const;

View File

@@ -23,7 +23,7 @@
#include <wx/wx.h>
#include <wx/config.h>
#include <wx/regconf.h>
#include <wx/registry.h>
#include <wx/msw/registry.h>
// ----------------------------------------------------------------------------
// constants
@@ -183,6 +183,20 @@ bool wxRegConfig::GetNextEntry (wxString& str, long& lIndex)
return bOk;
}
// ----------------------------------------------------------------------------
// tests for existence
// ----------------------------------------------------------------------------
bool wxRegConfig::HasGroup(const wxString& strName) const
{
return m_keyLocal.HasSubKey(strName) || m_keyGlobal.HasSubKey(strName);
}
bool wxRegConfig::HasEntry(const wxString& strName) const
{
return m_keyLocal.HasValue(strName) || m_keyGlobal.HasValue(strName);
}
// ----------------------------------------------------------------------------
// reading/writing
// ----------------------------------------------------------------------------