]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/regconf.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: Registry based implementation of wxConfigBase
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
16 #pragma interface "regconf.h"
20 #include <wx/msw/registry.h>
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
27 class wxRegConfig
: public wxConfigBase
31 // will store data in HKLM\strRegHive and HKCU\strRegHive
32 wxRegConfig(const wxString
& strRegHive
);
33 // dtor will save unsaved data
34 virtual ~wxRegConfig();
36 // implement inherited pure virtual functions
37 // ------------------------------------------
40 virtual void SetPath(const wxString
& strPath
);
41 virtual const wxString
& GetPath() const { return m_strPath
; }
43 // entry/subgroup info
44 // enumerate all of them
45 virtual bool GetFirstGroup(wxString
& str
, long& lIndex
) const;
46 virtual bool GetNextGroup (wxString
& str
, long& lIndex
) const;
47 virtual bool GetFirstEntry(wxString
& str
, long& lIndex
) const;
48 virtual bool GetNextEntry (wxString
& str
, long& lIndex
) const;
50 // tests for existence
51 virtual bool HasGroup(const wxString
& strName
) const;
52 virtual bool HasEntry(const wxString
& strName
) const;
54 // get number of entries/subgroups in the current group, with or without
56 virtual uint
GetNumberOfEntries(bool bRecursive
= FALSE
) const;
57 virtual uint
GetNumberOfGroups(bool bRecursive
= FALSE
) const;
60 virtual bool Read(wxString
*pStr
, const char *szKey
,
61 const char *szDefault
= 0) const;
62 virtual bool Read(long *result
, const char *szKey
, long lDefault
= 0) const;
63 virtual bool Write(const char *szKey
, const char *szValue
);
64 virtual bool Write(const char *szKey
, long Value
);
65 virtual bool Flush(bool /* bCurrentOnly = FALSE */ ) { return TRUE
; }
68 virtual bool DeleteEntry(const char *szKey
, bool bGroupIfEmptyAlso
);
69 virtual bool DeleteGroup(const char *szKey
);
70 virtual bool DeleteAll();
73 // these keys are opened during all lifetime of wxRegConfig object
74 wxRegKey m_keyLocalRoot
, m_keyLocal
,
75 m_keyGlobalRoot
, m_keyGlobal
;
77 // current path (not '/' terminated)