Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: base/win/registry.h

Issue 8337006: base/win: small improvement to RegKey API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: apply grt comments Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/win/registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/registry.h
diff --git a/base/win/registry.h b/base/win/registry.h
index 078e6e07d52b6bc87b200aee3d16538f95da01aa..33052ff6bb0419d40a6c52022a445ebb87dde3bd 100644
--- a/base/win/registry.h
+++ b/base/win/registry.h
@@ -33,20 +33,28 @@ class BASE_EXPORT RegKey {
LONG CreateWithDisposition(HKEY rootkey, const wchar_t* subkey,
DWORD* disposition, REGSAM access);
- LONG Open(HKEY rootkey, const wchar_t* subkey, REGSAM access);
-
// Creates a subkey or open it if it already exists.
LONG CreateKey(const wchar_t* name, REGSAM access);
- // Opens a subkey
- LONG OpenKey(const wchar_t* name, REGSAM access);
+ // Opens an existing reg key.
+ LONG Open(HKEY rootkey, const wchar_t* subkey, REGSAM access);
+
+ // Opens an existing reg key, given the relative key name.
+ LONG OpenKey(const wchar_t* relative_key_name, REGSAM access);
+ // Closes this reg key.
void Close();
- DWORD ValueCount() const;
+ // Returns false if this key does not have the specified value, of if an error
+ // occurrs while attempting to access it.
+ bool HasValue(const wchar_t* value_name) const;
+
+ // Returns the number of values for this key, of 0 if the number cannot be
+ // determined.
+ DWORD GetValueCount() const;
// Determine the nth value's name.
- LONG ReadName(int index, std::wstring* name) const;
+ LONG GetValueNameAt(int index, std::wstring* name) const;
// True while the key is valid.
bool Valid() const { return key_ != NULL; }
@@ -58,8 +66,6 @@ class BASE_EXPORT RegKey {
// Deletes a single value within the key.
LONG DeleteValue(const wchar_t* name);
- bool ValueExists(const wchar_t* name) const;
-
LONG ReadValue(const wchar_t* name, void* data, DWORD* dsize,
DWORD* dtype) const;
LONG ReadValue(const wchar_t* name, std::wstring* value) const;
« no previous file with comments | « no previous file | base/win/registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698