BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlde::Utf8Util_ImpUtil Struct Reference

#include <bdlde_utf8util.h>

Detailed Description

[PRIVATE] This struct provides a namespace for static methods used to implement Utf8Util.

Note
Note that the functions are not typically useful for clients, and are primarily exposed to allow for more thorough testing.

See bdlde_utf8util

Public Types

typedef bsls::Types::Uint64 Uint64
 
typedef bsls::Types::size_type size_type
 

Static Public Member Functions

static size_type advancePastValidOrInvalidCodePoint (const bsl::string_view &input)
 
static int getLineAndColumnNumber (Uint64 *lineNumber, Uint64 *utf8Column, Uint64 *startOfLineByteOffset, bsl::streambuf *input, Uint64 byteOffset, char lineDelimeter, char *temporaryReadBuffer, int temporaryReadBufferNumBytes)
 

Member Typedef Documentation

◆ size_type

◆ Uint64

Member Function Documentation

◆ advancePastValidOrInvalidCodePoint()

static size_type bdlde::Utf8Util_ImpUtil::advancePastValidOrInvalidCodePoint ( const bsl::string_view input)
static

Given a string referred to by the specified input, return the number of bytes in first code point in the string, whether the code point is valid or invalid.

Note
Note that if the string begins with an invalid header octet (0xf8 == (*input & 0xf8)) only that octet is skipped, any following continuation octets are seen as separate errors.
Precondition
The behavior is undefined if input.empty().

◆ getLineAndColumnNumber()

static int bdlde::Utf8Util_ImpUtil::getLineAndColumnNumber ( Uint64 lineNumber,
Uint64 utf8Column,
Uint64 startOfLineByteOffset,
bsl::streambuf *  input,
Uint64  byteOffset,
char  lineDelimeter,
char *  temporaryReadBuffer,
int  temporaryReadBufferNumBytes 
)
static

For the specified byteOffset in the specified input, load the byte offset's line number into the specified lineNumber, the column number into the specified utf8Column, and the byte offset for the start of the line into the specified startOfLineByteOffset, using the specified lineDelimeter as the line separator, and using the specified temporaryReadBuffer (of the specified length temporaryReadBufferNumBytes) as a temporary buffer for reading. Return 0 on success, or a non-zero value if location cannot be found in input or if input contains non-UTF-8 characters. The utf8Column is the number of UTF-8 code points between startOfLineByteOffset and byteOffset.

Precondition
The behavior is undefined unless temporaryReadBuffer refers to a valid buffer of at least temporaryReadBufferNumBytes bytes, and temporaryReadBufferNumBytes is greater than or equal to 4.

The documentation for this struct was generated from the following file: