Quick Links: |
#include <bdlb_chartype.h>
Public Types | |
enum | Category { e_UPPER, e_LOWER, e_ALPHA, e_DIGIT, e_XDIGIT, e_ALNUM, e_SPACE, e_PRINT, e_GRAPH, e_PUNCT, e_CNTRL, e_ASCII, e_IDENT, e_ALUND, e_ALL, e_NONE, e_ODIGIT, BDEU_UPPER = e_UPPER, BDEU_LOWER = e_LOWER, BDEU_ALPHA = e_ALPHA, BDEU_ODIGIT = e_ODIGIT, BDEU_DIGIT = e_DIGIT, BDEU_XDIGIT = e_XDIGIT, BDEU_ALNUM = e_ALNUM, BDEU_SPACE = e_SPACE, BDEU_PRINT = e_PRINT, BDEU_GRAPH = e_GRAPH, BDEU_PUNCT = e_PUNCT, BDEU_CNTRL = e_CNTRL, BDEU_ASCII = e_ASCII, BDEU_IDENT = e_IDENT, BDEU_ALUND = e_ALUND, BDEU_ALL = e_ALL, BDEU_NONE = e_NONE, UPPER = e_UPPER, LOWER = e_LOWER, ALPHA = e_ALPHA, DIGIT = e_DIGIT, XDIGIT = e_XDIGIT, ALNUM = e_ALNUM, SPACE = e_SPACE, PRINT = e_PRINT, GRAPH = e_GRAPH, PUNCT = e_PUNCT, CNTRL = e_CNTRL, ASCII = e_ASCII, IDENT = e_IDENT, ALUND = e_ALUND, ALL = e_ALL, NONE = e_NONE } |
Set of character categories supported by this component. More... | |
enum | { k_NUM_CATEGORIES = e_ODIGIT + 1, BDEU_NUM_CATEGORIES = k_NUM_CATEGORIES } |
Static Public Member Functions | |
static bool | isUpper (char character) |
static bool | isLower (char character) |
static bool | isAlpha (char character) |
static bool | isOdigit (char character) |
static bool | isDigit (char character) |
static bool | isXdigit (char character) |
static bool | isAlnum (char character) |
static bool | isSpace (char character) |
static bool | isPrint (char character) |
static bool | isGraph (char character) |
static bool | isPunct (char character) |
static bool | isCntrl (char character) |
static bool | isAscii (char character) |
static bool | isIdent (char character) |
static bool | isAlund (char character) |
static bool | isAll (char character) |
static bool | isNone (char character) |
static bool | isCategory (char character, CharType::Category category) |
static const char * | stringUpper () |
static const char * | stringLower () |
static const char * | stringAlpha () |
static const char * | stringOdigit () |
static const char * | stringDigit () |
static const char * | stringXdigit () |
static const char * | stringAlnum () |
static const char * | stringSpace () |
static const char * | stringPrint () |
static const char * | stringGraph () |
static const char * | stringPunct () |
static const char * | stringCntrl () |
static const char * | stringAscii () |
static const char * | stringIdent () |
static const char * | stringAlund () |
static const char * | stringAll () |
static const char * | stringNone () |
static const char * | stringCategory (CharType::Category category) |
static int | numUpper () |
static int | numLower () |
static int | numAlpha () |
static int | numOdigit () |
static int | numDigit () |
static int | numXdigit () |
static int | numAlnum () |
static int | numSpace () |
static int | numPrint () |
static int | numGraph () |
static int | numPunct () |
static int | numCntrl () |
static int | numAscii () |
static int | numIdent () |
static int | numAlund () |
static int | numAll () |
static int | numNone () |
static int | numCategory (CharType::Category category) |
static const char * | toAscii (CharType::Category category) |
static char | toLower (char input) |
static char | toUpper (char input) |
This struct
provides a namespace for a suite of pure procedures operating on the fundamental type char
.
static bool bdlb::CharType::isUpper | ( | char | character | ) | [static] |
Return true
if the specified character
is in the UPPER
category (i.e., [A-Z]
), and false
otherwise.
static bool bdlb::CharType::isLower | ( | char | character | ) | [static] |
Return true
if the specified character
is in the LOWER
category (i.e., [a-z]
), and false
otherwise.
static bool bdlb::CharType::isAlpha | ( | char | character | ) | [static] |
Return true
if the specified character
is in the ALPHA
category (i.e., [A-Za-z]
), and false
otherwise.
static bool bdlb::CharType::isOdigit | ( | char | character | ) | [static] |
Return true
if the specified character
is in the ODIGIT
category (i.e., [0-7]
), and false
otherwise.
static bool bdlb::CharType::isDigit | ( | char | character | ) | [static] |
Return true
if the specified character
is in the DIGIT
category (i.e., [0-9]
), and false
otherwise.
static bool bdlb::CharType::isXdigit | ( | char | character | ) | [static] |
Return true
if the specified character
is in the XDIGIT
category (i.e., [0-9A-Fa-f]
), and false
otherwise.
static bool bdlb::CharType::isAlnum | ( | char | character | ) | [static] |
Return true
if the specified character
is in the ALNUM
category (i.e., [0-9A-Za-Z]
), and false
otherwise.
static bool bdlb::CharType::isSpace | ( | char | character | ) | [static] |
Return true
if the specified character
is in the SPACE
category (i.e., [space|tab|CR|NL|VT|FF]
), and false
otherwise.
static bool bdlb::CharType::isPrint | ( | char | character | ) | [static] |
Return true
if the specified character
is in the PRINT
category (i.e., any printable character including SPACE
), and false
otherwise.
static bool bdlb::CharType::isGraph | ( | char | character | ) | [static] |
Return true
if the specified character
is in the GRAPH
category (i.e., any printable character except SPACE
), and false
otherwise.
static bool bdlb::CharType::isPunct | ( | char | character | ) | [static] |
Return true
if the specified character
is in the PUNCT
category (i.e., any printable character other than SPACE
or ALNUM
), and false
otherwise.
static bool bdlb::CharType::isCntrl | ( | char | character | ) | [static] |
Return true
if the specified character
is in the CNTRL
category (i.e., [\1-\37]
and \177
), and false
otherwise.
static bool bdlb::CharType::isAscii | ( | char | character | ) | [static] |
Return true
if the specified character
is in the ASCII
category (i.e., [\0-\177]
), and false
otherwise.
static bool bdlb::CharType::isIdent | ( | char | character | ) | [static] |
Return true
if the specified character
is in the IDENT
category (i.e., [ALNUM|_]
), and false
otherwise.
static bool bdlb::CharType::isAlund | ( | char | character | ) | [static] |
Return true
if the specified character
is in the ALUND
category (i.e., [ALPHA|_]
), and false
otherwise.
static bool bdlb::CharType::isAll | ( | char | character | ) | [static] |
Return true
if the specified character
is in the ALL
category (i.e., [\0-\377]
), and false
otherwise. Note that this function always returns true
, but is provide for completeness.
static bool bdlb::CharType::isNone | ( | char | character | ) | [static] |
Return true
if the specified character
is in the NONE
category (i.e., []
), and false
otherwise. Note that this function always returns false
, but is provided for completeness.
static bool bdlb::CharType::isCategory | ( | char | character, | |
CharType::Category | category | |||
) | [static] |
Return true
if the specified character
is in the specified category
, and false
otherwise.
static const char* bdlb::CharType::stringUpper | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category UPPER
(i.e., [A-Z]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringLower | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category LOWER
(i.e., [a-z]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringAlpha | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category ALPHA
(i.e., [A-Za-z]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringOdigit | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category DIGIT
(i.e., [0-7]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringDigit | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category DIGIT
(i.e., [0-9]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringXdigit | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category XDIGIT
(i.e., [0-9A-Fa-f]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringAlnum | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category ALNUM
(i.e., [0-9A-Za-Z]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringSpace | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category SPACE
(i.e., [space|tab|CR|NL|VT|FF]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringPrint | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category PRINT
(i.e., any printable character including SPACE
), ordered by increasing character codes.
static const char* bdlb::CharType::stringGraph | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category GRAPH
(i.e., any printable character except SPACE
), ordered by increasing character codes.
static const char* bdlb::CharType::stringPunct | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category PUNCT
(i.e., any printable character other than SPACE
or ALNUM
), ordered by increasing character codes.
static const char* bdlb::CharType::stringCntrl | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category CNTRL
(i.e., [\0-\37]
and \177
), ordered by increasing character codes. Note that this string, if printed, may appear to be of length 0 because the NULL
character is part of the set and appears first.
static const char* bdlb::CharType::stringAscii | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category ASCII
(i.e., [\0-\177]
), ordered by increasing character codes. Note that this string, if printed, may appear to be of length 0 because the NULL
character is part of the set and appears first.
static const char* bdlb::CharType::stringIdent | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category IDENT
(i.e., [ALNUM|_]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringAlund | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category ALUND
(i.e., [ALPHA|_]
), ordered by increasing character codes.
static const char* bdlb::CharType::stringAll | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category ALL
(i.e., [\0-\377]
), ordered by increasing character codes. Note that this string, if printed, may appear to be of length 0 because the NULL
character is part of the set and appears first.
static const char* bdlb::CharType::stringNone | ( | ) | [static] |
Return a null-terminated string consisting of all characters in the category NONE
. Note that this string is empty.
static const char* bdlb::CharType::stringCategory | ( | CharType::Category | category | ) | [static] |
Return a null-terminated string consisting of all characters in the specified category
, ordered by increasing character codes. Note that for category values of CNTRL
, ASCII, and 'ALL
, this string, if printed, may appear to be of length 0 because the NULL
character is part of the set and appears first.
static int bdlb::CharType::numUpper | ( | ) | [static] |
Return the number of characters in the category UPPER
(i.e., [A-Z]
).
static int bdlb::CharType::numLower | ( | ) | [static] |
Return the number of characters in the category LOWER
(i.e., [a-z]
).
static int bdlb::CharType::numAlpha | ( | ) | [static] |
Return the number of characters in the category ALPHA
(i.e., [A-Za-z]
).
static int bdlb::CharType::numOdigit | ( | ) | [static] |
Return the number of characters in the category ODIGIT
(i.e., [0-7]
).
static int bdlb::CharType::numDigit | ( | ) | [static] |
Return the number of characters in the category DIGIT
(i.e., [0-9]
).
static int bdlb::CharType::numXdigit | ( | ) | [static] |
Return the number of characters in the category XDIGIT
(i.e., [0-9A-Fa-f]
).
static int bdlb::CharType::numAlnum | ( | ) | [static] |
Return the number of characters in the category ALNUM
(i.e., [0-9A-Za-Z]
).
static int bdlb::CharType::numSpace | ( | ) | [static] |
Return the number of characters in the category SPACE
(i.e., [space|tab|CR|NL|VT|FF]
).
static int bdlb::CharType::numPrint | ( | ) | [static] |
Return the number of characters in the category PRINT
(i.e., any printable character including SPACE
).
static int bdlb::CharType::numGraph | ( | ) | [static] |
Return the number of characters in the category 'GRAPH (i.e., any printable character except SPACE
), and false
otherwise.
static int bdlb::CharType::numPunct | ( | ) | [static] |
Return the number of characters in the category PUNCT
(i.e., any printable character other than SPACE
or ALNUM
).
static int bdlb::CharType::numCntrl | ( | ) | [static] |
Return the number of characters in the category CNTRL
(i.e., [\1-\37]
and \177
).
static int bdlb::CharType::numAscii | ( | ) | [static] |
Return the number of characters in the category ASCII
(i.e., [\0-\177]
).
static int bdlb::CharType::numIdent | ( | ) | [static] |
Return the number of characters in the category IDENT
(i.e., [ALNUM|_]
).
static int bdlb::CharType::numAlund | ( | ) | [static] |
Return the number of characters in the category ALUND
(i.e., [ALPHA|_]
).
static int bdlb::CharType::numAll | ( | ) | [static] |
Return the number of characters in the category ALL
. Note that the character string returned by the stringAll
method is of length 255, but the terminating null is part of the set.
static int bdlb::CharType::numNone | ( | ) | [static] |
Return the number of characters in the category NONE
. Note that the string returned by the stringNone
method is empty.
static int bdlb::CharType::numCategory | ( | CharType::Category | category | ) | [static] |
Return the number of characters in the specified category
.
static const char* bdlb::CharType::toAscii | ( | CharType::Category | category | ) | [static] |
Return a null-terminated string representation of the specified character category
enumerator that is identical to the enumerator name.
static char bdlb::CharType::toLower | ( | char | input | ) | [static] |
Return the character in the LOWER
category corresponding to the specified input
character from the UPPER
category or input
itself if input
is not in category UPPER
.
static char bdlb::CharType::toUpper | ( | char | input | ) | [static] |
Return the character in the UPPER
category corresponding to the specified input
character from the LOWER
category or input
itself if input
is not in category LOWER
.