// Internally, our character data is always 0-terminated.
const char* c_str() const { return data(); }
- virtual OStringStream& write(const char* s, size_t n) V8_OVERRIDE;
- virtual OStringStream& flush() V8_OVERRIDE;
+ virtual OStringStream& write(const char* s, size_t n) OVERRIDE;
+ virtual OStringStream& flush() OVERRIDE;
private:
// Primitive allocator interface, can be extracted if needed.
explicit OFStream(FILE* f) : f_(f) { }
virtual ~OFStream() { }
- virtual OFStream& write(const char* s, size_t n) V8_OVERRIDE;
- virtual OFStream& flush() V8_OVERRIDE;
+ virtual OFStream& write(const char* s, size_t n) OVERRIDE;
+ virtual OFStream& flush() OVERRIDE;
private:
FILE* const f_;
};
-// A wrapper to disambiguate uint16_t and uc16.
+// Wrappers to disambiguate uint16_t and uc16.
struct AsUC16 {
explicit AsUC16(uint16_t v) : value(v) {}
uint16_t value;
};
+struct AsReversiblyEscapedUC16 {
+ explicit AsReversiblyEscapedUC16(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.
+OStream& operator<<(OStream& os, const AsReversiblyEscapedUC16& c);
+
+// Writes the given character to the output escaping everything outside
+// of printable ASCII range.
OStream& operator<<(OStream& os, const AsUC16& c);
} } // namespace v8::internal