librime: utf8::internal Namespace Reference

| librime 1.2 Rime Input Method Engine, the core library

Enumerations | Functions | Variables
utf8::internal Namespace Reference

## Enumerations
enum | utf_error { UTF8_OK , NOT_ENOUGH_ROOM , INVALID_LEAD , INCOMPLETE_SEQUENCE , OVERLONG_SEQUENCE , INVALID_CODE_POINT }

## Functions
template<typename octet_type>
uint8_t | mask8 (octet_type oc)
template<typename u16_type>
uint16_t | mask16 (u16_type oc)
template<typename octet_type>
bool | is_trail (octet_type oc)
template<typename u16>
bool | is_lead_surrogate (u16 cp)
template<typename u16>
bool | is_trail_surrogate (u16 cp)
template<typename u16>
bool | is_surrogate (u16 cp)
template<typename u32>
bool | is_code_point_valid (u32 cp)
template<typename octet_iterator>
std::iterator_traits< octet_iterator >::difference_type | sequence_length (octet_iterator lead_it)
template<typename octet_difference_type>
bool | is_overlong_sequence (uint32_t cp, octet_difference_type length)
template<typename octet_iterator>
utf_error | increase_safely (octet_iterator &it, octet_iterator end)
| Helper for get_sequence_x.
template<typename octet_iterator>
utf_error | get_sequence_1 (octet_iterator &it, octet_iterator end, uint32_t &code_point)
| get_sequence_x functions decode utf-8 sequences of the length x
template<typename octet_iterator>
utf_error | get_sequence_2 (octet_iterator &it, octet_iterator end, uint32_t &code_point)
template<typename octet_iterator>
utf_error | get_sequence_3 (octet_iterator &it, octet_iterator end, uint32_t &code_point)
template<typename octet_iterator>
utf_error | get_sequence_4 (octet_iterator &it, octet_iterator end, uint32_t &code_point)
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)
template<typename octet_iterator, typename octet_type>
octet_iterator | append (uint32_t cp, octet_iterator result)
char * | append (uint32_t cp, char *result)
template<typename container_type>
std::back_insert_iterator< container_type > | append (uint32_t cp, std::back_insert_iterator< container_type > result)
template<typename octet_iterator>
octet_iterator | append (uint32_t cp, octet_iterator result)

## 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 = 0xd7c0u
const uint32_t | SURROGATE_OFFSET = 0xfca02400u
const uint32_t | CODE_POINT_MAX = 0x0010ffffu

## Enumeration Type Documentation

## ◆ utf_error

enum utf8::internal::utf_error

Enumerator
UTF8_OK |
NOT_ENOUGH_ROOM |
INVALID_LEAD |
INCOMPLETE_SEQUENCE |
OVERLONG_SEQUENCE |
INVALID_CODE_POINT |

## Function Documentation

## ◆ append() [1/4]

char * utf8::internal::append | ( | uint32_t | cp,
|  | char * | result )
| inline

## ◆ append() [2/4]

template<typename octet_iterator>

octet_iterator utf8::internal::append | ( | uint32_t | cp,
|  | octet_iterator | result )

## ◆ append() [3/4]

template<typename octet_iterator, typename octet_type>

octet_iterator utf8::internal::append | ( | uint32_t | cp,
|  | octet_iterator | result )

## ◆ append() [4/4]

template<typename container_type>

std::back_insert_iterator< container_type > utf8::internal::append | ( | uint32_t | cp,
|  | std::back_insert_iterator< container_type > | result )

## ◆ get_sequence_1()

template<typename octet_iterator>

utf_error utf8::internal::get_sequence_1 | ( | octet_iterator & | it,
|  | octet_iterator | end,
|  | uint32_t & | code_point )

get_sequence_x functions decode utf-8 sequences of the length x

## ◆ get_sequence_2()

template<typename octet_iterator>

utf_error utf8::internal::get_sequence_2 | ( | octet_iterator & | it,
|  | octet_iterator | end,
|  | uint32_t & | code_point )

## ◆ get_sequence_3()

template<typename octet_iterator>

utf_error utf8::internal::get_sequence_3 | ( | octet_iterator & | it,
|  | octet_iterator | end,
|  | uint32_t & | code_point )

## ◆ get_sequence_4()

template<typename octet_iterator>

utf_error utf8::internal::get_sequence_4 | ( | octet_iterator & | it,
|  | octet_iterator | end,
|  | uint32_t & | code_point )

## ◆ increase_safely()

template<typename octet_iterator>

utf_error utf8::internal::increase_safely | ( | octet_iterator & | it,
|  | octet_iterator | end )

Helper for get_sequence_x.

## ◆ is_code_point_valid()

template<typename u32>

bool utf8::internal::is_code_point_valid | ( | u32 | cp | ) |
| inline

## ◆ is_lead_surrogate()

template<typename u16>

bool utf8::internal::is_lead_surrogate | ( | u16 | cp | ) |
| inline

## ◆ is_overlong_sequence()

template<typename octet_difference_type>

bool utf8::internal::is_overlong_sequence | ( | uint32_t | cp,
|  | octet_difference_type | length )
| inline

## ◆ is_surrogate()

template<typename u16>

bool utf8::internal::is_surrogate | ( | u16 | cp | ) |
| inline

## ◆ is_trail()

template<typename octet_type>

bool utf8::internal::is_trail | ( | octet_type | oc | ) |
| inline

## ◆ is_trail_surrogate()

template<typename u16>

bool utf8::internal::is_trail_surrogate | ( | u16 | cp | ) |
| inline

## ◆ mask16()

template<typename u16_type>

uint16_t utf8::internal::mask16 | ( | u16_type | oc | ) |
| inline

## ◆ mask8()

template<typename octet_type>

uint8_t utf8::internal::mask8 | ( | octet_type | oc | ) |
| inline

## ◆ sequence_length()

template<typename octet_iterator>

std::iterator_traits< octet_iterator >::difference_type utf8::internal::sequence_length | ( | octet_iterator | lead_it | ) |
| inline

## ◆ validate_next() [1/2]

template<typename octet_iterator>

utf_error utf8::internal::validate_next | ( | octet_iterator & | it,
|  | octet_iterator | end )
| inline

## ◆ validate_next() [2/2]

template<typename octet_iterator>

utf_error utf8::internal::validate_next | ( | octet_iterator & | it,
|  | octet_iterator | end,
|  | uint32_t & | code_point )

## Variable Documentation

## ◆ CODE_POINT_MAX

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

## ◆ LEAD_OFFSET

const uint16_t utf8::internal::LEAD_OFFSET = 0xd7c0u

## ◆ LEAD_SURROGATE_MAX

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

## ◆ LEAD_SURROGATE_MIN

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

## ◆ SURROGATE_OFFSET

const uint32_t utf8::internal::SURROGATE_OFFSET = 0xfca02400u

## ◆ TRAIL_SURROGATE_MAX

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

## ◆ TRAIL_SURROGATE_MIN

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