1998-05-27 23:07:33 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: msw/regconf.h
|
|
|
|
// Purpose: Registry based implementation of wxConfig
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 27.04.98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
|
|
|
// Licence: wxWindows license
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _REGCONF_H
|
|
|
|
#define _REGCONF_H
|
|
|
|
|
1998-07-03 16:36:10 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "regconf.h"
|
|
|
|
#endif
|
|
|
|
|
1998-05-27 23:07:33 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxRegConfig
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxRegConfig : public wxConfig
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ctor & dtor
|
|
|
|
// will store data in HKLM\strRegHive and HKCU\strRegHive
|
|
|
|
wxRegConfig(const wxString& strRegHive);
|
|
|
|
// dtor will save unsaved data
|
|
|
|
virtual ~wxRegConfig();
|
|
|
|
|
|
|
|
// implement inherited pure virtual functions
|
|
|
|
// ------------------------------------------
|
|
|
|
|
|
|
|
// path management
|
|
|
|
virtual void SetPath(const wxString& strPath);
|
|
|
|
virtual const wxString& GetPath() const { return m_strPath; }
|
|
|
|
|
|
|
|
// enum
|
|
|
|
virtual bool GetFirstGroup(wxString& str, long& lIndex);
|
|
|
|
virtual bool GetNextGroup (wxString& str, long& lIndex);
|
|
|
|
virtual bool GetFirstEntry(wxString& str, long& lIndex);
|
|
|
|
virtual bool GetNextEntry (wxString& str, long& lIndex);
|
|
|
|
|
1998-07-08 17:56:43 +00:00
|
|
|
// tests for existence
|
|
|
|
virtual bool HasGroup(const wxString& strName) const;
|
|
|
|
virtual bool HasEntry(const wxString& strName) const;
|
|
|
|
|
1998-07-24 15:44:58 +00:00
|
|
|
// get number of entries/subgroups in the current group, with or without
|
|
|
|
// it's subgroups
|
|
|
|
virtual uint GetNumberOfEntries(bool bRecursive = FALSE) const = 0;
|
|
|
|
virtual uint GetNumberOfGroups(bool bRecursive = FALSE) const = 0;
|
|
|
|
|
1998-05-27 23:07:33 +00:00
|
|
|
// read/write
|
|
|
|
virtual bool Read(wxString&, const char *, const char * = 0) const;
|
|
|
|
virtual bool Read(long&, const char *, long = 0) const;
|
|
|
|
virtual bool Write(const char *szKey, const char *szValue);
|
|
|
|
virtual bool Write(const char *szKey, long Value);
|
1998-07-01 17:26:46 +00:00
|
|
|
virtual bool Flush(bool /* bCurrentOnly = FALSE */ ) { return TRUE; }
|
1998-05-27 23:07:33 +00:00
|
|
|
|
|
|
|
// delete
|
|
|
|
virtual bool DeleteEntry(const char *szKey, bool bGroupIfEmptyAlso);
|
|
|
|
virtual bool DeleteGroup(const char *szKey);
|
|
|
|
virtual bool DeleteAll();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// these keys are opened during all lifetime of wxRegConfig object
|
|
|
|
wxRegKey m_keyLocalRoot, m_keyLocal,
|
|
|
|
m_keyGlobalRoot, m_keyGlobal;
|
|
|
|
|
|
|
|
// current path (not '/' terminated)
|
|
|
|
wxString m_strPath;
|
|
|
|
};
|
|
|
|
|
1998-07-01 17:26:46 +00:00
|
|
|
#endif //_REGCONF_H
|