| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 // For situations where you want to keep ownership of your buffer, this | 68 // For situations where you want to keep ownership of your buffer, this |
| 69 // factory method creates a new BinaryValue by copying the contents of the | 69 // factory method creates a new BinaryValue by copying the contents of the |
| 70 // buffer that's passed in. | 70 // buffer that's passed in. |
| 71 // DEPRECATED, use MakeUnique<Value>(const std::vector<char>&) instead. | 71 // DEPRECATED, use MakeUnique<Value>(const std::vector<char>&) instead. |
| 72 // TODO(crbug.com/646113): Delete this and migrate callsites. | 72 // TODO(crbug.com/646113): Delete this and migrate callsites. |
| 73 static std::unique_ptr<BinaryValue> CreateWithCopiedBuffer(const char* buffer, | 73 static std::unique_ptr<BinaryValue> CreateWithCopiedBuffer(const char* buffer, |
| 74 size_t size); | 74 size_t size); |
| 75 | 75 |
| 76 Value(const Value& that); | 76 Value(const Value& that); |
| 77 Value(Value&& that); | 77 Value(Value&& that) noexcept; |
| 78 Value(); // A null value. | 78 Value(); // A null value. |
| 79 explicit Value(Type type); | 79 explicit Value(Type type); |
| 80 explicit Value(bool in_bool); | 80 explicit Value(bool in_bool); |
| 81 explicit Value(int in_int); | 81 explicit Value(int in_int); |
| 82 explicit Value(double in_double); | 82 explicit Value(double in_double); |
| 83 | 83 |
| 84 // Value(const char*) and Value(const char16*) are required despite | 84 // Value(const char*) and Value(const char16*) are required despite |
| 85 // Value(const std::string&) and Value(const string16&) because otherwise the | 85 // Value(const std::string&) and Value(const string16&) because otherwise the |
| 86 // compiler will choose the Value(bool) constructor for these arguments. | 86 // compiler will choose the Value(bool) constructor for these arguments. |
| 87 // Value(std::string&&) allow for efficient move construction. | 87 // Value(std::string&&) allow for efficient move construction. |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 return out << static_cast<const Value&>(value); | 513 return out << static_cast<const Value&>(value); |
| 514 } | 514 } |
| 515 | 515 |
| 516 // Stream operator so that enum class Types can be used in log statements. | 516 // Stream operator so that enum class Types can be used in log statements. |
| 517 BASE_EXPORT std::ostream& operator<<(std::ostream& out, | 517 BASE_EXPORT std::ostream& operator<<(std::ostream& out, |
| 518 const Value::Type& type); | 518 const Value::Type& type); |
| 519 | 519 |
| 520 } // namespace base | 520 } // namespace base |
| 521 | 521 |
| 522 #endif // BASE_VALUES_H_ | 522 #endif // BASE_VALUES_H_ |
| OLD | NEW |