description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: ctype_base Class |
ctype_base Class |
11/04/2016 |
|
|
ccffe891-d7ab-4d22-baf8-8eb6d438a96d |
The class serves as a base class for facets of class template ctype. A base class for the ctype class that is used to define enumeration types used to classify or test characters either individually or within entire ranges.
struct ctype_base : public locale::facet
{
enum
{
alnum,
alpha,
cntrl,
digit,
graph,
lower,
print,
punct,
space,
upper,
xdigit
};
typedef short mask;
ctype_base( size_t _Refs = 0 );
~ctype_base();
};
It defines an enumeration mask. Each enumeration constant characterizes a different way to classify characters, as defined by the functions with similar names declared in the header <ctype.h>. The constants are:
-
space (function isspace)
-
print (function isprint)
-
cntrl (function iscntrl)
-
upper (function isupper)
-
lower (function islower)
-
digit (function isdigit)
-
punct (function ispunct)
-
xdigit (function isxdigit)
-
alpha (function isalpha)
-
alnum (function isalnum)
-
graph (function isgraph)
You can characterize a combination of classifications by a bitwise OR of these constants. In particular, it's always true that alnum == ( alpha | digit ) and graph == ( alnum | punct ).
Header: <locale>
Namespace: std