123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef BOOST_MYSQL_IMPL_INTERNAL_CALL_NEXT_CHAR_HPP
- #define BOOST_MYSQL_IMPL_INTERNAL_CALL_NEXT_CHAR_HPP
- #include <boost/mysql/character_set.hpp>
- #include <boost/assert.hpp>
- #include <cstddef>
- namespace boost {
- namespace mysql {
- namespace detail {
- inline std::size_t call_next_char(const character_set& charset, const char* first, const char* last) noexcept
- {
-
- BOOST_ASSERT(last > first);
-
- auto* data = reinterpret_cast<const unsigned char*>(first);
- if (*data < 0x80)
- return 1u;
-
- return charset.next_char({data, static_cast<std::size_t>(last - first)});
- }
- }
- }
- }
- #endif
|