Unicode Character. More...

#include <rchar.h>

Public Member Functions

 RChar (void)
 
 RChar (const char c)
 
 RChar (const unsigned char c)
 
 RChar (const UChar c)
 
 RChar (const long c)
 
 RChar (const unsigned int c)
 
 RChar (const int c)
 
RCharoperator= (const char c)
 
RCharoperator= (const unsigned char c)
 
RCharoperator= (const unsigned short c)
 
RCharoperator= (const short c)
 
RCharoperator= (const unsigned int c)
 
RCharoperator= (const int c)
 
bool operator== (const char c) const
 
bool operator== (const RChar c) const
 
bool operator!= (const char c) const
 
bool operator!= (const RChar c) const
 
bool operator< (const char c) const
 
bool operator< (const RChar c) const
 
bool operator<= (const char c) const
 
bool operator<= (const RChar c) const
 
bool operator> (const char c) const
 
bool operator> (const RChar c) const
 
bool operator>= (const char c) const
 
bool operator>= (const RChar c) const
 
RCharoperator+= (const RChar &c)
 
RCharoperator-= (const RChar &c)
 
char Latin1 (void) const
 
UChar Unicode (void) const
 
bool IsNull (void) const
 
bool operator! () const
 
bool IsPrint (void) const
 
bool IsPunct (void) const
 
bool IsSpace (void) const
 
bool IsAlpha (void) const
 
bool IsDigit (void) const
 
bool IsAlNum (void) const
 
bool IsGraph (void) const
 

Static Public Member Functions

static RChar ToLower (const RChar c)
 
static RChar ToUpper (const RChar c)
 
static size_t StrLen (const RChar *str)
 
static int StrCmp (const RChar *str1, const RChar *str2)
 
static int StrCmp (const RChar *str1, const char *str2)
 
static int StrCmp (const char *str1, const RChar *str2)
 
static int StrNCmp (const RChar *str1, const RChar *str2, size_t size)
 
static int StrNCmp (const RChar *str1, const char *str2, size_t size)
 
static int StrNCmp (const char *str1, const RChar *str2, size_t size)
 
static const RCharStrChr (const RChar *str1, const RChar c)
 

Private Attributes

UChar Car
 

Detailed Description

Unicode Character.

This class implements a unicode character as a class.

Constructor & Destructor Documentation

RChar ( void  )

Construct a null character.

RChar ( const char  c)

Copy constructor.

Parameters
cASCII/Latin-1 character.
RChar ( const unsigned char  c)
explicit

Copy constructor.

Parameters
cASCII/Latin-1 character.
RChar ( const UChar  c)
explicit

Copy constructor.

Parameters
cUnicode character.
RChar ( const long  c)
explicit

Copy constructor.

Parameters
cUnicode character.
RChar ( const unsigned int  c)
explicit

Copy constructor.

Parameters
cUnicode character.
RChar ( const int  c)
explicit

Copy constructor.

Parameters
cUnicode character.

Member Function Documentation

RChar& operator= ( const char  c)

Assignment operator.

Parameters
cASCII/Latin-1 character.
RChar& operator= ( const unsigned char  c)

Assignment operator.

Parameters
cASCII/Latin-1 character.
RChar& operator= ( const unsigned short  c)

Assignment operator.

Parameters
cUnicode character.
RChar& operator= ( const short  c)

Assignment operator.

Parameters
cUnicode character.
RChar& operator= ( const unsigned int  c)

Assignment operator.

Parameters
cUnicode character.
RChar& operator= ( const int  c)

Assignment operator.

Parameters
cUnicode character.
bool operator== ( const char  c) const

Assignment operator.

Parameters
cCharacter.
bool operator== ( const RChar  c) const

Comparison == operator.

Parameters
cCharacter.
bool operator!= ( const char  c) const

Comparison != operator.

Parameters
cCharacter.
bool operator!= ( const RChar  c) const

Comparison != operator.

