From a61890ebc4d1d6f558edfe8a03ba6a6c72a16689 Mon Sep 17 00:00:00 2001 From: "vabr@chromium.org" Date: Fri, 27 Jul 2012 22:27:11 +0000 Subject: Correct const accessors in base/values.(h|cc) For problem description and other info please see the BUG page. This is for DictionaryValue. BUG=138946 TEST=N/A (no fix & no new feature) TBR=jar scottbyer achuith agl mnissler davemoore garykac akalin hans bulach phajdan.jr jamesr Review URL: https://chromiumcodereview.appspot.com/10834004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148833 0039d316-1c4b-4281-b951-d872f2087c98 --- base/values.h | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'base/values.h') diff --git a/base/values.h b/base/values.h index f9a459e..223e0f8 100644 --- a/base/values.h +++ b/base/values.h @@ -263,7 +263,8 @@ class BASE_EXPORT DictionaryValue : public Value { // through the |out_value| parameter, and the function will return true. // Otherwise, it will return false and |out_value| will be untouched. // Note that the dictionary always owns the value that's returned. - bool Get(const std::string& path, Value** out_value) const; + bool Get(const std::string& path, const Value** out_value) const; + bool Get(const std::string& path, Value** out_value); // These are convenience forms of Get(). The value will be retrieved // and the return value will be true if the path is valid and the value at @@ -274,27 +275,36 @@ class BASE_EXPORT DictionaryValue : public Value { bool GetString(const std::string& path, std::string* out_value) const; bool GetString(const std::string& path, string16* out_value) const; bool GetStringASCII(const std::string& path, std::string* out_value) const; - bool GetBinary(const std::string& path, BinaryValue** out_value) const; + bool GetBinary(const std::string& path, const BinaryValue** out_value) const; + bool GetBinary(const std::string& path, BinaryValue** out_value); bool GetDictionary(const std::string& path, - DictionaryValue** out_value) const; - bool GetList(const std::string& path, ListValue** out_value) const; + const DictionaryValue** out_value) const; + bool GetDictionary(const std::string& path, DictionaryValue** out_value); + bool GetList(const std::string& path, const ListValue** out_value) const; + bool GetList(const std::string& path, ListValue** out_value); // Like Get(), but without special treatment of '.'. This allows e.g. URLs to // be used as paths. bool GetWithoutPathExpansion(const std::string& key, - Value** out_value) const; + const Value** out_value) const; + bool GetWithoutPathExpansion(const std::string& key, Value** out_value); bool GetIntegerWithoutPathExpansion(const std::string& key, int* out_value) const; bool GetDoubleWithoutPathExpansion(const std::string& key, - double* out_value) const; + double* out_value) const; bool GetStringWithoutPathExpansion(const std::string& key, std::string* out_value) const; bool GetStringWithoutPathExpansion(const std::string& key, string16* out_value) const; + bool GetDictionaryWithoutPathExpansion( + const std::string& key, + const DictionaryValue** out_value) const; bool GetDictionaryWithoutPathExpansion(const std::string& key, - DictionaryValue** out_value) const; + DictionaryValue** out_value); bool GetListWithoutPathExpansion(const std::string& key, - ListValue** out_value) const; + const ListValue** out_value) const; + bool GetListWithoutPathExpansion(const std::string& key, + ListValue** out_value); // Removes the Value with the specified path from this dictionary (or one // of its child dictionaries, if the path is more than just a local key). -- cgit v1.1