async_mqtt
9.0.1
Loading...
Searching...
No Matches
utf8validate.hpp
1
// Copyright 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
2
// Takatoshi Kondo 2023
3
//
4
// Distributed under the Boost Software License, Version 1.0.
5
// (See accompanying file LICENSE_1_0.txt or copy at
6
// http://www.boost.org/LICENSE_1_0.txt)
7
8
#if !defined(ASYNC_MQTT_UTIL_UTF8VALIDATE_HPP)
9
#define ASYNC_MQTT_UTIL_UTF8VALIDATE_HPP
10
11
#include <string_view>
12
#include <cstdint>
13
14
#include <boost/assert.hpp>
15
16
#include <async_mqtt/util/detail/utf8_checker.hpp>
17
18
namespace
async_mqtt {
19
20
inline
bool
utf8string_check(std::string_view buf) {
21
if
(buf.empty())
return
true
;
22
detail::utf8_checker c;
23
if
(! c.write(
reinterpret_cast<
std::uint8_t const*
>
(buf.data()), buf.size()))
24
return
false
;
25
return
c.finish();
26
}
27
28
}
// namespace async_mqtt
29
30
#endif
// ASYNC_MQTT_UTIL_UTF8VALIDATE_HPP
include
async_mqtt
util
utf8validate.hpp
Generated by
1.12.0