tcpflow  1.6.1
About: tcpflow is a TCP/IP packet demultiplexer that captures data transmitted as part of TCP connections (flows), and stores the data in a way that is convenient for protocol analysis and debugging.
  Fossies Dox: tcpflow-1.6.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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 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 More...
 
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)
 

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
UTF8_OK 
NOT_ENOUGH_ROOM 
INVALID_LEAD 
INCOMPLETE_SEQUENCE 
OVERLONG_SEQUENCE 
INVALID_CODE_POINT 

Definition at line 134 of file core.h.

Function Documentation

◆ 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

Definition at line 139 of file core.h.

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,
uint32_t code_point 
)

Definition at line 150 of file core.h.

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

Referenced by validate_next().

◆ get_sequence_3()

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

Definition at line 175 of file core.h.

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

Referenced by validate_next().

◆ get_sequence_4()

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

Definition at line 209 of file core.h.

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

Referenced by validate_next().

◆ is_code_point_valid()

template<typename u32 >
bool utf8::internal::is_code_point_valid ( u32  cp)
inline

Definition at line 93 of file core.h.

References CODE_POINT_MAX, and is_surrogate().

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

◆ is_lead_surrogate()

template<typename u16 >
bool utf8::internal::is_lead_surrogate ( u16  cp)
inline

Definition at line 75 of file core.h.

References LEAD_SURROGATE_MAX, and LEAD_SURROGATE_MIN.

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

◆ is_overlong_sequence()

template<typename octet_difference_type >
bool utf8::internal::is_overlong_sequence ( uint32_t  cp,
octet_difference_type  length 
)
inline

Definition at line 116 of file core.h.

Referenced by validate_next().

◆ is_surrogate()

template<typename u16 >
bool utf8::internal::is_surrogate ( u16  cp)
inline

Definition at line 87 of file core.h.

References LEAD_SURROGATE_MIN, and TRAIL_SURROGATE_MAX.

Referenced by is_code_point_valid().

◆ 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

Definition at line 81 of file core.h.

References TRAIL_SURROGATE_MAX, and TRAIL_SURROGATE_MIN.

Referenced by utf8::utf16to8().

◆ mask16()

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

Definition at line 64 of file core.h.

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

◆ 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

Definition at line 305 of file core.h.

References validate_next().

◆ 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

Definition at line 56 of file core.h.

Referenced by is_code_point_valid().

◆ LEAD_OFFSET

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

Definition at line 52 of file core.h.

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

◆ LEAD_SURROGATE_MAX

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

Definition at line 49 of file core.h.

Referenced by is_lead_surrogate().

◆ LEAD_SURROGATE_MIN

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

Definition at line 48 of file core.h.

Referenced by is_lead_surrogate(), and is_surrogate().

◆ SURROGATE_OFFSET

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

Definition at line 53 of file core.h.

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

◆ TRAIL_SURROGATE_MAX

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

Definition at line 51 of file core.h.

Referenced by is_surrogate(), and is_trail_surrogate().

◆ TRAIL_SURROGATE_MIN

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

Definition at line 50 of file core.h.

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