BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslfmt::UnicodeCodePoint Class Reference

#include <bslfmt_unicodecodepoint.h>

Detailed Description

This simply constrained (value-semantic) attribute class characterizes a Unicode code point represented by a set of integral values. This class is private to this package and should not be used by clients.

See bslfmt_unicodecodepoint

Public Types

enum  UtfEncoding { e_UTF8 , e_UTF16 , e_UTF32 }
 

Public Member Functions

 UnicodeCodePoint ()
 
void extract (UtfEncoding encoding, const void *bytes, size_t maxBytes)
 
void reset ()
 
bool isValid () const
 
int numSourceBytes () const
 
unsigned long int codePointValue () const
 
int codePointWidth () const
 

Member Enumeration Documentation

◆ UtfEncoding

Enumerator
e_UTF8 
e_UTF16 
e_UTF32 

Constructor & Destructor Documentation

◆ UnicodeCodePoint()

bslfmt::UnicodeCodePoint::UnicodeCodePoint ( )
inline

Create an uninitialized Unicode code point object.

Member Function Documentation

◆ codePointValue()

unsigned long int bslfmt::UnicodeCodePoint::codePointValue ( ) const
inline

Return the value of this code point.

◆ codePointWidth()

int bslfmt::UnicodeCodePoint::codePointWidth ( ) const
inline

Return the width of this code point.

◆ extract()

void bslfmt::UnicodeCodePoint::extract ( UtfEncoding  encoding,
const void *  bytes,
size_t  maxBytes 
)
inline

Extract a code point from no more than the specified maxBytes of the byte stream at the specified bytes location in the specified encoding. Behavior is undefined if the input bytes are not in the specified encoding. Unicode Byte Order Markers are not supported and behavior is undefined if the input data contains an embedded BOM. Endianness is assumed to be that of the type pointed to by bytes.

For UTF-8, behavior is undefined if bytes is not a valid pointer to an array of numBytes unsigned char types in contiguous memory.

For UTF-16, behavior is undefined if bytes is not a valid pointer to an array of numBytes/2 wchar_t types in contiguous memory. Behavior is undefined if 2 != sizeof(wchar_t). Endianness is assumed to be the same as for the wchar_t type and Byte Order Markers are not supported.

For UTF-32, behavior is undefined if bytes is not a valid pointer to an array of numBytes/4 wchar_t types in contiguous memory. Behavior is undefined if 4 != sizeof(wchar_t). Endianness is assumed to be the same as for the wchar_t type and Byte Order Markers are not supported.

◆ isValid()

bool bslfmt::UnicodeCodePoint::isValid ( ) const
inline

Return true if this object was successfully extracted and contains valid code point data, and false otherwise.

◆ numSourceBytes()

int bslfmt::UnicodeCodePoint::numSourceBytes ( ) const
inline

Return the number of bytes occupied by this code point.

◆ reset()

void bslfmt::UnicodeCodePoint::reset ( )
inline

Reset this object to the default state.


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