Index: net/cert/signed_tree_head.cc |
diff --git a/net/cert/signed_tree_head.cc b/net/cert/signed_tree_head.cc |
index ef1ab708c7c9e18c5f938e58368ae3a66b719a7d..76bf68f02f152bc0533c1951acd9f955e3ef2bea 100644 |
--- a/net/cert/signed_tree_head.cc |
+++ b/net/cert/signed_tree_head.cc |
@@ -5,6 +5,7 @@ |
#include "net/cert/signed_tree_head.h" |
#include <string.h> |
davidben
2016/03/02 17:30:39
Nit: I think this wants newline here? At least, th
Eran Messeri
2016/03/04 11:28:30
Done.
|
+#include <sstream> |
#include "base/strings/string_number_conversions.h" |
@@ -29,17 +30,18 @@ SignedTreeHead::SignedTreeHead(Version version, |
SignedTreeHead::~SignedTreeHead() {} |
-std::ostream& operator<<(std::ostream& stream, const SignedTreeHead& sth) { |
- return stream << "{\n" |
- << "\t\"version\": " << sth.version << ",\n" |
- << "\t\"timestamp\": " << sth.timestamp << ",\n" |
- << "\t\"tree_size\": " << sth.tree_size << ",\n" |
- << "\t\"sha256_root_hash\": \"" |
- << base::HexEncode(sth.sha256_root_hash, kSthRootHashLength) |
- << "\",\n\t\"log_id\": \"" |
- << base::HexEncode(sth.log_id.data(), sth.log_id.size()) |
- << "\"\n" |
- << "}"; |
+std::string DebugString(const SignedTreeHead& sth) { |
+ std::ostringstream stream; |
+ stream << "{\n" |
+ << "\t\"version\": " << sth.version << ",\n" |
+ << "\t\"timestamp\": " << sth.timestamp << ",\n" |
+ << "\t\"tree_size\": " << sth.tree_size << ",\n" |
+ << "\t\"sha256_root_hash\": \"" |
+ << base::HexEncode(sth.sha256_root_hash, kSthRootHashLength) |
+ << "\",\n\t\"log_id\": \"" |
+ << base::HexEncode(sth.log_id.data(), sth.log_id.size()) << "\"\n" |
+ << "}"; |
+ return stream.str(); |
} |
} // namespace ct |