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

Unified Diff: base/values.h

Issue 7892052: Adds Find method to the ListValue class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed up the return type a little. Created 9 years, 3 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') | base/values.cc » ('J')
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 a30791bc6357c671f56c02c0c39e61027c11aabb..17c63e46c9e6244b3b68d94a273598469d495c66 100644
--- a/base/values.h
+++ b/base/values.h
@@ -418,6 +418,10 @@ class BASE_EXPORT ListValue : public Value {
// Returns true if successful, or false if the index was out of range.
bool Insert(size_t index, Value* in_value);
+ // Searches for the first instance of |value| in the list.
Mattias Nissler (ping if slow) 2011/09/15 13:40:39 Maybe mention that this compares using Equals()?
pastarmovj 2011/09/16 08:03:49 Done.
+ // Returns a const_iterator to the found item or to end() if none exists.
+ const_iterator Find(const Value& value) const;
+
// Swaps contents with the |other| list.
void Swap(ListValue* other) {
list_.swap(other->list_);
« no previous file with comments | « no previous file | base/values.cc » ('j') | base/values.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698