openMSX
Enumerations | Functions | Variables
utf8::internal Namespace Reference

Enumerations

enum  utf_error {
  OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE,
  OVERLONG_SEQUENCE, INVALID_CODE_POINT
}
 

Functions

bool is_trail (uint8_t oc)
 
bool is_surrogate (uint16_t cp)
 
bool is_code_point_valid (uint32_t cp)
 
unsigned sequence_length (uint8_t lead)
 
template<typename octet_iterator >
utf_error validate_next (octet_iterator &it, octet_iterator end, uint32_t *code_point)
 
template<typename octet_iterator >
utf_error validate_next (octet_iterator &it, octet_iterator end)
 

Variables

const uint16_t LEAD_SURROGATE_MIN = 0xd800u
 
const uint16_t LEAD_SURROGATE_MAX = 0xdbffu
 
const uint16_t TRAIL_SURROGATE_MIN = 0xdc00u
 
const uint16_t TRAIL_SURROGATE_MAX = 0xdfffu
 
const uint16_t LEAD_OFFSET = LEAD_SURROGATE_MIN - (0x10000 >> 10)
 
const uint32_t SURROGATE_OFFSET = 0x10000u - (LEAD_SURROGATE_MIN << 10) - TRAIL_SURROGATE_MIN
 
const uint32_t CODE_POINT_MAX = 0x0010ffffu
 

Enumeration Type Documentation

◆ utf_error

Enumerator
OK 
NOT_ENOUGH_ROOM 
INVALID_LEAD 
INCOMPLETE_SEQUENCE 
OVERLONG_SEQUENCE 
INVALID_CODE_POINT 

Definition at line 87 of file utf8_core.hh.

Function Documentation

◆ is_code_point_valid()

bool utf8::internal::is_code_point_valid ( uint32_t  cp)
inline

Definition at line 66 of file utf8_core.hh.

References is_surrogate().

Referenced by utf8::append(), and validate_next().

◆ is_surrogate()

bool utf8::internal::is_surrogate ( uint16_t  cp)
inline

Definition at line 61 of file utf8_core.hh.

References TRAIL_SURROGATE_MAX.

Referenced by is_code_point_valid(), utf8::unchecked::utf16to8(), and utf8::utf16to8().

◆ is_trail()

bool utf8::internal::is_trail ( uint8_t  oc)
inline

◆ sequence_length()

unsigned utf8::internal::sequence_length ( uint8_t  lead)
inline

◆ validate_next() [1/2]

template<typename octet_iterator >
utf_error utf8::internal::validate_next ( octet_iterator &  it,
octet_iterator  end,
uint32_t *  code_point 
)

◆ validate_next() [2/2]

template<typename octet_iterator >
utf_error utf8::internal::validate_next ( octet_iterator &  it,
octet_iterator  end 
)
inline

Definition at line 201 of file utf8_core.hh.

References validate_next().

Variable Documentation

◆ CODE_POINT_MAX

const uint32_t utf8::internal::CODE_POINT_MAX = 0x0010ffffu

Definition at line 54 of file utf8_core.hh.

Referenced by utf8::append().

◆ LEAD_OFFSET

const uint16_t utf8::internal::LEAD_OFFSET = LEAD_SURROGATE_MIN - (0x10000 >> 10)

Definition at line 50 of file utf8_core.hh.

Referenced by utf8::unchecked::utf8to16(), and utf8::utf8to16().

◆ LEAD_SURROGATE_MAX

const uint16_t utf8::internal::LEAD_SURROGATE_MAX = 0xdbffu

Definition at line 47 of file utf8_core.hh.

◆ LEAD_SURROGATE_MIN

const uint16_t utf8::internal::LEAD_SURROGATE_MIN = 0xd800u

Definition at line 46 of file utf8_core.hh.

◆ SURROGATE_OFFSET

const uint32_t utf8::internal::SURROGATE_OFFSET = 0x10000u - (LEAD_SURROGATE_MIN << 10) - TRAIL_SURROGATE_MIN

Definition at line 51 of file utf8_core.hh.

Referenced by utf8::unchecked::utf16to8(), and utf8::utf16to8().

◆ TRAIL_SURROGATE_MAX

const uint16_t utf8::internal::TRAIL_SURROGATE_MAX = 0xdfffu

Definition at line 49 of file utf8_core.hh.

Referenced by is_surrogate(), and utf8::utf16to8().

◆ TRAIL_SURROGATE_MIN

const uint16_t utf8::internal::TRAIL_SURROGATE_MIN = 0xdc00u

Definition at line 48 of file utf8_core.hh.

Referenced by utf8::utf16to8(), utf8::unchecked::utf8to16(), and utf8::utf8to16().