| 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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 } | 778 } |
| 779 | 779 |
| 780 void DictionaryValue::Swap(DictionaryValue* other) { | 780 void DictionaryValue::Swap(DictionaryValue* other) { |
| 781 dictionary_.swap(other->dictionary_); | 781 dictionary_.swap(other->dictionary_); |
| 782 } | 782 } |
| 783 | 783 |
| 784 DictionaryValue::Iterator::Iterator(const DictionaryValue& target) | 784 DictionaryValue::Iterator::Iterator(const DictionaryValue& target) |
| 785 : target_(target), | 785 : target_(target), |
| 786 it_(target.dictionary_.begin()) {} | 786 it_(target.dictionary_.begin()) {} |
| 787 | 787 |
| 788 DictionaryValue::Iterator::~Iterator() {} |
| 789 |
| 788 DictionaryValue* DictionaryValue::DeepCopy() const { | 790 DictionaryValue* DictionaryValue::DeepCopy() const { |
| 789 DictionaryValue* result = new DictionaryValue; | 791 DictionaryValue* result = new DictionaryValue; |
| 790 | 792 |
| 791 for (ValueMap::const_iterator current_entry(dictionary_.begin()); | 793 for (ValueMap::const_iterator current_entry(dictionary_.begin()); |
| 792 current_entry != dictionary_.end(); ++current_entry) { | 794 current_entry != dictionary_.end(); ++current_entry) { |
| 793 result->SetWithoutPathExpansion(current_entry->first, | 795 result->SetWithoutPathExpansion(current_entry->first, |
| 794 current_entry->second->DeepCopy()); | 796 current_entry->second->DeepCopy()); |
| 795 } | 797 } |
| 796 | 798 |
| 797 return result; | 799 return result; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 | 1115 |
| 1114 std::ostream& operator<<(std::ostream& out, const Value& value) { | 1116 std::ostream& operator<<(std::ostream& out, const Value& value) { |
| 1115 std::string json; | 1117 std::string json; |
| 1116 JSONWriter::WriteWithOptions(&value, | 1118 JSONWriter::WriteWithOptions(&value, |
| 1117 JSONWriter::OPTIONS_PRETTY_PRINT, | 1119 JSONWriter::OPTIONS_PRETTY_PRINT, |
| 1118 &json); | 1120 &json); |
| 1119 return out << json; | 1121 return out << json; |
| 1120 } | 1122 } |
| 1121 | 1123 |
| 1122 } // namespace base | 1124 } // namespace base |
| OLD | NEW |