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

#include <v8-primitive.h>

Collaboration diagram for v8::String::ValueView:

Public Member Functions

 ValueView (Isolate *isolate, Local< v8::String > str)
 
 ~ValueView ()
 
const uint8_t * data8 () const
 
const uint16_t * data16 () const
 
uint32_t length () const
 
bool is_one_byte () const
 
 ValueView (const ValueView &)=delete
 
void operator= (const ValueView &)=delete
 

Private Member Functions

void CheckOneByte (bool is_one_byte) const
 

Private Attributes

Local< v8::Stringflat_str_
 
union { 
 
   const uint8_t *   data8_ 
 
   const uint16_t *   data16_ 
 
};  
 
uint32_t length_
 
bool is_one_byte_
 
char no_gc_debug_scope_ [internal::Internals::kDisallowGarbageCollectionSize]
 

Detailed Description

Returns a view onto a string's contents.

WARNING: This does not copy the string's contents, and will therefore be invalidated if the GC can move the string while the ValueView is alive. It is therefore required that no GC or allocation can happen while there is an active ValueView. This requirement may be relaxed in the future.

V8 strings are either encoded as one-byte or two-bytes per character.

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

Constructor & Destructor Documentation

◆ ValueView() [1/2]

v8::String::ValueView::ValueView ( v8::Isolate * v8_isolate,
Local< v8::String > str )

Definition at line 11070 of file api.cc.

Here is the call graph for this function:

◆ ~ValueView()

v8::String::ValueView::~ValueView ( )

Definition at line 11092 of file api.cc.

◆ ValueView() [2/2]

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

Member Function Documentation

◆ CheckOneByte()

void v8::String::ValueView::CheckOneByte ( bool is_one_byte) const
private

Definition at line 11099 of file api.cc.

Here is the call graph for this function:

◆ data16()

const uint16_t * v8::String::ValueView::data16 ( ) const
inline

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

◆ data8()

const uint8_t * v8::String::ValueView::data8 ( ) const
inline

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

◆ is_one_byte()

bool v8::String::ValueView::is_one_byte ( ) const
inline

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

◆ length()

uint32_t v8::String::ValueView::length ( ) const
inline

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

◆ operator=()

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

Member Data Documentation

◆ [union]

union { ... } v8::String::ValueView

◆ data16_

const uint16_t* v8::String::ValueView::data16_

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

◆ data8_

const uint8_t* v8::String::ValueView::data8_

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

◆ flat_str_

Local<v8::String> v8::String::ValueView::flat_str_
private

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

◆ is_one_byte_

bool v8::String::ValueView::is_one_byte_
private

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

◆ length_

uint32_t v8::String::ValueView::length_
private

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

◆ no_gc_debug_scope_

char v8::String::ValueView::no_gc_debug_scope_[internal::Internals::kDisallowGarbageCollectionSize]
private

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


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