RESTinio
Toggle main menu visibility
Loading...
Searching...
No Matches
restinio
websocket
impl
utf8.hpp
Go to the documentation of this file.
1
/*!
2
UTF-8 .
3
*/
4
5
#
pragma
once
6
7
#
include
<
iostream
>
// std::cout, debug
8
9
#
include
<
restinio
/
string_view
.
hpp
>
10
#
include
<
restinio
/
utils
/
utf8_checker
.
hpp
>
11
12
namespace
restinio
13
{
14
15
namespace
websocket
16
{
17
18
namespace
basic
19
{
20
21
namespace
impl
22
{
23
24
//
25
// check_utf8_is_correct
26
//
27
28
inline
bool
29
check_utf8_is_correct
( string_view_t sv )
noexcept
30
{
31
restinio
::
utils
::
utf8_checker_t
checker;
32
33
for
(
const
auto
& ch : sv )
34
{
35
if
( !checker.process_byte(
static_cast
<std::uint8_t>(ch) ) )
36
{
37
return
false
;
38
}
39
}
40
41
return
checker
.
finalized
(
)
;
42
}
43
44
}
/* namespace impl */
45
46
}
/* namespace basic */
47
48
}
/* namespace websocket */
49
50
}
/* namespace restinio */
restinio::utils::utf8_checker_t
Helper class for checking UTF-8 byte sequence during parsing URI or incoming byte stream.
Definition
utf8_checker.hpp:33
restinio::utils::utf8_checker_t::finalized
bool finalized() const noexcept
Definition
utf8_checker.hpp:316
restinio::utils
Definition
from_string_details.ipp:5
restinio::websocket::basic::impl
Definition
utf8.hpp:22
restinio::websocket::basic::impl::check_utf8_is_correct
bool check_utf8_is_correct(string_view_t sv) noexcept
Definition
utf8.hpp:29
restinio::websocket::basic
Definition
utf8.hpp:19
restinio::websocket
Definition
utf8.hpp:16
restinio
Definition
sendfile_operation_default.ipp:12
Generated by
1.17.0