]>
git.saurik.com Git - wxWidgets.git/blob - interface/msw/registry.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: msw/registry.h
3 // Purpose: interface of wxRegKey
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @headerfile registry.h wx/msw/registry.h
13 wxRegKey is a class representing the Windows registry (it is only available
14 under Windows). One can create, query and delete registry keys using this
17 The Windows registry is easy to understand. There are five registry keys,
20 HKEY_CLASSES_ROOT (HKCR)
21 HKEY_CURRENT_USER (HKCU)
22 HKEY_LOCAL_MACHINE (HKLM)
23 HKEY_CURRENT_CONFIG (HKCC)
26 After creating a key, it can hold a value. The values can be:
32 Expandable String Value
43 The constructor to set the full name of the key under a previously created
47 wxRegKey(const wxString
& strKey
);
48 wxRegKey(const wxRegKey
& keyParent
, const wxString
& strKey
);
57 Creates the key. Will fail if the key already exists and @a bOkIfExists is
60 bool Create(bool bOkIfExists
= true);
63 Deletes the subkey with all of its subkeys/values recursively.
65 void DeleteKey(const wxChar
* szKey
);
68 Deletes this key and all of its subkeys and values recursively.
73 Deletes the named value.
75 void DeleteValue(const wxChar
* szKey
);
78 Returns @true if the key exists.
80 static bool Exists() const;
85 bool GetFirstKey(wxString
& strKeyName
, long& lIndex
);
88 Gets the first value of this key.
90 bool GetFirstValue(wxString
& strValueName
, long& lIndex
);
93 Gets information about the key.
96 The number of subkeys.
98 The maximum length of the subkey name.
100 The number of values.
102 The maximum length of a value.
104 bool GetKeyInfo(size_t* pnSubKeys
, size_t* pnValues
,
105 size_t* pnMaxValueLen
) const;
108 Gets the name of the registry key.
110 wxString
GetName(bool bShortPrefix
= true) const;
115 bool GetNextKey(wxString
& strKeyName
, long& lIndex
) const;
118 Gets the next key value for this key.
120 bool GetNextValue(wxString
& strValueName
, long& lIndex
) const;
123 Returns @true if given subkey exists.
125 bool HasSubKey(const wxChar
* szKey
) const;
128 Returns @true if any subkeys exist.
130 bool HasSubKeys() const;
133 Returns @true if the value exists.
135 bool HasValue(const wxChar
* szValue
) const;
138 Returns @true if any values exist.
140 bool HasValues() const;
143 Returns @true if this key is empty, nothing under this key.
145 bool IsEmpty() const;
148 Returns @true if the key is opened.
150 bool IsOpened() const;
153 Explicitly opens the key. This method also allows the key to be opened in
154 read-only mode by passing @c Read() instead of default
155 @c Write() parameter.
157 bool Open(AccessMode mode
= Write
);
161 Retrieves the numeric value.
163 bool QueryValue(const wxChar
* szValue
, wxString
& strValue
) const;
164 const bool QueryValue(const wxChar
* szValue
, long* plValue
) const;
170 bool Rename(const wxChar
* szNewName
);
175 bool RenameValue(const wxChar
* szValueOld
,
176 const wxChar
* szValueNew
);
180 Sets the given @a szValue which must be numeric, string or binary depending
181 on the overload used. If the value doesn't exist, it is created.
183 bool SetValue(const wxChar
* szValue
, long lValue
);
184 bool SetValue(const wxChar
* szValue
,
185 const wxString
& strValue
);
186 bool SetValue(const wxChar
* szValue
,
187 const wxMemoryBuffer
& buf
);