class UChar

A single Unicode character. More...

Full nameTelEngine::UChar
Definition#include <yateclass.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

A simple class to hold a single Unicode character and convert it to / from UTF-8

inline explicit  UChar (uint32_t code = 0)

UChar

Constructor from unsigned numeric code

Parameters:
codeCode of the Unicode character

inline explicit  UChar (int32_t code)

UChar

Constructor from signed numeric code

Parameters:
codeCode of the Unicode character

inline explicit  UChar (signed char code)

UChar

Constructor from signed character

Parameters:
codeCharacter to construct from

inline explicit  UChar (unsigned char code)

UChar

Constructor from unsigned character

Parameters:
codeCharacter to construct from

inline UChar&  operator= (uint32_t code)

operator=

Assignment operator from a character code

Parameters:
codeCharacter code to assign

Returns: Reference to this object

inline UChar&  operator= (char code)

operator=

Assignment operator from a character

Parameters:
codeCharacter to assign

Returns: Reference to this object

inline uint32_t  code ()

code

[const]

Get the Unicode value of the character

Returns: Code of the character as defined by Unicode

inline const char*  c_str ()

c_str

[const]

Get the value of the character as UTF-8 string.

Returns: The character as UTF-8 C string

inline  operator const char* ()

operator const char*

[const]

Conversion to "const char *" operator.

Returns: Pointer to the internally stored UTF-8 string

bool  decode (const char*& str, uint32_t maxChar = 0x10ffff, bool overlong = false)

decode

Decode the first Unicode character from an UTF-8 C string

Parameters:
strString to extract from, will be advanced past the character
maxCharMaximum accepted Unicode character code
overlongAccept overlong UTF-8 sequences (dangerous!)

Returns: True if an Unicode character was decoded from string


Generated by: paulc on bussard on Thu Jul 24 18:41:02 2014, using kdoc 2.0a54.