v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::String::Utf8Value Class Reference

#include <v8-primitive.h>

Collaboration diagram for v8::String::Utf8Value:

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
 

Private Attributes

char * str_
 
size_t length_
 

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.

Definition at line 648 of file v8-primitive.h.

Constructor & Destructor Documentation

◆ Utf8Value() [1/2]

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

Definition at line 11031 of file api.cc.

Here is the call graph for this function:

◆ ~Utf8Value()

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

Definition at line 11050 of file api.cc.

Here is the call graph for this function:

◆ Utf8Value() [2/2]

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

Member Function Documentation

◆ length()

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

Definition at line 655 of file v8-primitive.h.

Here is the caller graph for this function:

◆ operator*() [1/2]

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

Definition at line 653 of file v8-primitive.h.

◆ operator*() [2/2]

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

Definition at line 654 of file v8-primitive.h.

◆ operator=()

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

Member Data Documentation

◆ length_

size_t v8::String::Utf8Value::length_
private

Definition at line 663 of file v8-primitive.h.

◆ str_

char* v8::String::Utf8Value::str_
private

Definition at line 662 of file v8-primitive.h.


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