]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/regconf.h
fixed config incosistency
[wxWidgets.git] / include / wx / msw / regconf.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: msw/regconf.h
3 // Purpose: Registry based implementation of wxConfig
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 27.04.98
7 // RCS-ID: $Id$
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _REGCONF_H
13 #define _REGCONF_H
14
15 #ifdef __GNUG__
16 #pragma interface "regconf.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // wxRegConfig
21 // ----------------------------------------------------------------------------
22
23 class wxRegConfig : public wxConfig
24 {
25 public:
26 // ctor & dtor
27 // will store data in HKLM\strRegHive and HKCU\strRegHive
28 wxRegConfig(const wxString& strRegHive);
29 // dtor will save unsaved data
30 virtual ~wxRegConfig();
31
32 // implement inherited pure virtual functions
33 // ------------------------------------------
34
35 // path management
36 virtual void SetPath(const wxString& strPath);
37 virtual const wxString& GetPath() const { return m_strPath; }
38
39 // enum
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);
44
45 // tests for existence
46 virtual bool HasGroup(const wxString& strName) const;
47 virtual bool HasEntry(const wxString& strName) const;
48
49 // read/write
50 virtual bool Read(wxString&, const char *, const char * = 0) const;
51 virtual bool Read(long&, const char *, long = 0) const;
52 virtual bool Write(const char *szKey, const char *szValue);
53 virtual bool Write(const char *szKey, long Value);
54 virtual bool Flush(bool /* bCurrentOnly = FALSE */ ) { return TRUE; }
55
56 // delete
57 virtual bool DeleteEntry(const char *szKey, bool bGroupIfEmptyAlso);
58 virtual bool DeleteGroup(const char *szKey);
59 virtual bool DeleteAll();
60
61 private:
62 // these keys are opened during all lifetime of wxRegConfig object
63 wxRegKey m_keyLocalRoot, m_keyLocal,
64 m_keyGlobalRoot, m_keyGlobal;
65
66 // current path (not '/' terminated)
67 wxString m_strPath;
68 };
69
70 #endif //_REGCONF_H