Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: src/ostreams.cc

Issue 363323003: More OStreamsUse OStreams more often. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased and polished. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ostreams.h ('k') | src/property.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ostreams.cc
diff --git a/src/ostreams.cc b/src/ostreams.cc
index 8a25c4592ae5d1798daeeb1eadf47ad2d76d9172..b04803cf9f6e77fc0589ee235f0cd57aa277bc96 100644
--- a/src/ostreams.cc
+++ b/src/ostreams.cc
@@ -158,4 +158,13 @@ OFStream& OFStream::flush() {
return *this;
}
+
+OStream& operator<<(OStream& os, const AsUC16& c) {
+ char buf[10];
+ const char* format = (0x20 <= c.value && c.value <= 0x7F)
+ ? "%c"
+ : (c.value <= 0xff) ? "\\x%02x" : "\\u%04x";
+ snprintf(buf, sizeof(buf), format, c.value);
+ return os << buf;
+}
} } // namespace v8::internal
« no previous file with comments | « src/ostreams.h ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698