Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QUtf8Functions Namespace Reference

Functions

template<typename Traits , typename OutputPtr , typename InputPtr >
int toUtf8 (char16_t u, OutputPtr &dst, InputPtr &src, InputPtr end)
 
bool isContinuationByte (uchar b)
 
template<typename Traits , typename OutputPtr , typename InputPtr >
qsizetype fromUtf8 (uchar b, OutputPtr &dst, InputPtr &src, InputPtr end)
 

Function Documentation

◆ fromUtf8()

template<typename Traits , typename OutputPtr , typename InputPtr >
qsizetype QUtf8Functions::fromUtf8 ( uchar  b,
OutputPtr &  dst,
InputPtr &  src,
InputPtr  end 
)
inline

returns the number of characters consumed (including b) in case of success; returns negative in case of error: Traits::Error or Traits::EndOfString

Definition at line 188 of file qstringconverter_p.h.

References isContinuationByte(), QChar::isNonCharacter(), QChar::isSurrogate(), QChar::LastValidCodePoint, Q_UNLIKELY, and QChar::requiresSurrogates().

+ Here is the call graph for this function:

◆ isContinuationByte()

bool QUtf8Functions::isContinuationByte ( uchar  b)
inline

Definition at line 180 of file qstringconverter_p.h.

Referenced by fromUtf8().

+ Here is the caller graph for this function:

◆ toUtf8()

template<typename Traits , typename OutputPtr , typename InputPtr >
int QUtf8Functions::toUtf8 ( char16_t  u,
OutputPtr &  dst,
InputPtr &  src,
InputPtr  end 
)
inline

returns 0 on success; errors can only happen if u is a surrogate: Error if u is a low surrogate; if u is a high surrogate, Error if the next isn't a low one, EndOfString if we run into the end of the string.

Definition at line 125 of file qstringconverter_p.h.

References QChar::isHighSurrogate(), QChar::isLowSurrogate(), QChar::isNonCharacter(), QChar::isSurrogate(), and QChar::surrogateToUcs4().

+ Here is the call graph for this function: