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

Enumerations

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

Functions

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

Variables

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

Enumeration Type Documentation

◆ utf_error

enum class utf8::internal::utf_error
strong
Enumerator
OK 
NOT_ENOUGH_ROOM 
INVALID_LEAD 
INCOMPLETE_SEQUENCE 
OVERLONG_SEQUENCE 
INVALID_CODE_POINT 

Definition at line 90 of file utf8_core.hh.

Function Documentation

◆ is_code_point_valid()

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

Definition at line 69 of file utf8_core.hh.

References CODE_POINT_MAX, and is_surrogate().

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

◆ is_surrogate()

constexpr bool utf8::internal::is_surrogate ( uint32_t  cp)
constexpr

◆ is_trail()

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

◆ sequence_length()

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

◆ validate_next() [1/2]

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

Definition at line 203 of file utf8_core.hh.

References end(), and validate_next().

◆ validate_next() [2/2]

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

Variable Documentation

◆ CODE_POINT_MAX

constexpr uint32_t utf8::internal::CODE_POINT_MAX = 0x0010ffffu
inlineconstexpr

Definition at line 57 of file utf8_core.hh.

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

◆ LEAD_OFFSET

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

Definition at line 53 of file utf8_core.hh.

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

◆ LEAD_SURROGATE_MAX

constexpr uint16_t utf8::internal::LEAD_SURROGATE_MAX = 0xdbffu
inlineconstexpr

Definition at line 50 of file utf8_core.hh.

◆ LEAD_SURROGATE_MIN

constexpr uint16_t utf8::internal::LEAD_SURROGATE_MIN = 0xd800u
inlineconstexpr

Definition at line 49 of file utf8_core.hh.

Referenced by is_surrogate().

◆ SURROGATE_OFFSET

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

Definition at line 54 of file utf8_core.hh.

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

◆ TRAIL_SURROGATE_MAX

constexpr uint16_t utf8::internal::TRAIL_SURROGATE_MAX = 0xdfffu
inlineconstexpr

Definition at line 52 of file utf8_core.hh.

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

◆ TRAIL_SURROGATE_MIN

constexpr uint16_t utf8::internal::TRAIL_SURROGATE_MIN = 0xdc00u
inlineconstexpr

Definition at line 51 of file utf8_core.hh.

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