Loading...
Searching...
No Matches
Public Member Functions | List of all members
v8::String::Utf8Value Class Reference

#include <v8-primitive.h>

Public Member Functions

 Utf8Value (Isolate *isolate, Local< v8::Value > obj, WriteOptions options=REPLACE_INVALID_UTF8)
 
 ~Utf8Value ()
 
char * operator* ()
 
const char * operator* () const
 
size_t length () const
 
 Utf8Value (const Utf8Value &)=delete
 
void operator= (const Utf8Value &)=delete
 

Detailed Description

Converts an object to a UTF-8-encoded character array. Useful if you want to print the object. If conversion to a string fails (e.g. due to an exception in the toString() method of the object) then the length() method returns 0 and the * operator returns NULL.

WARNING: This will unconditionally copy the contents of the JavaScript string, and should be avoided in situations where performance is a concern. Consider using WriteUtf8() instead.

Examples
shell.cc.

Constructor & Destructor Documentation

◆ Utf8Value() [1/2]

v8::String::Utf8Value::Utf8Value ( Isolate isolate,
Local< v8::Value obj,
WriteOptions  options = REPLACE_INVALID_UTF8 
)

◆ ~Utf8Value()

v8::String::Utf8Value::~Utf8Value ( )

◆ Utf8Value() [2/2]

v8::String::Utf8Value::Utf8Value ( const Utf8Value )
delete

Member Function Documentation

◆ length()

size_t v8::String::Utf8Value::length ( ) const
inline

◆ operator*() [1/2]

char * v8::String::Utf8Value::operator* ( )
inline

◆ operator*() [2/2]

const char * v8::String::Utf8Value::operator* ( ) const
inline

◆ operator=()

void v8::String::Utf8Value::operator= ( const Utf8Value )
delete

The documentation for this class was generated from the following file: