Index: src/ostreams.h |
diff --git a/src/ostreams.h b/src/ostreams.h |
index 840f341551632a4d21e5e747be1a524f0f1cc752..6f8600e7b1c522b6d3aab16be4bc63e74fe42cb5 100644 |
--- a/src/ostreams.h |
+++ b/src/ostreams.h |
@@ -55,12 +55,20 @@ struct AsReversiblyEscapedUC16 { |
uint16_t value; |
}; |
+struct AsEscapedUC16ForJSON { |
+ explicit AsEscapedUC16ForJSON(uint16_t v) : value(v) {} |
+ uint16_t value; |
+}; |
+ |
// Writes the given character to the output escaping everything outside of |
// printable/space ASCII range. Additionally escapes '\' making escaping |
// reversible. |
std::ostream& operator<<(std::ostream& os, const AsReversiblyEscapedUC16& c); |
+// Same as AsReversiblyEscapedUC16 with additional escaping of \n, \r, " and '. |
+std::ostream& operator<<(std::ostream& os, const AsEscapedUC16ForJSON& c); |
+ |
// Writes the given character to the output escaping everything outside |
// of printable ASCII range. |
std::ostream& operator<<(std::ostream& os, const AsUC16& c); |