diff options
Diffstat (limited to 'utf/inc/utf32.hh')
| -rw-r--r-- | utf/inc/utf32.hh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/utf/inc/utf32.hh b/utf/inc/utf32.hh index 2d3088e..4ee5eac 100644 --- a/utf/inc/utf32.hh +++ b/utf/inc/utf32.hh @@ -4,25 +4,27 @@ #include "macros.hh" #include <cstdint> -#include <string_view> +#include <span> namespace utf { -/* Read one unicode codepoint from UTF-32 BigEndian encoded data if possible. +/** + * Read one unicode codepoint from UTF-32 BigEndian encoded data if possible. * If successfull offset is incremented to point to next codepoint. * Will fail: * - not enough data is left in data given offset, returns NEED_MORE. * - data is not valid UTF-32, ie. outside valid ranges, returns INVALID. */ -uint32_t HIDDEN read32be(std::string_view data, std::size_t& offset); +uint32_t HIDDEN read32be(std::span<uint8_t const> data, std::size_t& offset); -/* Read one unicode codepoint from UTF-32 LittleEndian encoded data if possible. +/** + * Read one unicode codepoint from UTF-32 LittleEndian encoded data if possible. * If successfull offset is incremented to point to next codepoint. * Will fail: * - not enough data is left in data given offset, returns NEED_MORE. * - data is not valid UTF-32, ie. outside valid ranges, returns INVALID. */ -uint32_t HIDDEN read32le(std::string_view data, std::size_t& offset); +uint32_t HIDDEN read32le(std::span<uint8_t const> data, std::size_t& offset); } // namespace utf |
