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 #if !defined(OS_LINUX) |
461 // Deprecated version of the above. TODO(estade): remove. | 461 // Deprecated version of the above. TODO(estade): remove. |
462 void Append(Value* in_value); | 462 void Append(Value* in_value); |
463 #endif | 463 #endif |
464 | 464 |
465 // Convenience forms of Append. | 465 // Convenience forms of Append. |
466 void AppendBoolean(bool in_value); | 466 void AppendBoolean(bool in_value); |
467 void AppendInteger(int in_value); | 467 void AppendInteger(int in_value); |
468 void AppendDouble(double in_value); | 468 void AppendDouble(double in_value); |
469 void AppendString(StringPiece in_value); | 469 void AppendString(StringPiece in_value); |
470 void AppendString(const string16& in_value); | 470 void AppendString(const string16& in_value); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 } | 556 } |
557 | 557 |
558 BASE_EXPORT inline std::ostream& operator<<(std::ostream& out, | 558 BASE_EXPORT inline std::ostream& operator<<(std::ostream& out, |
559 const ListValue& value) { | 559 const ListValue& value) { |
560 return out << static_cast<const Value&>(value); | 560 return out << static_cast<const Value&>(value); |
561 } | 561 } |
562 | 562 |
563 } // namespace base | 563 } // namespace base |
564 | 564 |
565 #endif // BASE_VALUES_H_ | 565 #endif // BASE_VALUES_H_ |
OLD | NEW |