Index: src/ostreams.h |
diff --git a/src/ostreams.h b/src/ostreams.h |
index 1c2f38a1539e6ed42736a5f8b6ae82200f27c367..977b5c6f4a48cbeda0e0163b678917779afeeac2 100644 |
--- a/src/ostreams.h |
+++ b/src/ostreams.h |
@@ -66,6 +66,12 @@ struct AsEscapedUC16ForJSON { |
uint16_t value; |
}; |
+struct AsHex { |
+ explicit AsHex(uint64_t v, uint8_t min_width = 0) |
+ : value(v), min_width(min_width) {} |
+ uint64_t value; |
+ uint8_t min_width; |
+}; |
// Writes the given character to the output escaping everything outside of |
// printable/space ASCII range. Additionally escapes '\' making escaping |
@@ -83,6 +89,9 @@ std::ostream& operator<<(std::ostream& os, const AsUC16& c); |
// of printable ASCII range. |
std::ostream& operator<<(std::ostream& os, const AsUC32& c); |
+// Writes the given number to the output in hexadecimal notation. |
+std::ostream& operator<<(std::ostream& os, const AsHex& v); |
+ |
} // namespace internal |
} // namespace v8 |