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

Unified Diff: runtime/include/dart_api.h

Issue 10306002: Do not externalize Dart strings as C strings for "print()". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 years, 8 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 | « runtime/bin/builtin_natives.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 7de23770eaee0e61f9238f6aa9c9b251f9e06090..688e11482ad296a0eed6033b37b7f90e7f48cab3 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -1256,6 +1256,21 @@ DART_EXPORT Dart_Handle Dart_StringGet32(Dart_Handle str,
DART_EXPORT Dart_Handle Dart_StringToCString(Dart_Handle str,
const char** utf8);
+/**
+ * Gets a UTF-8 encoded representation of a String.
+ *
+ * \param str A string.
+ * \param bytes Returns the String represented as an array of UTF-8
+ * code units. This array is scope allocated and is only valid until
+ * the next call to Dart_ExitScope.
+ * \param length Returns the length of the code units array, in bytes.
+ *
+ * \return A valid handle if no error occurs during the operation.
+ */
+DART_EXPORT Dart_Handle Dart_StringToBytes(Dart_Handle str,
+ const uint8_t** bytes,
+ intptr_t* length);
+
// --- Lists ---
/**
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698