From 7dd49c6293172b494c78918507242cdb55d35137 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sun, 21 Jan 2024 12:31:30 +0100 Subject: WIP --- utf/inc/utf16.hh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'utf/inc/utf16.hh') diff --git a/utf/inc/utf16.hh b/utf/inc/utf16.hh index 344b1a2..b9229bc 100644 --- a/utf/inc/utf16.hh +++ b/utf/inc/utf16.hh @@ -4,27 +4,29 @@ #include "macros.hh" #include -#include +#include namespace utf { -/* Read one unicode codepoint from UTF-16 BigEndian encoded data if possible. +/** + * Read one unicode codepoint from UTF-16 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-16, ie. invalid or incomplete surrogate pairs, * returns INVALID. */ -uint32_t HIDDEN read16be(std::string_view data, std::size_t& offset); +uint32_t HIDDEN read16be(std::span data, std::size_t& offset); -/* Read one unicode codepoint from UTF-16 LittleEndian encoded data if possible. +/** + * Read one unicode codepoint from UTF-16 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-16, ie. invalid or incomplete surrogate pairs, * returns INVALID. */ -uint32_t HIDDEN read16le(std::string_view data, std::size_t& offset); +uint32_t HIDDEN read16le(std::span data, std::size_t& offset); } // namespace utf -- cgit v1.2.3-70-g09d2