OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/values.h" | 5 #include "base/values.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/float_util.h" | 9 #include "base/float_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
880 return false; | 880 return false; |
881 | 881 |
882 list_.insert(list_.begin() + index, in_value); | 882 list_.insert(list_.begin() + index, in_value); |
883 return true; | 883 return true; |
884 } | 884 } |
885 | 885 |
886 ListValue::const_iterator ListValue::Find(const Value& value) const { | 886 ListValue::const_iterator ListValue::Find(const Value& value) const { |
887 return std::find_if(list_.begin(), list_.end(), ValueEquals(&value)); | 887 return std::find_if(list_.begin(), list_.end(), ValueEquals(&value)); |
888 } | 888 } |
889 | 889 |
890 int ListValue::Find(const Value& value) const { | |
pastarmovj
2011/10/05 09:47:16
This is not part of the CL but a rebase artefact.
| |
891 for (ValueVector::const_iterator i(list_.begin()); i != list_.end(); ++i) { | |
892 if ((*i)->Equals(&value)) { | |
893 return i - list_.begin(); | |
894 } | |
895 } | |
896 return -1; | |
897 } | |
898 | |
890 bool ListValue::GetAsList(ListValue** out_value) { | 899 bool ListValue::GetAsList(ListValue** out_value) { |
891 if (out_value) | 900 if (out_value) |
892 *out_value = this; | 901 *out_value = this; |
893 return true; | 902 return true; |
894 } | 903 } |
895 | 904 |
896 bool ListValue::GetAsList(const ListValue** out_value) const { | 905 bool ListValue::GetAsList(const ListValue** out_value) const { |
897 if (out_value) | 906 if (out_value) |
898 *out_value = this; | 907 *out_value = this; |
899 return true; | 908 return true; |
(...skipping 24 matching lines...) Expand all Loading... | |
924 if (lhs_it != end() || rhs_it != other_list->end()) | 933 if (lhs_it != end() || rhs_it != other_list->end()) |
925 return false; | 934 return false; |
926 | 935 |
927 return true; | 936 return true; |
928 } | 937 } |
929 | 938 |
930 ValueSerializer::~ValueSerializer() { | 939 ValueSerializer::~ValueSerializer() { |
931 } | 940 } |
932 | 941 |
933 } // namespace base | 942 } // namespace base |
OLD | NEW |