| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 bool Remove(const Value& value, size_t* index); | 450 bool Remove(const Value& value, size_t* index); |
| 451 | 451 |
| 452 // Removes the element at |iter|. If |out_value| is NULL, the value will be | 452 // Removes the element at |iter|. If |out_value| is NULL, the value will be |
| 453 // deleted, otherwise ownership of the value is passed back to the caller. | 453 // deleted, otherwise ownership of the value is passed back to the caller. |
| 454 // Returns an iterator pointing to the location of the element that | 454 // Returns an iterator pointing to the location of the element that |
| 455 // followed the erased element. | 455 // followed the erased element. |
| 456 iterator Erase(iterator iter, std::unique_ptr<Value>* out_value); | 456 iterator Erase(iterator iter, std::unique_ptr<Value>* out_value); |
| 457 | 457 |
| 458 // Appends a Value to the end of the list. | 458 // Appends a Value to the end of the list. |
| 459 void Append(std::unique_ptr<Value> in_value); | 459 void Append(std::unique_ptr<Value> in_value); |
| 460 #if !defined(OS_LINUX) || defined(OS_CHROMEOS) |
| 460 // Deprecated version of the above. TODO(estade): remove. | 461 // Deprecated version of the above. TODO(estade): remove. |
| 461 void Append(Value* in_value); | 462 void Append(Value* in_value); |
| 463 #endif |
| 462 | 464 |
| 463 // Convenience forms of Append. | 465 // Convenience forms of Append. |
| 464 void AppendBoolean(bool in_value); | 466 void AppendBoolean(bool in_value); |
| 465 void AppendInteger(int in_value); | 467 void AppendInteger(int in_value); |
| 466 void AppendDouble(double in_value); | 468 void AppendDouble(double in_value); |
| 467 void AppendString(StringPiece in_value); | 469 void AppendString(StringPiece in_value); |
| 468 void AppendString(const string16& in_value); | 470 void AppendString(const string16& in_value); |
| 469 void AppendStrings(const std::vector<std::string>& in_values); | 471 void AppendStrings(const std::vector<std::string>& in_values); |
| 470 void AppendStrings(const std::vector<string16>& in_values); | 472 void AppendStrings(const std::vector<string16>& in_values); |
| 471 | 473 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 556 } |
| 555 | 557 |
| 556 BASE_EXPORT inline std::ostream& operator<<(std::ostream& out, | 558 BASE_EXPORT inline std::ostream& operator<<(std::ostream& out, |
| 557 const ListValue& value) { | 559 const ListValue& value) { |
| 558 return out << static_cast<const Value&>(value); | 560 return out << static_cast<const Value&>(value); |
| 559 } | 561 } |
| 560 | 562 |
| 561 } // namespace base | 563 } // namespace base |
| 562 | 564 |
| 563 #endif // BASE_VALUES_H_ | 565 #endif // BASE_VALUES_H_ |
| OLD | NEW |