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

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: Simplified the code a bit. 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') | 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 a30791bc6357c671f56c02c0c39e61027c11aabb..90cc40ccc07bffe6093419be40a19d209ee5b618 100644
--- a/base/values.h
+++ b/base/values.h
@@ -418,6 +418,11 @@ 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 using the Equals
+ // method of the Value type.
+ // 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698