OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 | 10 |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 bool DictionaryValue::GetStringWithoutPathExpansion( | 775 bool DictionaryValue::GetStringWithoutPathExpansion( |
776 const std::wstring& key, | 776 const std::wstring& key, |
777 std::wstring* out_value) const { | 777 std::wstring* out_value) const { |
778 Value* value; | 778 Value* value; |
779 if (!GetWithoutPathExpansion(WideToUTF8(key), &value)) | 779 if (!GetWithoutPathExpansion(WideToUTF8(key), &value)) |
780 return false; | 780 return false; |
781 | 781 |
782 return value->GetAsString(out_value); | 782 return value->GetAsString(out_value); |
783 } | 783 } |
784 | 784 |
785 // TODO(viettrungluu): Deprecated and to be removed: | |
786 bool DictionaryValue::GetDictionaryWithoutPathExpansion( | |
787 const std::wstring& key, | |
788 DictionaryValue** out_value) const { | |
789 return GetDictionaryWithoutPathExpansion(WideToUTF8(key), out_value); | |
790 } | |
791 | |
792 // TODO(viettrungluu): Deprecated and to be removed: | |
793 bool DictionaryValue::GetListWithoutPathExpansion(const std::wstring& key, | |
794 ListValue** out_value) const { | |
795 return GetListWithoutPathExpansion(WideToUTF8(key), out_value); | |
796 } | |
797 | |
798 bool DictionaryValue::Remove(const std::string& path, Value** out_value) { | 785 bool DictionaryValue::Remove(const std::string& path, Value** out_value) { |
799 DCHECK(IsStringUTF8(path)); | 786 DCHECK(IsStringUTF8(path)); |
800 std::string current_path(path); | 787 std::string current_path(path); |
801 DictionaryValue* current_dictionary = this; | 788 DictionaryValue* current_dictionary = this; |
802 size_t delimiter_position = current_path.rfind('.'); | 789 size_t delimiter_position = current_path.rfind('.'); |
803 if (delimiter_position != std::string::npos) { | 790 if (delimiter_position != std::string::npos) { |
804 if (!GetDictionary(current_path.substr(0, delimiter_position), | 791 if (!GetDictionary(current_path.substr(0, delimiter_position), |
805 ¤t_dictionary)) | 792 ¤t_dictionary)) |
806 return false; | 793 return false; |
807 current_path.erase(0, delimiter_position + 1); | 794 current_path.erase(0, delimiter_position + 1); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 return false; | 1158 return false; |
1172 } | 1159 } |
1173 if (lhs_it != end() || rhs_it != other_list->end()) | 1160 if (lhs_it != end() || rhs_it != other_list->end()) |
1174 return false; | 1161 return false; |
1175 | 1162 |
1176 return true; | 1163 return true; |
1177 } | 1164 } |
1178 | 1165 |
1179 ValueSerializer::~ValueSerializer() { | 1166 ValueSerializer::~ValueSerializer() { |
1180 } | 1167 } |
OLD | NEW |