Xrb::UTF8 Namespace Reference

Contains functions for manipulating UTF8-encoded strings. More...


Functions

char const * NextCharacter (char const *current)
 Returns the next character in the UTF8-encdoded string.
bool AreCharactersEqual (char const *c0, char const *c1)
 Returns true if the given UTF8-encoded characters are equal.
Uint32 Unicode (char const *sequence)
 Returns the 32-bit unicode for the given UTF8-encoded character.
void AppendSequence (std::string *dest, Uint32 unicode)
 UTF8-encodes the given unicode character to dest (by appending).


Detailed Description

Contains functions for manipulating UTF8-encoded strings.


Function Documentation

char const * Xrb::UTF8::NextCharacter ( char const *  current  ) 

Returns the next character in the UTF8-encdoded string.

Because a UTF8-encdoded character can be made up of a sequence of bytes, this function provides a convenient way to "increment the string pointer" (to get the next character in the string). If current points to the end of the string (the NULL char), then the value current is returned.

Parameters:
current A pointer to the character to be skipped over. May not be NULL.
Note:
Returns current if the first byte of the sequence is not well-formed (does not do full well-formedness checking).

Definition at line 36 of file xrb_utf8.cpp.

bool Xrb::UTF8::AreCharactersEqual ( char const *  c0,
char const *  c1 
)

Returns true if the given UTF8-encoded characters are equal.

If either c0 or c1 are NULL or ill-formed, return false.

Definition at line 56 of file xrb_utf8.cpp.

References Unicode().

Uint32 Xrb::UTF8::Unicode ( char const *  sequence  ) 

Returns the 32-bit unicode for the given UTF8-encoded character.

Parameters:
sequence A pointer to the character to be decoded. May not be NULL.
Note:
Returns 0xFFFFFFFF if the character is not well-formed.

Definition at line 61 of file xrb_utf8.cpp.

Referenced by AreCharactersEqual().

void Xrb::UTF8::AppendSequence ( std::string *  dest,
Uint32  unicode 
)

UTF8-encodes the given unicode character to dest (by appending).

If unicode is not a valid Unicode scalar, nothing will be appended to *dest .

Definition at line 161 of file xrb_utf8.cpp.


Hosted by SourceForge.net Logo -- Generated on Fri Aug 21 21:46:39 2009 for XuqRijBuh by doxygen 1.5.8