| 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 // This file specifies a recursive data storage class called Value intended for | 5 // This file specifies a recursive data storage class called Value intended for |
| 6 // storing settings and other persistable data. | 6 // storing settings and other persistable data. |
| 7 // | 7 // |
| 8 // A Value represents something that can be stored in JSON or passed to/from | 8 // A Value represents something that can be stored in JSON or passed to/from |
| 9 // JavaScript. As such, it is NOT a generalized variant type, since only the | 9 // JavaScript. As such, it is NOT a generalized variant type, since only the |
| 10 // types supported by JavaScript/JSON are supported. | 10 // types supported by JavaScript/JSON are supported. |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 // return false and the DictionaryValue object will be unchanged. | 319 // return false and the DictionaryValue object will be unchanged. |
| 320 virtual bool Remove(const std::string& path, scoped_ptr<Value>* out_value); | 320 virtual bool Remove(const std::string& path, scoped_ptr<Value>* out_value); |
| 321 | 321 |
| 322 // Like Remove(), but without special treatment of '.'. This allows e.g. URLs | 322 // Like Remove(), but without special treatment of '.'. This allows e.g. URLs |
| 323 // to be used as paths. | 323 // to be used as paths. |
| 324 virtual bool RemoveWithoutPathExpansion(const std::string& key, | 324 virtual bool RemoveWithoutPathExpansion(const std::string& key, |
| 325 scoped_ptr<Value>* out_value); | 325 scoped_ptr<Value>* out_value); |
| 326 | 326 |
| 327 // Makes a copy of |this| but doesn't include empty dictionaries and lists in | 327 // Makes a copy of |this| but doesn't include empty dictionaries and lists in |
| 328 // the copy. This never returns NULL, even if |this| itself is empty. | 328 // the copy. This never returns NULL, even if |this| itself is empty. |
| 329 DictionaryValue* DeepCopyWithoutEmptyChildren(); | 329 DictionaryValue* DeepCopyWithoutEmptyChildren() const; |
| 330 | 330 |
| 331 // Merge |dictionary| into this dictionary. This is done recursively, i.e. any | 331 // Merge |dictionary| into this dictionary. This is done recursively, i.e. any |
| 332 // sub-dictionaries will be merged as well. In case of key collisions, the | 332 // sub-dictionaries will be merged as well. In case of key collisions, the |
| 333 // passed in dictionary takes precedence and data already present will be | 333 // passed in dictionary takes precedence and data already present will be |
| 334 // replaced. Values within |dictionary| are deep-copied, so |dictionary| may | 334 // replaced. Values within |dictionary| are deep-copied, so |dictionary| may |
| 335 // be freed any time after this call. | 335 // be freed any time after this call. |
| 336 void MergeDictionary(const DictionaryValue* dictionary); | 336 void MergeDictionary(const DictionaryValue* dictionary); |
| 337 | 337 |
| 338 // Swaps contents with the |other| dictionary. | 338 // Swaps contents with the |other| dictionary. |
| 339 virtual void Swap(DictionaryValue* other); | 339 virtual void Swap(DictionaryValue* other); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 | 522 |
| 523 } // namespace base | 523 } // namespace base |
| 524 | 524 |
| 525 // http://crbug.com/88666 | 525 // http://crbug.com/88666 |
| 526 using base::DictionaryValue; | 526 using base::DictionaryValue; |
| 527 using base::ListValue; | 527 using base::ListValue; |
| 528 using base::StringValue; | 528 using base::StringValue; |
| 529 using base::Value; | 529 using base::Value; |
| 530 | 530 |
| 531 #endif // BASE_VALUES_H_ | 531 #endif // BASE_VALUES_H_ |
| OLD | NEW |