Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

lrt::Char Class Reference

Defines static helper functions to determine and convert the type of a character. More...

#include <rtchar.h>

List of all members.

Static Public Methods

bool isSpace (char ch)
 Detects if a character is whitespace. More...

bool isUpperCase (char ch)
 Detects if a character is an upper-case letter.

bool isLowerCase (char ch)
 Detects if a character is a lower-case letter.

bool isDigit (char ch)
 Detects if a character is a digit for decimal numbers.

bool isDigit (char ch, int radix)
 Detects if a character is a digit for numbers represented with radix radix.

bool isLetter (char ch)
 Detects if a character is a letter. More...

char lowerCase (char ch)
 Returns the lower-case equivalent of a character, if it is an upper-case letter. More...

char upperCase (char ch)
 Returns the upper-case equivalent of a character, if it is a lower-case letter. More...

int numericValue (char ch)
 Returns the numeric value of a character. More...

char charValue (int num)
 Returns the character representing the given number. More...


Static Public Attributes

const int MAX_RADIX = 36
 The maximum radix supported for integer <-> String conversions. More...


Detailed Description

Defines static helper functions to determine and convert the type of a character.

Note that in libRT, every character is supposed to have the Latin-1 charset.


Member Function Documentation

char lrt::Char::charValue (  int    num )  [inline, static]
 

Returns the character representing the given number.

Note that the given number is not positive and smaller than MAX_RADIX, results are undefined.

bool lrt::Char::isLetter (  char    ch )  [inline, static]
 

Detects if a character is a letter.

This function is equivalent to isLowerCase || isUpperCase.

bool lrt::Char::isSpace (  char    ch )  [inline, static]
 

Detects if a character is whitespace.

Every spacing and control character is defined as whitespace.

char lrt::Char::lowerCase (  char    ch )  [inline, static]
 

Returns the lower-case equivalent of a character, if it is an upper-case letter.

If the given character is not uppercase, it is left unchanged.

int lrt::Char::numericValue (  char    ch )  [inline, static]
 

Returns the numeric value of a character.

The returned value is in range 0..MAX_RADIX, if the character is an English letter or digit. If the character is not numerically representable, results are undefined.

char lrt::Char::upperCase (  char    ch )  [inline, static]
 

Returns the upper-case equivalent of a character, if it is a lower-case letter.

If the given character is not lowercase, it is left unchanged.


Member Data Documentation

const int lrt::Char::MAX_RADIX = 36 [static]
 

The maximum radix supported for integer <-> String conversions.

(36)


The documentation for this class was generated from the following files:
This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer