Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::G::Unichar Class Reference

A C++ gunichar wrapper class. More...

#include <xfc/glib/unicode.hh>

Inheritance diagram for Xfc::G::Unichar:

Xfc::IntegerObject< gunichar > List of all members.

Constructors

Public Member Functions

Accessors
Methods

Detailed Description

A C++ gunichar wrapper class.

Unichar provides a convenient wrapper class for gunichar and its associated functions.


Constructor & Destructor Documentation

Xfc::G::Unichar::Unichar ( gunichar  c  ) 

Construct a new Unichar.

Parameters:
c A gunichar (a type which can hold any UCS-4 character code).

Xfc::G::Unichar::Unichar ( const Unichar src  ) 

Copy constructor.

Parameters:
src The source Unichar.


Member Function Documentation

Unichar& Xfc::G::Unichar::operator= ( const Unichar src  ) 

Assignment operator.

Parameters:
src The source Unichar.

bool Xfc::G::Unichar::is_space (  )  const

Returns true if the character is a space, tab, or line separator (newline, carriage return, etc.

). Note: don't use this to do word breaking; you have to use Pango or equivalent to get word breaking right, the algorithm is fairly complex.

bool Xfc::G::Unichar::is_title (  )  const

Returns true if the character is titlecase.

Some characters in Unicode which are composites, such as the DZ digraph have three case variants instead of just two. The titlecase form is used at the beginning of a word where only the first letter is capitalized. The titlecase form of the DZ digraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z.

GUnicodeType Xfc::G::Unichar::type (  )  const

Classifies a Unicode character by type.

Returns:
the type of the character.

GUnicodeBreakType Xfc::G::Unichar::break_type (  )  const

Determines the break type of the unicode character.

The break type is used to find word and line breaks ("text boundaries"). Pango implements the Unicode boundary resolution algorithms and normally you would use a function such as Pango::break() instead of caring about break types yourself.

Unichar Xfc::G::Unichar::upper (  )  const

Converts the character to uppercase.

Returns:
The result of converting the character to uppercase.
If the character is not a lowercase or titlecase character, or has no upper case equivalent the character is returned unchanged.

Unichar Xfc::G::Unichar::lower (  )  const

Converts the character to lower case.

Returns:
The result of converting the character to lowercase.
If the character is not an upperlower or titlecase character, or has no lower case equivalent the character is returned unchanged.

Unichar Xfc::G::Unichar::title (  )  const

Converts the character to the titlecase.

Returns:
The result of converting the character to titlecase.
If the character is not an uppercase or lowercase character, the character is returned unchanged.

int Xfc::G::Unichar::digit_value (  )  const

Determines the numeric value of the character as a decimal digit.

Returns:
If the character is a decimal digit (according to is_digit()), its numeric value; otherwise, -1.

int Xfc::G::Unichar::xdigit_value (  )  const

Determines the numeric value of the character as a hexidecimal digit.

Returns:
If the character is a hexidecimal digit (according to is_xdigit()), its numeric value; otherwise, -1.

bool Xfc::G::Unichar::validate (  )  const

Checks whether the character is a valid Unicode character.

Returns:
true if the character is a valid Unicode character.
Some possible integer values of the character will not be valid. 0 is considered a valid character, though it's normally a string terminator.

bool Xfc::G::Unichar::get_mirror_char ( Unichar mirrored_ch = 0  ) 

Gets the mirrored character for this character, if there is one.

Parameters:
@mirrored_ch The location to store the mirrored character.
Returns:
true if this character has a mirrored character and mirrored_ch is filled in, false otherwise.
In Unicode, some characters are mirrored. This means that their images are mirrored horizontally in text that is laid out from right to left. For instance, "(" would become its mirror image, ")", in right-to-left text.

If this character has the Unicode mirrored property and there is another unicode character that typically has a glyph that is the mirror image this character's glyph, that character is put at the address pointed to by mirrored_ch.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3