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

Unified Diff: runtime/vm/object.h

Issue 100833005: Add Instance::ToUserCString. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 30995)
+++ runtime/vm/object.h (working copy)
@@ -3962,6 +3962,10 @@
// error object if evaluating the expression fails.
RawObject* Evaluate(const String& expr) const;
+ // Returns a string representation of this instance in a form
+ // that is suitable for an end user.
+ virtual const char* ToUserCString(intptr_t maxLen = 40) const;
+
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(RawInstance));
}
@@ -4894,6 +4898,9 @@
void* peer,
Dart_PeerFinalizer cback) const;
+ // Produces a quoted, escaped, (possibly) truncated string.
+ const char* ToUserCString(intptr_t maxLen = 40) const;
+
// Creates a new String object from a C string that is assumed to contain
// UTF-8 encoded characters and '\0' is considered a termination character.
// TODO(7123) - Rename this to FromCString(....).
@@ -5018,6 +5025,9 @@
CallbackType new_symbol,
Snapshot::Kind kind);
+ intptr_t EscapedString(char* buffer, int maxLen) const;
+ intptr_t EscapedStringLen(intptr_t tooLong) const;
+
FINAL_HEAP_OBJECT_IMPLEMENTATION(String, Instance);
friend class Class;
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698