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

Unified Diff: src/string-builder.h

Issue 1922603006: [JSON] implement indentation in the BasicJsonStringifier and expose via API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 7 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/runtime/runtime-object.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-builder.h
diff --git a/src/string-builder.h b/src/string-builder.h
index 98bd82b97a011712e14c8365e1c007231378c211..b92bb96e5e02f3c59a0b00faacce0873e1d9b5e2 100644
--- a/src/string-builder.h
+++ b/src/string-builder.h
@@ -293,6 +293,14 @@ class IncrementalStringBuilder {
}
}
+ INLINE(void AppendCString(const uc16* s)) {
+ if (encoding_ == String::ONE_BYTE_ENCODING) {
+ while (*s != '\0') Append<uc16, uint8_t>(*(s++));
+ } else {
+ while (*s != '\0') Append<uc16, uc16>(*(s++));
+ }
+ }
+
INLINE(bool CurrentPartCanFit(int length)) {
return part_length_ - current_index_ > length;
}
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698