diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 21:05:32 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 21:05:32 +0000 |
commit | f82fb495a3ccffc3d2a9fbb215a2e1723acee954 (patch) | |
tree | 99c7d26f6fdbeef40235751cb9344c537e83df49 /base/values.h | |
parent | d1afe0ea2e4df1543bc3f67d2f191b6c032ce119 (diff) | |
download | chromium_src-f82fb495a3ccffc3d2a9fbb215a2e1723acee954.zip chromium_src-f82fb495a3ccffc3d2a9fbb215a2e1723acee954.tar.gz chromium_src-f82fb495a3ccffc3d2a9fbb215a2e1723acee954.tar.bz2 |
Flesh out ListValue class.
Review URL: http://codereview.chromium.org/18200
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8315 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.h')
-rw-r--r-- | base/values.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/base/values.h b/base/values.h index 6f2f9df..19a1cb9 100644 --- a/base/values.h +++ b/base/values.h @@ -202,7 +202,7 @@ class DictionaryValue : public Value { virtual bool Equals(const Value* other) const; // Returns true if the current dictionary has a value for the given key. - bool HasKey(const std::wstring& key); + bool HasKey(const std::wstring& key) const; // Clears any current contents of this dictionary. void Clear(); @@ -286,7 +286,6 @@ class DictionaryValue : public Value { }; // This type of Value represents a list of other Value values. -// TODO(jhughes): Flesh this out. class ListValue : public Value { public: ListValue() : Value(TYPE_LIST) {} @@ -317,7 +316,13 @@ class ListValue : public Value { // Convenience forms of Get(). Modifies value (and returns true) only if // the index is valid and the Value at that index can be returned in // the specified form. + bool GetBoolean(size_t index, bool* out_value) const; + bool GetInteger(size_t index, int* out_value) const; + bool GetReal(size_t index, double* out_value) const; + bool GetString(size_t index, std::string* out_value) const; + bool GetBinary(size_t index, BinaryValue** out_value) const; bool GetDictionary(size_t index, DictionaryValue** out_value) const; + bool GetList(size_t index, ListValue** out_value) const; // Removes the Value with the specified index from this list. // If |out_value| is non-NULL, the removed Value AND ITS OWNERSHIP will be |