| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <ostream> | 10 #include <ostream> |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 } | 795 } |
| 796 | 796 |
| 797 void DictionaryValue::Swap(DictionaryValue* other) { | 797 void DictionaryValue::Swap(DictionaryValue* other) { |
| 798 dictionary_.swap(other->dictionary_); | 798 dictionary_.swap(other->dictionary_); |
| 799 } | 799 } |
| 800 | 800 |
| 801 DictionaryValue::Iterator::Iterator(const DictionaryValue& target) | 801 DictionaryValue::Iterator::Iterator(const DictionaryValue& target) |
| 802 : target_(target), | 802 : target_(target), |
| 803 it_(target.dictionary_.begin()) {} | 803 it_(target.dictionary_.begin()) {} |
| 804 | 804 |
| 805 DictionaryValue::Iterator::~Iterator() {} |
| 806 |
| 805 DictionaryValue* DictionaryValue::DeepCopy() const { | 807 DictionaryValue* DictionaryValue::DeepCopy() const { |
| 806 DictionaryValue* result = new DictionaryValue; | 808 DictionaryValue* result = new DictionaryValue; |
| 807 | 809 |
| 808 for (ValueMap::const_iterator current_entry(dictionary_.begin()); | 810 for (ValueMap::const_iterator current_entry(dictionary_.begin()); |
| 809 current_entry != dictionary_.end(); ++current_entry) { | 811 current_entry != dictionary_.end(); ++current_entry) { |
| 810 result->SetWithoutPathExpansion(current_entry->first, | 812 result->SetWithoutPathExpansion(current_entry->first, |
| 811 current_entry->second->DeepCopy()); | 813 current_entry->second->DeepCopy()); |
| 812 } | 814 } |
| 813 | 815 |
| 814 return result; | 816 return result; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 | 1132 |
| 1131 std::ostream& operator<<(std::ostream& out, const Value& value) { | 1133 std::ostream& operator<<(std::ostream& out, const Value& value) { |
| 1132 std::string json; | 1134 std::string json; |
| 1133 JSONWriter::WriteWithOptions(&value, | 1135 JSONWriter::WriteWithOptions(&value, |
| 1134 JSONWriter::OPTIONS_PRETTY_PRINT, | 1136 JSONWriter::OPTIONS_PRETTY_PRINT, |
| 1135 &json); | 1137 &json); |
| 1136 return out << json; | 1138 return out << json; |
| 1137 } | 1139 } |
| 1138 | 1140 |
| 1139 } // namespace base | 1141 } // namespace base |
| OLD | NEW |