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

#include <unicode.h>

Collaboration diagram for unibrow::Utf8:

Classes

struct  EncodingResult
 

Public Types

using State = Utf8DfaDecoder::State
 
using Utf8IncrementalBuffer = uint32_t
 

Static Public Member Functions

static unsigned LengthOneByte (uint8_t chr)
 
static unsigned Length (uchar chr, int previous)
 
static unsigned EncodeOneByte (char *out, uint8_t c)
 
static unsigned Encode (char *out, uchar c, int previous, bool replace_invalid=false)
 
static uchar CalculateValue (const uint8_t *str, size_t length, size_t *cursor)
 
static uchar ValueOf (const uint8_t *str, size_t length, size_t *cursor)
 
static uchar ValueOfIncremental (const uint8_t **cursor, State *state, Utf8IncrementalBuffer *buffer)
 
static uchar ValueOfIncrementalFinish (State *state)
 
static bool IsValidCharacter (uchar c)
 
static bool ValidateEncoding (const uint8_t *str, size_t length)
 
template<typename Char >
static EncodingResult Encode (v8::base::Vector< const Char > string, char *buffer, size_t capacity, bool write_null, bool replace_invalid_utf8)
 

Static Public Attributes

static const uchar kBadChar = 0xFFFD
 
static const uchar kBufferEmpty = 0x0
 
static const uchar kIncomplete = 0xFFFFFFFC
 
static const unsigned kMaxEncodedSize = 4
 
static const unsigned kMaxOneByteChar = 0x7f
 
static const unsigned kMaxTwoByteChar = 0x7ff
 
static const unsigned kMaxThreeByteChar = 0xffff
 
static const unsigned kMaxFourByteChar = 0x1fffff
 
static const unsigned kBytesSavedByCombiningSurrogates = 2
 
static const unsigned kSizeOfUnmatchedSurrogate = 3
 
static const unsigned kMax16BitCodeUnitSize = 3
 
static const unsigned kMax8BitCodeUnitSize = 2
 

Detailed Description

Definition at line 161 of file unicode.h.

Member Typedef Documentation

◆ State

using unibrow::Utf8::State = Utf8DfaDecoder::State

Definition at line 163 of file unicode.h.

◆ Utf8IncrementalBuffer

Definition at line 197 of file unicode.h.

Member Function Documentation

◆ CalculateValue()

uchar unibrow::Utf8::CalculateValue ( const uint8_t * str,
size_t length,
size_t * cursor )
static

Definition at line 202 of file unicode.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Encode() [1/2]

unsigned unibrow::Utf8::Encode ( char * out,
uchar c,
int previous,
bool replace_invalid = false )
inlinestatic

Definition at line 147 of file unicode-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Encode() [2/2]

template<typename Char >
Utf8::EncodingResult unibrow::Utf8::Encode ( v8::base::Vector< const Char > string,
char * buffer,
size_t capacity,
bool write_null,
bool replace_invalid_utf8 )
static

Definition at line 223 of file unicode-inl.h.

Here is the call graph for this function:

◆ EncodeOneByte()

unsigned unibrow::Utf8::EncodeOneByte ( char * out,
uint8_t c )
inlinestatic

Definition at line 131 of file unicode-inl.h.

Here is the caller graph for this function:

◆ IsValidCharacter()

bool unibrow::Utf8::IsValidCharacter ( uchar c)
inlinestatic

Definition at line 216 of file unicode-inl.h.

◆ Length()

unsigned unibrow::Utf8::Length ( uchar chr,
int previous )
inlinestatic

Definition at line 200 of file unicode-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LengthOneByte()

unsigned unibrow::Utf8::LengthOneByte ( uint8_t chr)
inlinestatic

Definition at line 192 of file unicode-inl.h.

Here is the caller graph for this function:

◆ ValidateEncoding()

bool unibrow::Utf8::ValidateEncoding ( const uint8_t * str,
size_t length )
static

Definition at line 234 of file unicode.cc.

Here is the caller graph for this function:

◆ ValueOf()

uchar unibrow::Utf8::ValueOf ( const uint8_t * str,
size_t length,
size_t * cursor )
inlinestatic

Definition at line 181 of file unicode-inl.h.

Here is the call graph for this function:

◆ ValueOfIncremental()

uchar unibrow::Utf8::ValueOfIncremental ( const uint8_t ** cursor,
State * state,
Utf8IncrementalBuffer * buffer )
inlinestatic

Definition at line 86 of file unicode-inl.h.

Here is the caller graph for this function:

◆ ValueOfIncrementalFinish()

uchar unibrow::Utf8::ValueOfIncrementalFinish ( State * state)
static

Definition at line 224 of file unicode.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ kBadChar

const uchar unibrow::Utf8::kBadChar = 0xFFFD
static

Definition at line 175 of file unicode.h.

◆ kBufferEmpty

const uchar unibrow::Utf8::kBufferEmpty = 0x0
static

Definition at line 176 of file unicode.h.

◆ kBytesSavedByCombiningSurrogates

const unsigned unibrow::Utf8::kBytesSavedByCombiningSurrogates = 2
static

Definition at line 186 of file unicode.h.

◆ kIncomplete

const uchar unibrow::Utf8::kIncomplete = 0xFFFFFFFC
static

Definition at line 177 of file unicode.h.

◆ kMax16BitCodeUnitSize

const unsigned unibrow::Utf8::kMax16BitCodeUnitSize = 3
static

Definition at line 190 of file unicode.h.

◆ kMax8BitCodeUnitSize

const unsigned unibrow::Utf8::kMax8BitCodeUnitSize = 2
static

Definition at line 193 of file unicode.h.

◆ kMaxEncodedSize

const unsigned unibrow::Utf8::kMaxEncodedSize = 4
static

Definition at line 178 of file unicode.h.

◆ kMaxFourByteChar

const unsigned unibrow::Utf8::kMaxFourByteChar = 0x1fffff
static

Definition at line 182 of file unicode.h.

◆ kMaxOneByteChar

const unsigned unibrow::Utf8::kMaxOneByteChar = 0x7f
static

Definition at line 179 of file unicode.h.

◆ kMaxThreeByteChar

const unsigned unibrow::Utf8::kMaxThreeByteChar = 0xffff
static

Definition at line 181 of file unicode.h.

◆ kMaxTwoByteChar

const unsigned unibrow::Utf8::kMaxTwoByteChar = 0x7ff
static

Definition at line 180 of file unicode.h.

◆ kSizeOfUnmatchedSurrogate

const unsigned unibrow::Utf8::kSizeOfUnmatchedSurrogate = 3
static

Definition at line 187 of file unicode.h.


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