LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
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>
utfchar8_t mask8 (octet_type oc)
template<typename u16_type>
utfchar16_t mask16 (u16_type oc)
template<typename octet_type>
bool is_trail (octet_type oc)
bool is_lead_surrogate (utfchar32_t cp)
bool is_trail_surrogate (utfchar32_t cp)
bool is_surrogate (utfchar32_t cp)
bool is_code_point_valid (utfchar32_t cp)
bool is_in_bmp (utfchar32_t cp)
template<typename octet_iterator>
int sequence_length (octet_iterator lead_it)
bool is_overlong_sequence (utfchar32_t cp, int length)
template<typename octet_iterator>
utf_error increase_safely (octet_iterator &it, const octet_iterator end)
 Helper for get_sequence_x.
template<typename octet_iterator>
utf_error get_sequence_1 (octet_iterator &it, octet_iterator end, utfchar32_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, utfchar32_t &code_point)
template<typename octet_iterator>
utf_error get_sequence_3 (octet_iterator &it, octet_iterator end, utfchar32_t &code_point)
template<typename octet_iterator>
utf_error get_sequence_4 (octet_iterator &it, octet_iterator end, utfchar32_t &code_point)
template<typename octet_iterator>
utf_error validate_next (octet_iterator &it, octet_iterator end, utfchar32_t &code_point)
template<typename octet_iterator>
utf_error validate_next (octet_iterator &it, octet_iterator end)
template<typename word_iterator>
utf_error validate_next16 (word_iterator &it, word_iterator end, utfchar32_t &code_point)
template<typename octet_iterator, typename octet_type>
octet_iterator append (utfchar32_t cp, octet_iterator result)
char * append (utfchar32_t cp, char *result)
template<typename container_type>
std::back_insert_iterator< container_type > append (utfchar32_t cp, std::back_insert_iterator< container_type > result)
template<typename octet_iterator>
octet_iterator append (utfchar32_t cp, octet_iterator result)
template<typename word_iterator, typename word_type>
word_iterator append16 (utfchar32_t cp, word_iterator result)
template<typename container_type>
std::back_insert_iterator< container_type > append16 (utfchar32_t cp, std::back_insert_iterator< container_type > result)
template<typename word_iterator>
word_iterator append16 (utfchar32_t cp, word_iterator result)

Variables

const utfchar16_t LEAD_SURROGATE_MIN = 0xd800u
const utfchar16_t LEAD_SURROGATE_MAX = 0xdbffu
const utfchar16_t TRAIL_SURROGATE_MIN = 0xdc00u
const utfchar16_t TRAIL_SURROGATE_MAX = 0xdfffu
const utfchar16_t LEAD_OFFSET = 0xd7c0u
const utfchar32_t SURROGATE_OFFSET = 0xfca02400u
const utfchar32_t CODE_POINT_MAX = 0x0010ffffu

Enumeration Type Documentation

◆ 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 ( utfchar32_t cp,
char * result )
inline

References append().

◆ append() [2/4]

template<typename octet_iterator>
octet_iterator utf8::internal::append ( utfchar32_t cp,
octet_iterator result )

References append().

◆ append() [3/4]

template<typename octet_iterator, typename octet_type>
octet_iterator utf8::internal::append ( utfchar32_t cp,
octet_iterator result )

◆ append() [4/4]

template<typename container_type>
std::back_insert_iterator< container_type > utf8::internal::append ( utfchar32_t cp,
std::back_insert_iterator< container_type > result )

References append().

◆ append16() [1/3]

template<typename container_type>
std::back_insert_iterator< container_type > utf8::internal::append16 ( utfchar32_t cp,
std::back_insert_iterator< container_type > result )

References append16().

◆ append16() [2/3]

template<typename word_iterator>
word_iterator utf8::internal::append16 ( utfchar32_t cp,
word_iterator result )

References append16().

◆ append16() [3/3]

template<typename word_iterator, typename word_type>
word_iterator utf8::internal::append16 ( utfchar32_t cp,
word_iterator result )

◆ get_sequence_1()

template<typename octet_iterator>
utf_error utf8::internal::get_sequence_1 ( octet_iterator & it,
octet_iterator end,
utfchar32_t & code_point )

get_sequence_x functions decode utf-8 sequences of the length x

References mask8(), NOT_ENOUGH_ROOM, and UTF8_OK.

Referenced by validate_next().

◆ get_sequence_2()

template<typename octet_iterator>
utf_error utf8::internal::get_sequence_2 ( octet_iterator & it,
octet_iterator end,
utfchar32_t & code_point )

◆ get_sequence_3()

template<typename octet_iterator>
utf_error utf8::internal::get_sequence_3 ( octet_iterator & it,
octet_iterator end,
utfchar32_t & code_point )

◆ get_sequence_4()

template<typename octet_iterator>
utf_error utf8::internal::get_sequence_4 ( octet_iterator & it,
octet_iterator end,
utfchar32_t & code_point )

◆ increase_safely()

template<typename octet_iterator>
utf_error utf8::internal::increase_safely ( octet_iterator & it,
const octet_iterator end )

Helper for get_sequence_x.

References INCOMPLETE_SEQUENCE, is_trail(), NOT_ENOUGH_ROOM, and UTF8_OK.

◆ is_code_point_valid()

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

◆ is_in_bmp()

bool utf8::internal::is_in_bmp ( utfchar32_t cp)
inline

Referenced by append16().

◆ is_lead_surrogate()

bool utf8::internal::is_lead_surrogate ( utfchar32_t cp)
inline

◆ is_overlong_sequence()

bool utf8::internal::is_overlong_sequence ( utfchar32_t cp,
int length )
inline

Referenced by validate_next().

◆ is_surrogate()

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

◆ is_trail()

template<typename octet_type>
bool utf8::internal::is_trail ( octet_type oc)
inline

◆ is_trail_surrogate()

bool utf8::internal::is_trail_surrogate ( utfchar32_t cp)
inline

◆ mask16()

template<typename u16_type>
utfchar16_t utf8::internal::mask16 ( u16_type oc)
inline

◆ mask8()

template<typename octet_type>
utfchar8_t utf8::internal::mask8 ( octet_type oc)
inline

◆ sequence_length()

template<typename octet_iterator>
int utf8::internal::sequence_length ( octet_iterator lead_it)

◆ validate_next() [1/2]

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

References validate_next().

◆ validate_next() [2/2]

◆ validate_next16()

template<typename word_iterator>
utf_error utf8::internal::validate_next16 ( word_iterator & it,
word_iterator end,
utfchar32_t & code_point )

Variable Documentation

◆ CODE_POINT_MAX

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

Referenced by is_code_point_valid().

◆ LEAD_OFFSET

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

◆ LEAD_SURROGATE_MAX

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

Referenced by is_lead_surrogate().

◆ LEAD_SURROGATE_MIN

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

Referenced by is_lead_surrogate(), and is_surrogate().

◆ SURROGATE_OFFSET

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

◆ TRAIL_SURROGATE_MAX

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

Referenced by is_surrogate(), and is_trail_surrogate().

◆ TRAIL_SURROGATE_MIN

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