Index: webrtc/base/optional.cc |
diff --git a/webrtc/base/optional.cc b/webrtc/base/optional.cc |
index 6bebdd5a19225fcf46424e97c95d28ccba1b800e..455cfe939a936f9e2f0571d2a5624b42f42f7e55 100644 |
--- a/webrtc/base/optional.cc |
+++ b/webrtc/base/optional.cc |
@@ -10,6 +10,8 @@ |
#include "webrtc/base/optional.h" |
+#include <iomanip> |
+ |
namespace rtc { |
namespace optional_internal { |
@@ -19,5 +21,18 @@ void* FunctionThatDoesNothingImpl(void* x) { return x; } |
#endif |
+void OptionalPrintObjectBytes(const unsigned char* bytes, |
+ size_t size, |
+ std::ostream* os) { |
+ *os << "<optional with " << size << "-byte object ["; |
+ for (size_t i = 0; i != size; ++i) { |
+ *os << (i == 0 ? "" : ((i & 1) ? "-" : " ")); |
+ *os << std::hex << std::setw(2) << std::setfill('0') |
+ << static_cast<int>(bytes[i]); |
+ } |
+ *os << "]>"; |
+} |
kwiberg-webrtc
2017/02/17 13:51:22
This is just for testing, so you should probably i
ossu
2017/02/17 14:02:19
I'd rather keep this cruft as isolated as possible
tommi
2017/02/17 14:08:55
My concern is that if we get to the point that we
|
+ |
} // namespace optional_internal |
+ |
} // namespace rtc |