ucommon::utf8_pointer Class Reference

Pointer to utf8 encoded character data. More...

#include <unicode.h>


Public Member Functions

char * c_str (void)
 Get c string we point to.
void dec (void)
 Iterative decrement of a utf8 pointer to prior codepoint.
void inc (void)
 Iterative increment of a utf8 pointer to next codepoint.
size_t len (void)
 Get length of null terminated utf8 string in codepoints.
ucs4_t operator * ()
 Get unicode character pointed to by pointer.
 operator bool ()
 Check if text is valid pointer.
 operator char * ()
 Convert utf8 pointer to a generic string pointer.
bool operator! ()
 Check if text is an invalid pointer.
bool operator!= (char *string)
 check if pointer does not equal another string.
utf8_pointer operator+ (long offset)
 Get new utf8 string after adding a codepoint offset.
utf8_pointeroperator++ ()
 Iterative increment of a utf8 pointer to prior codepoint.
utf8_pointeroperator+= (long offset)
 Adjust utf8 pointer by specified codepoints forward.
utf8_pointer operator- (long offset)
 Get new utf8 string after subtracting a codepoint offset.
utf8_pointeroperator-- ()
 Iterative decrement of a utf8 pointer to next codepoint.
utf8_pointeroperator-= (long offset)
 Adjust utf8 pointer by specified codepoints backward.
utf8_pointeroperator= (char *string)
 Assign a utf8 string to point to.
bool operator== (char *string)
 check if pointer equals another string.
ucs4_t operator[] (long codepoint)
 Extract a unicode character from a specified codepoint.
 utf8_pointer (utf8_pointer &copy)
 Create a utf8 pointer as a copy of existing utf8 pointer.
 utf8_pointer (char *string)
 Create a utf8 pointer for an existing char pointer.
 utf8_pointer ()
 Create a utf8 pointer set to NULL.

Protected Attributes

uint8_t * text


Detailed Description

Pointer to utf8 encoded character data.

This is a kind of "char *" for utf8 text.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 387 of file unicode.h.


Constructor & Destructor Documentation

ucommon::utf8_pointer::utf8_pointer ( char *  string  ) 

Create a utf8 pointer for an existing char pointer.

Parameters:
string pointer to use.

ucommon::utf8_pointer::utf8_pointer ( utf8_pointer copy  ) 

Create a utf8 pointer as a copy of existing utf8 pointer.

Parameters:
copy of object to use.


Member Function Documentation

char* ucommon::utf8_pointer::c_str ( void   )  [inline]

Get c string we point to.

Returns:
string we point to.

Definition at line 515 of file unicode.h.

size_t ucommon::utf8_pointer::len ( void   )  [inline]

Get length of null terminated utf8 string in codepoints.

Returns:
codepoint length of string.

Definition at line 529 of file unicode.h.

ucs4_t ucommon::utf8_pointer::operator * (  )  [inline]

Get unicode character pointed to by pointer.

Returns:
unicode character we are pointing to.

Definition at line 508 of file unicode.h.

ucommon::utf8_pointer::operator bool (  )  [inline]

Check if text is valid pointer.

Returns:
true if not NULL.

Definition at line 454 of file unicode.h.

ucommon::utf8_pointer::operator char * (  )  [inline]

Convert utf8 pointer to a generic string pointer.

Returns:
generic string pointer.

Definition at line 522 of file unicode.h.

bool ucommon::utf8_pointer::operator! (  )  [inline]

Check if text is an invalid pointer.

Returns:
false if not NULL.

Definition at line 461 of file unicode.h.

bool ucommon::utf8_pointer::operator!= ( char *  string  )  [inline]

check if pointer does not equal another string.

Parameters:
string to check.
Returns:
false if same memory address.

Definition at line 501 of file unicode.h.

utf8_pointer ucommon::utf8_pointer::operator+ ( long  offset  ) 

Get new utf8 string after adding a codepoint offset.

Parameters:
offset to add.
Returns:
new utf8 pointer pointing to specified offset.

utf8_pointer& ucommon::utf8_pointer::operator++ (  ) 

Iterative increment of a utf8 pointer to prior codepoint.

Returns:
object incremented.

utf8_pointer& ucommon::utf8_pointer::operator+= ( long  offset  ) 

Adjust utf8 pointer by specified codepoints forward.

Parameters:
offset to increment by.
Returns:
object incremented.

utf8_pointer ucommon::utf8_pointer::operator- ( long  offset  ) 

Get new utf8 string after subtracting a codepoint offset.

Parameters:
offset to subtract.
Returns:
new utf8 pointer pointing to specified offset.

utf8_pointer& ucommon::utf8_pointer::operator-- (  ) 

Iterative decrement of a utf8 pointer to next codepoint.

Returns:
object decremented.

utf8_pointer& ucommon::utf8_pointer::operator-= ( long  offset  ) 

Adjust utf8 pointer by specified codepoints backward.

Parameters:
offset to decrement by.
Returns:
object decremented.

utf8_pointer& ucommon::utf8_pointer::operator= ( char *  string  ) 

Assign a utf8 string to point to.

Parameters:
string to point to.
Returns:
current object after set to string.

bool ucommon::utf8_pointer::operator== ( char *  string  )  [inline]

check if pointer equals another string.

Parameters:
string to check.
Returns:
true if same memory address.

Definition at line 493 of file unicode.h.

ucs4_t ucommon::utf8_pointer::operator[] ( long  codepoint  ) 

Extract a unicode character from a specified codepoint.

Parameters:
codepoint offset to extract character from.
Returns:
unicode character or 0.


The documentation for this class was generated from the following file:
Generated on 14 Aug 2013 for UCommon by  doxygen 1.4.7