Write the contents of the string to an external buffer. If no arguments are given, expects the buffer to be large enough to hold the entire string and NULL terminator. Copies the contents of the string and the NULL terminator into the buffer.

WriteUtf8 will not write partial UTF-8 sequences, preferring to stop before the end of the buffer.

Copies up to length characters into the output buffer. Only null-terminates if there is enough space in the buffer.

Parameters

buffer

The buffer into which the string will be copied.

start

The starting position within the string at which copying begins.

length

The number of characters to copy from the string. For WriteUtf8 the number of bytes in the buffer.

nchars_ref

The number of characters written, can be NULL.

options

Various options that might affect performance of this or subsequent operations.

Returns

The number of characters copied to the buffer excluding the null terminator. For WriteUtf8: The number of bytes copied to the buffer including the null terminator (if written).

Associate an external string resource with this string by transforming it in place so that existing references to this string in the JavaScript heap will use the external string resource. The external string resource's character contents need to be equivalent to this string. Returns true if the string has been changed to be an external string. The string is not modified if the operation fails. See NewExternal for information on the lifetime of the resource.

Associate an external string resource with this string by transforming it in place so that existing references to this string in the JavaScript heap will use the external string resource. The external string resource's character contents need to be equivalent to this string. Returns true if the string has been changed to be an external string. The string is not modified if the operation fails. See NewExternal for information on the lifetime of the resource.

Creates a new external string using the data defined in the given resource. When the external string is no longer live on V8's heap the resource will be disposed by calling its Dispose method. The caller of this function should not otherwise delete or modify the resource. Neither should the underlying buffer be deallocated or modified except through the destructor of the external string resource.

Creates a new external string using the ASCII data defined in the given resource. When the external string is no longer live on V8's heap the resource will be disposed by calling its Dispose method. The caller of this function should not otherwise delete or modify the resource. Neither should the underlying buffer be deallocated or modified except through the destructor of the external string resource.