| 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 bool Remove(const Value& value, size_t* index); | 446 bool Remove(const Value& value, size_t* index); |
| 447 | 447 |
| 448 // Removes the element at |iter|. If |out_value| is NULL, the value will be | 448 // Removes the element at |iter|. If |out_value| is NULL, the value will be |
| 449 // deleted, otherwise ownership of the value is passed back to the caller. | 449 // deleted, otherwise ownership of the value is passed back to the caller. |
| 450 // Returns an iterator pointing to the location of the element that | 450 // Returns an iterator pointing to the location of the element that |
| 451 // followed the erased element. | 451 // followed the erased element. |
| 452 iterator Erase(iterator iter, std::unique_ptr<Value>* out_value); | 452 iterator Erase(iterator iter, std::unique_ptr<Value>* out_value); |
| 453 | 453 |
| 454 // Appends a Value to the end of the list. | 454 // Appends a Value to the end of the list. |
| 455 void Append(std::unique_ptr<Value> in_value); | 455 void Append(std::unique_ptr<Value> in_value); |
| 456 #if !defined(OS_LINUX) | 456 #if !defined(OS_LINUX) && !defined(OS_MACOSX) |
| 457 // Deprecated version of the above. TODO(estade): remove. | 457 // Deprecated version of the above. TODO(estade): remove. |
| 458 void Append(Value* in_value); | 458 void Append(Value* in_value); |
| 459 #endif | 459 #endif |
| 460 | 460 |
| 461 // Convenience forms of Append. | 461 // Convenience forms of Append. |
| 462 void AppendBoolean(bool in_value); | 462 void AppendBoolean(bool in_value); |
| 463 void AppendInteger(int in_value); | 463 void AppendInteger(int in_value); |
| 464 void AppendDouble(double in_value); | 464 void AppendDouble(double in_value); |
| 465 void AppendString(StringPiece in_value); | 465 void AppendString(StringPiece in_value); |
| 466 void AppendString(const string16& in_value); | 466 void AppendString(const string16& in_value); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 return out << static_cast<const Value&>(value); | 538 return out << static_cast<const Value&>(value); |
| 539 } | 539 } |
| 540 | 540 |
| 541 // Stream operator so that enum class Types can be used in log statements. | 541 // Stream operator so that enum class Types can be used in log statements. |
| 542 BASE_EXPORT std::ostream& operator<<(std::ostream& out, | 542 BASE_EXPORT std::ostream& operator<<(std::ostream& out, |
| 543 const Value::Type& type); | 543 const Value::Type& type); |
| 544 | 544 |
| 545 } // namespace base | 545 } // namespace base |
| 546 | 546 |
| 547 #endif // BASE_VALUES_H_ | 547 #endif // BASE_VALUES_H_ |
| OLD | NEW |