]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/regconf.h
Pretty redical change concerning the underlying
[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 // get number of entries/subgroups in the current group, with or without
50 // it's subgroups
51 virtual uint GetNumberOfEntries(bool bRecursive = FALSE) const = 0;
52 virtual uint GetNumberOfGroups(bool bRecursive = FALSE) const = 0;
53
54 // read/write
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; }
60
61 // delete
62 virtual bool DeleteEntry(const char *szKey, bool bGroupIfEmptyAlso);
63 virtual bool DeleteGroup(const char *szKey);
64 virtual bool DeleteAll();
65
66 private:
67 // these keys are opened during all lifetime of wxRegConfig object
68 wxRegKey m_keyLocalRoot, m_keyLocal,
69 m_keyGlobalRoot, m_keyGlobal;
70
71 // current path (not '/' terminated)
72 wxString m_strPath;
73 };
74
75 #endif //_REGCONF_H