Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Char Class Reference

#include <elm/string/Char.h>

Public Member Functions

 Char (void)
 
 Char (char ch)
 
 operator char (void) const
 
Charoperator= (char ch)
 
Charoperator= (Char ch)
 
int compare (char cc) const
 
int compare (Char ch) const
 
bool isBin (void) const
 
bool isDec (void) const
 
bool isHex (void) const
 
bool isSpace (void) const
 
bool isPrintable (void) const
 
bool isLetter (void) const
 
bool isLowerCase (void) const
 
bool isUpperCase (void) const
 
int asBin (void) const
 
int asDec (void) const
 
int asHex (void) const
 
bool operator== (char ch)
 
bool operator!= (char ch)
 
bool operator< (char ch)
 
bool operator<= (char ch)
 
bool operator> (char ch)
 
bool operator>= (char ch)
 
bool operator== (Char ch)
 
bool operator!= (Char ch)
 
bool operator< (Char ch)
 
bool operator<= (Char ch)
 
bool operator> (Char ch)
 
bool operator>= (Char ch)
 

Static Public Member Functions

static Char bin (int v)
 
static Char dec (int v)
 
static Char hex (int v)
 
static Char lowerHex (int v)
 
static Char upperHex (int v)
 

Detailed Description

Wrapper class around the C++ char type to provide methods for character testing and conversion.

Constructor & Destructor Documentation

◆ Char() [1/2]

Char ( void  )
inline

◆ Char() [2/2]

Char ( char  ch)
inline

Member Function Documentation

◆ asBin()

int asBin ( void  ) const

Convert binary character to digit.

Returns
Digit value or -1 (if not binary).

◆ asDec()

int asDec ( void  ) const

Convert decimal character to digit.

Returns
Digit value or -1 (if not decimal).

◆ asHex()

int asHex ( void  ) const

Convert hexadecimal character to digit.

Returns
Digit value or -1 (if not hexadecimal).

◆ bin()

Char bin ( int  v)
static

Convert binary to character.

Parameters
vBinary digit.
Returns
Character.

◆ compare() [1/2]

◆ compare() [2/2]

int compare ( Char  ch) const
inline

◆ dec()

Char dec ( int  v)
static

Convert to decimal value.

Parameters
Hexadecimaldigit.
Returns
Character.

◆ hex()

Char hex ( int  v)
inlinestatic

Convert to hexadecimal character.

Parameters
vDigit to convert.
Returns
Character.

References Char::lowerHex().

◆ isBin()

bool isBin ( void  ) const

Test if the character is a binary digit.

Returns
True if binary digit, false else.

References elm::bin_set, and elm::is().

◆ isDec()

bool isDec ( void  ) const

Test if the character is a decimal digit.

Returns
True if decimal digit, false else.

References elm::dec_set, and elm::is().

◆ isHex()

bool isHex ( void  ) const

Test if the character is a decimal digit.

Returns
True if decimal digit, false else.

References elm::hex_set, and elm::is().

◆ isLetter()

bool isLetter ( void  ) const

Test if the character is a decimal digit.

Returns
True if decimal digit, false else.

References elm::is(), and elm::letter_set.

◆ isLowerCase()

bool isLowerCase ( void  ) const

Test if the character is a decimal digit.

Returns
True if decimal digit, false else.

References elm::is(), and elm::lower_set.

◆ isPrintable()

bool isPrintable ( void  ) const

Test if the character is a decimal digit.

Returns
True if decimal digit, false else.

◆ isSpace()

bool isSpace ( void  ) const

Test if the character is a decimal digit.

Returns
True if decimal digit, false else.

References elm::is(), and elm::space_set.

◆ isUpperCase()

bool isUpperCase ( void  ) const

Test if the character is a decimal digit.

Returns
True if decimal digit, false else.

References elm::is(), and elm::upper_set.

◆ lowerHex()

Char lowerHex ( int  v)
static

Convert to hexadecimal character with lower-case letters.

Parameters
vDigit to convert.
Returns
Character.

Referenced by Char::hex().

◆ operator char()

operator char ( void  ) const
inline

◆ operator!=() [1/2]

bool operator!= ( char  ch)
inline

References Char::compare().

◆ operator!=() [2/2]

bool operator!= ( Char  ch)
inline

References Char::compare().

◆ operator<() [1/2]

bool operator< ( char  ch)
inline

References Char::compare().

◆ operator<() [2/2]

bool operator< ( Char  ch)
inline

References Char::compare().

◆ operator<=() [1/2]

bool operator<= ( char  ch)
inline

References Char::compare().

◆ operator<=() [2/2]

bool operator<= ( Char  ch)
inline

References Char::compare().

◆ operator=() [1/2]

Char& operator= ( char  ch)
inline

◆ operator=() [2/2]

Char& operator= ( Char  ch)
inline

◆ operator==() [1/2]

bool operator== ( char  ch)
inline

References Char::compare().

◆ operator==() [2/2]

bool operator== ( Char  ch)
inline

References Char::compare().

◆ operator>() [1/2]

bool operator> ( char  ch)
inline

References Char::compare().

◆ operator>() [2/2]

bool operator> ( Char  ch)
inline

References Char::compare().

◆ operator>=() [1/2]

bool operator>= ( char  ch)
inline

References Char::compare().

◆ operator>=() [2/2]

bool operator>= ( Char  ch)
inline

References Char::compare().

◆ upperHex()

Char upperHex ( int  v)
static

Convert to hexadecimal character with upper-case letters.

Parameters
vDigit to convert.
Returns
Character.

The documentation for this class was generated from the following files: