librime: utf8 Namespace Reference

| librime 1.2 Rime Input Method Engine, the core library

Namespaces | Classes | Typedefs | Functions | Variables
utf8 Namespace Reference

## Namespaces
namespace | internal
namespace | unchecked

## Classes
class | exception
class | invalid_code_point
class | invalid_utf8
class | invalid_utf16
class | not_enough_room
class | iterator

## Typedefs
typedef unsigned char | uint8_t
typedef unsigned short | uint16_t
typedef unsigned int | uint32_t

## Functions
template<typename octet_iterator>
octet_iterator | append (uint32_t cp, octet_iterator result)
| The library API - functions intended to be called by the users.
template<typename octet_iterator, typename output_iterator>
output_iterator | replace_invalid (octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement)
template<typename octet_iterator, typename output_iterator>
output_iterator | replace_invalid (octet_iterator start, octet_iterator end, output_iterator out)
template<typename octet_iterator>
uint32_t | next (octet_iterator &it, octet_iterator end)
template<typename octet_iterator>
uint32_t | peek_next (octet_iterator it, octet_iterator end)
template<typename octet_iterator>
uint32_t | prior (octet_iterator &it, octet_iterator start)
template<typename octet_iterator, typename distance_type>
void | advance (octet_iterator &it, distance_type n, octet_iterator end)
template<typename octet_iterator>
std::iterator_traits< octet_iterator >::difference_type | distance (octet_iterator first, octet_iterator last)
template<typename u16bit_iterator, typename octet_iterator>
octet_iterator | utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
template<typename u16bit_iterator, typename octet_iterator>
u16bit_iterator | utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)
template<typename octet_iterator, typename u32bit_iterator>
octet_iterator | utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result)
template<typename octet_iterator, typename u32bit_iterator>
u32bit_iterator | utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result)
template<typename octet_iterator>
octet_iterator | find_invalid (octet_iterator start, octet_iterator end)
template<typename octet_iterator>
bool | is_valid (octet_iterator start, octet_iterator end)
template<typename octet_iterator>
bool | starts_with_bom (octet_iterator it, octet_iterator end)
void | append (char32_t cp, std::string &s)
std::string | utf16to8 (std::u16string_view s)
std::u16string | utf8to16 (std::string_view s)
std::string | utf32to8 (std::u32string_view s)
std::u32string | utf8to32 (std::string_view s)
std::size_t | find_invalid (std::string_view s)
bool | is_valid (std::string_view s)
std::string | replace_invalid (std::string_view s, char32_t replacement)
std::string | replace_invalid (std::string_view s)
bool | starts_with_bom (std::string_view s)

## Variables
const uint8_t | bom [] = {0xef, 0xbb, 0xbf}
| The library API - functions intended to be called by the users.

## Typedef Documentation

## ◆ uint16_t

typedef unsigned short utf8::uint16_t

## ◆ uint32_t

typedef unsigned int utf8::uint32_t

## ◆ uint8_t

typedef unsigned char utf8::uint8_t

## Function Documentation

## ◆ advance()

template<typename octet_iterator, typename distance_type>

void utf8::advance | ( | octet_iterator & | it,
|  | distance_type | n,
|  | octet_iterator | end )

## ◆ append() [1/2]

void utf8::append | ( | char32_t | cp,
|  | std::string & | s )
| inline

## ◆ append() [2/2]

template<typename octet_iterator>

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

The library API - functions intended to be called by the users.

## ◆ distance()

template<typename octet_iterator>

std::iterator_traits< octet_iterator >::difference_type utf8::distance | ( | octet_iterator | first,
|  | octet_iterator | last )

## ◆ find_invalid() [1/2]

template<typename octet_iterator>

octet_iterator utf8::find_invalid | ( | octet_iterator | start,
|  | octet_iterator | end )

## ◆ find_invalid() [2/2]

std::size_t utf8::find_invalid | ( | std::string_view | s | ) |
| inline

## ◆ is_valid() [1/2]

template<typename octet_iterator>

bool utf8::is_valid | ( | octet_iterator | start,
|  | octet_iterator | end )
| inline

## ◆ is_valid() [2/2]

bool utf8::is_valid | ( | std::string_view | s | ) |
| inline

## ◆ next()

template<typename octet_iterator>

uint32_t utf8::next | ( | octet_iterator & | it,
|  | octet_iterator | end )

## ◆ peek_next()

template<typename octet_iterator>

uint32_t utf8::peek_next | ( | octet_iterator | it,
|  | octet_iterator | end )

## ◆ prior()

template<typename octet_iterator>

uint32_t utf8::prior | ( | octet_iterator & | it,
|  | octet_iterator | start )

## ◆ replace_invalid() [1/4]

template<typename octet_iterator, typename output_iterator>

output_iterator utf8::replace_invalid | ( | octet_iterator | start,
|  | octet_iterator | end,
|  | output_iterator | out )
| inline

## ◆ replace_invalid() [2/4]

template<typename octet_iterator, typename output_iterator>

output_iterator utf8::replace_invalid | ( | octet_iterator | start,
|  | octet_iterator | end,
|  | output_iterator | out,
|  | uint32_t | replacement )

## ◆ replace_invalid() [3/4]

std::string utf8::replace_invalid | ( | std::string_view | s | ) |
| inline

## ◆ replace_invalid() [4/4]

std::string utf8::replace_invalid | ( | std::string_view | s,
|  | char32_t | replacement )
| inline

## ◆ starts_with_bom() [1/2]

template<typename octet_iterator>

bool utf8::starts_with_bom | ( | octet_iterator | it,
|  | octet_iterator | end )
| inline

## ◆ starts_with_bom() [2/2]

bool utf8::starts_with_bom | ( | std::string_view | s | ) |
| inline

## ◆ utf16to8() [1/2]

std::string utf8::utf16to8 | ( | std::u16string_view | s | ) |
| inline

## ◆ utf16to8() [2/2]

template<typename u16bit_iterator, typename octet_iterator>

octet_iterator utf8::utf16to8 | ( | u16bit_iterator | start,
|  | u16bit_iterator | end,
|  | octet_iterator | result )

## ◆ utf32to8() [1/2]

std::string utf8::utf32to8 | ( | std::u32string_view | s | ) |
| inline

## ◆ utf32to8() [2/2]

template<typename octet_iterator, typename u32bit_iterator>

octet_iterator utf8::utf32to8 | ( | u32bit_iterator | start,
|  | u32bit_iterator | end,
|  | octet_iterator | result )

## ◆ utf8to16() [1/2]

template<typename u16bit_iterator, typename octet_iterator>

u16bit_iterator utf8::utf8to16 | ( | octet_iterator | start,
|  | octet_iterator | end,
|  | u16bit_iterator | result )

## ◆ utf8to16() [2/2]

std::u16string utf8::utf8to16 | ( | std::string_view | s | ) |
| inline

## ◆ utf8to32() [1/2]

template<typename octet_iterator, typename u32bit_iterator>

u32bit_iterator utf8::utf8to32 | ( | octet_iterator | start,
|  | octet_iterator | end,
|  | u32bit_iterator | result )

## ◆ utf8to32() [2/2]

std::u32string utf8::utf8to32 | ( | std::string_view | s | ) |
| inline

## Variable Documentation

## ◆ bom

const uint8_t utf8::bom[] = {0xef, 0xbb, 0xbf}

The library API - functions intended to be called by the users.