]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/regconf.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: Registry based implementation of wxConfig
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"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 class wxRegConfig
: public wxConfig
27 // will store data in HKLM\strRegHive and HKCU\strRegHive
28 wxRegConfig(const wxString
& strRegHive
);
29 // dtor will save unsaved data
30 virtual ~wxRegConfig();
32 // implement inherited pure virtual functions
33 // ------------------------------------------
36 virtual void SetPath(const wxString
& strPath
);
37 virtual const wxString
& GetPath() const { return m_strPath
; }
40 virtual bool GetFirstGroup(wxString
& str
, long& lIndex
);
41 virtual bool GetNextGroup (wxString
& str
, long& lIndex
);
42 virtual bool GetFirstEntry(wxString
& str
, long& lIndex
);
43 virtual bool GetNextEntry (wxString
& str
, long& lIndex
);
45 // tests for existence
46 virtual bool HasGroup(const wxString
& strName
) const;
47 virtual bool HasEntry(const wxString
& strName
) const;
49 // get number of entries/subgroups in the current group, with or without
51 virtual uint
GetNumberOfEntries(bool bRecursive
= FALSE
) const = 0;
52 virtual uint
GetNumberOfGroups(bool bRecursive
= FALSE
) const = 0;
55 virtual bool Read(wxString
&, const char *, const char * = 0) const;
56 virtual bool Read(long&, const char *, long = 0) const;
57 virtual bool Write(const char *szKey
, const char *szValue
);
58 virtual bool Write(const char *szKey
, long Value
);
59 virtual bool Flush(bool /* bCurrentOnly = FALSE */ ) { return TRUE
; }
62 virtual bool DeleteEntry(const char *szKey
, bool bGroupIfEmptyAlso
);
63 virtual bool DeleteGroup(const char *szKey
);
64 virtual bool DeleteAll();
67 // these keys are opened during all lifetime of wxRegConfig object
68 wxRegKey m_keyLocalRoot
, m_keyLocal
,
69 m_keyGlobalRoot
, m_keyGlobal
;
71 // current path (not '/' terminated)