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