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

Unified Diff: base/values.h

Issue 18200: Flesh out ListValue class. (Closed)
Patch Set: Created 11 years, 11 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/values.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.h
diff --git a/base/values.h b/base/values.h
index 6f2f9df4a4eca69369297e43a726001ba5227c05..19a1cb97bcac173b7d488d4ae776496454b67a2c 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
« no previous file with comments | « no previous file | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698