Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: base/values.h

Issue 2839753005: Remove base::Value::GetAsBinary (Closed)
Patch Set: ASSERT_TRUE Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/trace_event/trace_event_memory_overhead.cc ('k') | base/values.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // If the current object can be converted into the given type, the value is 141 // If the current object can be converted into the given type, the value is
142 // returned through the |out_value| parameter and true is returned; 142 // returned through the |out_value| parameter and true is returned;
143 // otherwise, false is returned and |out_value| is unchanged. 143 // otherwise, false is returned and |out_value| is unchanged.
144 bool GetAsBoolean(bool* out_value) const; 144 bool GetAsBoolean(bool* out_value) const;
145 bool GetAsInteger(int* out_value) const; 145 bool GetAsInteger(int* out_value) const;
146 bool GetAsDouble(double* out_value) const; 146 bool GetAsDouble(double* out_value) const;
147 bool GetAsString(std::string* out_value) const; 147 bool GetAsString(std::string* out_value) const;
148 bool GetAsString(string16* out_value) const; 148 bool GetAsString(string16* out_value) const;
149 bool GetAsString(const Value** out_value) const; 149 bool GetAsString(const Value** out_value) const;
150 bool GetAsString(StringPiece* out_value) const; 150 bool GetAsString(StringPiece* out_value) const;
151 bool GetAsBinary(const Value** out_value) const;
152 // ListValue::From is the equivalent for std::unique_ptr conversions. 151 // ListValue::From is the equivalent for std::unique_ptr conversions.
153 bool GetAsList(ListValue** out_value); 152 bool GetAsList(ListValue** out_value);
154 bool GetAsList(const ListValue** out_value) const; 153 bool GetAsList(const ListValue** out_value) const;
155 // DictionaryValue::From is the equivalent for std::unique_ptr conversions. 154 // DictionaryValue::From is the equivalent for std::unique_ptr conversions.
156 bool GetAsDictionary(DictionaryValue** out_value); 155 bool GetAsDictionary(DictionaryValue** out_value);
157 bool GetAsDictionary(const DictionaryValue** out_value) const; 156 bool GetAsDictionary(const DictionaryValue** out_value) const;
158 // Note: Do not add more types. See the file-level comment above for why. 157 // Note: Do not add more types. See the file-level comment above for why.
159 158
160 // This creates a deep copy of the entire Value tree, and returns a pointer 159 // This creates a deep copy of the entire Value tree, and returns a pointer
161 // to the copy. The caller gets ownership of the copy, of course. 160 // to the copy. The caller gets ownership of the copy, of course.
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 return out << static_cast<const Value&>(value); 534 return out << static_cast<const Value&>(value);
536 } 535 }
537 536
538 // Stream operator so that enum class Types can be used in log statements. 537 // Stream operator so that enum class Types can be used in log statements.
539 BASE_EXPORT std::ostream& operator<<(std::ostream& out, 538 BASE_EXPORT std::ostream& operator<<(std::ostream& out,
540 const Value::Type& type); 539 const Value::Type& type);
541 540
542 } // namespace base 541 } // namespace base
543 542
544 #endif // BASE_VALUES_H_ 543 #endif // BASE_VALUES_H_
OLDNEW
« no previous file with comments | « base/trace_event/trace_event_memory_overhead.cc ('k') | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698