character_set.hpp 808 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MYSQL_DETAIL_CHARACTER_SET_HPP
  8. #define BOOST_MYSQL_DETAIL_CHARACTER_SET_HPP
  9. #include <boost/mysql/string_view.hpp>
  10. #include <boost/mysql/detail/config.hpp>
  11. #include <boost/core/span.hpp>
  12. #include <cstddef>
  13. namespace boost {
  14. namespace mysql {
  15. namespace detail {
  16. inline std::size_t next_char_ascii(span<const unsigned char> input) noexcept
  17. {
  18. return input[0] <= 0x7f ? 1 : 0;
  19. }
  20. BOOST_MYSQL_DECL std::size_t next_char_utf8mb4(span<const unsigned char> input) noexcept;
  21. } // namespace detail
  22. } // namespace mysql
  23. } // namespace boost
  24. #endif