Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / v8 / src / ostreams.h
index f70b6de..508a88d 100644 (file)
@@ -83,8 +83,8 @@ class OStringStream: public OStream {
   // 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.
@@ -107,8 +107,8 @@ class OFStream: public OStream {
   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_;
@@ -117,13 +117,26 @@ class OFStream: public OStream {
 };
 
 
-// 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