v8 13.6.233 (node 24.1.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
String::ValueView Class Reference

#include <v8-primitive.h>

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
 

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]

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

Referenced by operator=(), and ValueView().

◆ ~ValueView()

~ValueView ( )

◆ ValueView() [2/2]

ValueView ( const ValueView & )
delete

References ValueView().

Member Function Documentation

◆ data16()

const uint16_t * data16 ( ) const
inline

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

References data16_.

◆ data8()

const uint8_t * data8 ( ) const
inline

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

References data8_.

◆ is_one_byte()

bool is_one_byte ( ) const
inline

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

Referenced by operator=().

◆ length()

uint32_t length ( ) const
inline

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

◆ operator=()

void operator= ( const ValueView & )
delete

References is_one_byte(), and ValueView().

Field Documentation

◆ data16_

const uint16_t* data16_

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

Referenced by data16().

◆ data8_

const uint8_t* data8_

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

Referenced by data8().


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