Parameters
cCharacter.
bool operator< ( const char  c) const

Comparison < operator.

Parameters
cCharacter.
bool operator< ( const RChar  c) const

Comparison < operator.

Parameters
cCharacter.
bool operator<= ( const char  c) const

Comparison <= operator.

Parameters
cCharacter.
bool operator<= ( const RChar  c) const

Comparison <= operator.

Parameters
cCharacter.
bool operator> ( const char  c) const

Comparison > operator.

Parameters
cCharacter.
bool operator> ( const RChar  c) const

Comparison > operator.

Parameters
cCharacter.
bool operator>= ( const char  c) const

Comparison >= operator.

Parameters
cCharacter.
bool operator>= ( const RChar  c) const

Comparison >= operator.

Parameters
cCharacter.
RChar& operator+= ( const RChar c)

Add a character to another one.

Parameters
cCharacter.
RChar& operator-= ( const RChar c)

Substract a character to another one.

Parameters
cCharacter.
Returns
char Latin1 ( void  ) const

Get a Latin1 character.

Returns
The character or 0 if is not Latin1.
UChar Unicode ( void  ) const

Get a Unicode character.

Returns
UChar.
bool IsNull ( void  ) const

Test if the character is a null one.

Returns
bool.
bool operator! ( ) const

Test if the character is a null one.

Returns
bool.
bool IsPrint ( void  ) const

Test if the character is a printable one.

Returns
bool.
bool IsPunct ( void  ) const

Test if the character is a punctuation one.

Returns
bool.
bool IsSpace ( void  ) const

Test if the character is a space one.

Returns
bool.
bool IsAlpha ( void  ) const

Test if the character is a letter.

Returns
bool.
bool IsDigit ( void  ) const

Test if the character is a digit.

Returns
bool.
bool IsAlNum ( void  ) const

Test if the character is alphanumeric.

Returns
bool.
bool IsGraph ( void  ) const

Test if the character is a graphical one.

Returns
bool.
static RChar ToLower ( const RChar  c)
static

Transform an Unicode character in lower case.

Parameters
cCharacter. return RChar.
static RChar ToUpper ( const RChar  c)
static

Transform an Unicode character in upper case.

Parameters
cCharacter. return RChar.
static size_t StrLen ( const RChar str)
static

Compute the length of an array of RChar.

Returns
int.
static int StrCmp ( const RChar str1,
const RChar str2 
)
static

Compare two RChar array.

Returns
0 if the two strings are identical, >0 of the first string is "greater" than the second and <0 else.
static int StrCmp ( const RChar str1,
const char *  str2 
)
static

Compare a RChar array and a "C" string.

Returns
0 if the two strings are identical, >0 of the first string is "greater" than the second and <0 else.
static int StrCmp ( const char *  str1,
const RChar str2 
)
static

Compare a RChar array and a "C" string.

Returns
0 if the two strings are identical, >0 of the first string is "greater" than the second and <0 else.
static int StrNCmp ( const RChar str1,
const RChar str2,
size_t  size 
)
static

Compare two RChar array, except that no more than size characters are compared.

Returns
0 if the two strings are identical, >0 of the first string is "greater" than the second and <0 else.
static int StrNCmp ( const RChar str1,
const char *  str2,
size_t  size 
)
static

Compare a RChar array and a "C" string, except that no more than size characters are compared.

Returns
0 if the two strings are identical, >0 of the first string is "greater" than the second and <0 else.
static int StrNCmp ( const char *  str1,
const RChar str2,
size_t  size 
)
static

Compare a RChar array and a "C" string, except that no more than size characters are compared.

Returns
0 if the two strings are identical, >0 of the first string is "greater" than the second and <0 else.
static const RChar* StrChr ( const RChar str1,
const RChar  c 
)
static

Test if a given character is in a string.

Returns
0 if the the character was not found, or point to the first occurrence of the character in the string.

Field Documentation

UChar Car
private

The character.