13 #include <restinio/string_view.hpp> 40 check_overlong( byte );
45 if( (byte & 0xC0) == 0x80 )
47 m_current_symbol <<= 6;
50 m_current_symbol |= byte;
66 if( (byte & 0x80) == 0x00)
71 else if( (byte & 0xE0) == 0xC0)
77 else if( (byte & 0xF0) == 0xE0)
83 else if( (byte & 0xF8) == 0xF0)
89 else if( (byte & 0xFC) == 0xF8)
95 else if( (byte & 0xFE) == 0xFC)
106 m_current_symbol = byte;
121 m_current_symbol = 0;
130 if( (m_current_symbol >= 0xD800 && m_current_symbol <= 0xDFFF) ||
131 (m_current_symbol >= 0x110000) )
143 if( m_current_symbol_rest_bytes == 2 &&
144 (byte & 0xE0) == 0x80 )
146 else if( m_current_symbol_rest_bytes == 3 &&
147 (byte & 0xF0) == 0x80 )
149 else if( m_current_symbol_rest_bytes == 4 &&
150 (byte & 0xF8) == 0x80 )
152 else if( m_current_symbol_rest_bytes == 5 &&
153 (byte & 0xFC) == 0x80 )
160 if( byte == 0xC0 || byte == 0xC1 )
164 else if( byte == 0xE0 )
168 else if( byte == 0xF0 )
207 for(
const auto & ch : sv )
209 if( ! checker.process_byte(
static_cast<std::uint8_t>(ch) ))
bool process_byte(std::uint8_t byte)
void check_overlong(std::uint8_t byte)
size_t m_current_symbol_rest_bytes
void validate_current_symbol()
bool check_utf8_is_correct(string_view_t sv)
uint32_t m_current_symbol
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists ...