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

Side by Side Diff: base/values.h

Issue 10915194: Add an ostream operator to Value (based on JSONWriter) so that assertions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove base:: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 setting and other persistable data. It includes the ability to 6 // storing setting and other persistable data. It includes the ability to
7 // specify (recursive) lists and dictionaries, so it's fairly expressive. 7 // specify (recursive) lists and dictionaries, so it's fairly expressive.
8 // However, the API is optimized for the common case, namely storing a 8 // However, the API is optimized for the common case, namely storing a
9 // hierarchical tree of simple values. Given a DictionaryValue root, you can 9 // hierarchical tree of simple values. Given a DictionaryValue root, you can
10 // easily do things like: 10 // easily do things like:
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 498
499 // This method deserializes the subclass-specific format into a Value object. 499 // This method deserializes the subclass-specific format into a Value object.
500 // If the return value is non-NULL, the caller takes ownership of returned 500 // If the return value is non-NULL, the caller takes ownership of returned
501 // Value. If the return value is NULL, and if error_code is non-NULL, 501 // Value. If the return value is NULL, and if error_code is non-NULL,
502 // error_code will be set with the underlying error. 502 // error_code will be set with the underlying error.
503 // If |error_message| is non-null, it will be filled in with a formatted 503 // If |error_message| is non-null, it will be filled in with a formatted
504 // error message including the location of the error if appropriate. 504 // error message including the location of the error if appropriate.
505 virtual Value* Deserialize(int* error_code, std::string* error_str) = 0; 505 virtual Value* Deserialize(int* error_code, std::string* error_str) = 0;
506 }; 506 };
507 507
508 // Stream operator so Values can be used in assertion statements.
509 BASE_EXPORT std::ostream& operator<<(std::ostream& out, const Value& value);
510
508 } // namespace base 511 } // namespace base
509 512
510 // http://crbug.com/88666 513 // http://crbug.com/88666
511 using base::DictionaryValue; 514 using base::DictionaryValue;
512 using base::ListValue; 515 using base::ListValue;
513 using base::StringValue; 516 using base::StringValue;
514 using base::Value; 517 using base::Value;
515 518
516 #endif // BASE_VALUES_H_ 519 #endif // BASE_VALUES_H_
OLDNEW
« no previous file with comments | « no previous file | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698