BloombergLP::bdlde::Utf8Util::advanceRaw

advanceRaw overloads

Synopses

Declared in <bdlde_utf8util.h>

Advance past 0 or more consecutive Unicode code points at the beginning of the specified string, until either the specified numCodePoints bytes or the whole string have been traversed (whichever occurs first), and return the number of Unicode code points traversed. Set the specified *result to the address of the byte immediately following the last code point traversed, or to string if length or numCodePoints is 0. string need not be null-terminated and can contain embedded null bytes. The behavior is undefined unless string contains only valid UTF-8 characters and 0 <= numCodePoints. Note that the value returned will be in the range [0 .. numCodePoints]. Also note that string may contain less than length Unicode code points.

static
Utf8Util::IntPtr
advanceRaw(
    char const** result,
    std::string_view const& string,
    IntPtr numCodePoints);
» more...

Advance past 0 or more consecutive Unicode code points at the beginning of the specified string, until either the specified numCodePoints bytes have been traversed or the terminating null byte is encountered (whichever occurs first), and return the number of Unicode code points traversed. Set the specified *result to the address of the byte immediately following the last code point traversed, or to string if string is empty or numCodePoints is 0. string is necessarily null-terminated, so it cannot contain embedded null bytes. The behavior is undefined unless string contains valid UTF-8 and 0 <= numCodePoints. Note that the value returned will be in the range [0 .. numCodePoints]. Also note that string may contain less than bsl::strlen(string) Unicode code points.

static
IntPtr
advanceRaw(
    char const** result,
    char const* string,
    IntPtr numCodePoints);
» more...

Advance past 0 or more consecutive Unicode code points at the beginning of the specified string having the specified length (in bytes), until either the specified numCodePoints or length bytes have been traversed (whichever occurs first), and return the number of Unicode code points traversed. Set the specified *result to the address of the byte immediately following the last code point traversed, or to string if length or numCodePoints is 0. string need not be null-terminated and can contain embedded null bytes, and string may be null if 0 == length (see {Empty Input Strings}). The behavior is undefined unless the initial length bytes of string contain valid UTF-8 and 0 <= numCodePoints. Note that the value returned will be in the range [0 .. numCodePoints]. Also note that string may contain less than length Unicode code points.

static
IntPtr
advanceRaw(
    char const** result,
    char const* string,
    size_type length,
    IntPtr numCodePoints);
» more...