diff options
author | pastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-19 15:23:10 +0000 |
---|---|---|
committer | pastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-19 15:23:10 +0000 |
commit | 5fb35372c80f9436a980281cc826d8a72fcf8915 (patch) | |
tree | 8ca072f766b796ce32064dc6a9b2eee1f9ef35ac /base/values.h | |
parent | 57c06b5ec1aacada9f73ee01717a7c5a81baff40 (diff) | |
download | chromium_src-5fb35372c80f9436a980281cc826d8a72fcf8915.zip chromium_src-5fb35372c80f9436a980281cc826d8a72fcf8915.tar.gz chromium_src-5fb35372c80f9436a980281cc826d8a72fcf8915.tar.bz2 |
Adds Find method to the ListValue class.
This method makes working with lists easierand will be needed from the
refactored signed settings code.
BUG=chromium-os:14054
TEST=base_unittest --gtest_filter=ValuesTest.List
Review URL: http://codereview.chromium.org/7892052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101741 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.h')
-rw-r--r-- | base/values.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/base/values.h b/base/values.h index a30791b..90cc40c 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_); |