Index: base/values.cc |
diff --git a/base/values.cc b/base/values.cc |
index c9b5eef3da7052d8b05e086656bcc539026f91c4..1063effe3778d9dc644ab5750f4e47fa41f9e77c 100644 |
--- a/base/values.cc |
+++ b/base/values.cc |
@@ -5,8 +5,10 @@ |
#include "base/values.h" |
#include <algorithm> |
+#include <ostream> |
#include "base/float_util.h" |
+#include "base/json/json_writer.h" |
#include "base/logging.h" |
#include "base/string_util.h" |
#include "base/utf_string_conversions.h" |
@@ -1057,4 +1059,12 @@ bool ListValue::Equals(const Value* other) const { |
ValueSerializer::~ValueSerializer() { |
} |
+std::ostream& operator<<(std::ostream& out, const Value& value) { |
+ std::string json; |
+ JSONWriter::WriteWithOptions(&value, |
+ JSONWriter::OPTIONS_PRETTY_PRINT, |
+ &json); |
+ return out << json; |
+} |
+ |
} // namespace base |