#include <v8.h>

Public Member Functions | |
| int | Length () const |
| int | Utf8Length () const |
| int | Write (uint16_t *buffer, int start=0, int length=-1) const |
| int | WriteAscii (char *buffer, int start=0, int length=-1) const |
| int | WriteUtf8 (char *buffer, int length=-1) const |
| bool | IsExternal () const |
| bool | IsExternalAscii () const |
| ExternalStringResource * | GetExternalStringResource () const |
| ExternalAsciiStringResource * | GetExternalAsciiStringResource () const |
| bool | MakeExternal (ExternalStringResource *resource) |
| bool | MakeExternal (ExternalAsciiStringResource *resource) |
| bool | CanMakeExternal () |
Static Public Member Functions | |
| static v8::Local< v8::String > | Empty () |
| static String * | Cast (v8::Value *obj) |
| static Local< String > | New (const char *data, int length=-1) |
| static Local< String > | New (const uint16_t *data, int length=-1) |
| static Local< String > | NewSymbol (const char *data, int length=-1) |
| static Local< String > | Concat (Handle< String > left, Handle< String >right) |
| static Local< String > | NewExternal (ExternalStringResource *resource) |
| static Local< String > | NewExternal (ExternalAsciiStringResource *resource) |
| static Local< String > | NewUndetectable (const char *data, int length=-1) |
| static Local< String > | NewUndetectable (const uint16_t *data, int length=-1) |
Classes | |
| class | AsciiValue |
| class | ExternalAsciiStringResource |
| class | ExternalStringResource |
| class | ExternalStringResourceBase |
| class | Utf8Value |
| class | Value |
| int v8::String::Length | ( | ) | const |
Returns the number of characters in this string.
| int v8::String::Utf8Length | ( | ) | const |
Returns the number of bytes in the UTF-8 encoded representation of this string.
| int v8::String::Write | ( | uint16_t * | buffer, | |
| int | start = 0, |
|||
| int | length = -1 | |||
| ) | const |
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.
Copies up to length characters into the output buffer. Only null-terminates if there is enough space in the buffer.
| 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 bytes to copy from the string. |
| static v8::Local<v8::String> v8::String::Empty | ( | ) | [static] |
A zero length string.
| bool v8::String::IsExternal | ( | ) | const |
Returns true if the string is external
Reimplemented from v8::Value.
| bool v8::String::IsExternalAscii | ( | ) | const |
Returns true if the string is both external and ascii
| String::ExternalStringResource * v8::String::GetExternalStringResource | ( | ) | const [inline] |
Get the ExternalStringResource for an external string. Returns NULL if IsExternal() doesn't return true.
| ExternalAsciiStringResource* v8::String::GetExternalAsciiStringResource | ( | ) | const |
Get the ExternalAsciiStringResource for an external ascii string. Returns NULL if IsExternalAscii() doesn't return true.
Allocates a new string from either utf-8 encoded or ascii data. The second parameter 'length' gives the buffer length. If the data is utf-8 encoded, the caller must be careful to supply the length parameter. If it is not given, the function calls 'strlen' to determine the buffer length, it might be wrong if 'data' contains a null character.
Allocates a new string from utf16 data.
Creates a symbol. Returns one if it exists already.
Creates a new string by concatenating the left and the right strings passed in as parameters.
| static Local<String> v8::String::NewExternal | ( | ExternalStringResource * | resource | ) | [static] |
Creates a new external string using the data defined in the given resource. The resource is deleted when the external string is no longer live on V8's heap. The caller of this function should not delete or modify the resource. Neither should the underlying buffer be deallocated or modified except through the destructor of the external string resource.
| bool v8::String::MakeExternal | ( | ExternalStringResource * | 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 needs 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.
| static Local<String> v8::String::NewExternal | ( | ExternalAsciiStringResource * | resource | ) | [static] |
Creates a new external string using the ascii data defined in the given resource. The resource is deleted when the external string is no longer live on V8's heap. The caller of this function should not delete or modify the resource. Neither should the underlying buffer be deallocated or modified except through the destructor of the external string resource.
| bool v8::String::MakeExternal | ( | ExternalAsciiStringResource * | 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 needs 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.
| bool v8::String::CanMakeExternal | ( | ) |
Returns true if this string can be made external.
Creates an undetectable string from the supplied ascii or utf-8 data.
| static Local<String> v8::String::NewUndetectable | ( | const uint16_t * | data, | |
| int | length = -1 | |||
| ) | [static] |
Creates an undetectable string from the supplied utf-16 data.
1.5.6