std::ctype<char>
From cppreference.com
| Defined in header <locale>
|
||
| template<> class ctype<char>; |
||
This specialization of std::ctype encapsulates character classification features for type char. Unlike general-purpose std::ctype, which uses virtual functions, this specialization uses table lookup to classify characters (which is generally faster).
The base class std::ctype<char> implements character classification equivalent to the minimal "C" locale. The classification rules can be extended or modified if constructed with a non-default classification table argument, if constructed as std::ctype_byname<char> or as a user-defined derived facet. All std::istream formatted input functions are required to use std::ctype<char> for character classing during input parsing.
Member types
| Member type | Definition |
char_type
|
char
|
Member functions
| constructs a new std::ctype<char> facet (public member function) | |
| destructs a std::ctype<char> facet (protected member function) | |
| obtains the character classification table (public member function) | |
| [static] |
obtains the "C" locale character classification table (public static member function) |
| classifies a character or a character sequence, using the classification table (public member function) | |
| locates the first character in a sequence that conforms to given classification, using the classification table (public member function) | |
| locates the first character in a sequence that fails given classification, using the classification table (public member function) | |
invokes do_toupper (public member function of std::ctype) | |
invokes do_tolower (public member function of std::ctype) | |
invokes do_widen (public member function of std::ctype) | |
invokes do_narrow (public member function of std::ctype) |
Protected member functions
| [virtual] |
converts a character or characters to uppercase (virtual protected member function of std::ctype) |
| [virtual] |
converts a character or characters to lowercase (virtual protected member function of std::ctype) |
| [virtual] |
converts a character or characters from char to charT (virtual protected member function of std::ctype) |
| [virtual] |
converts a character or characters from charT to char (virtual protected member function of std::ctype) |
Member objects
| static std::locale::id id [static] |
id of the locale (public static member constant) |
| static const std::size_t table_size [static] |
size of the classification table, at least 256 (public static member constant) |
Inherited from std::ctype_base
Member types
| Type | Definition |
mask
|
unspecified bitmask type (enumeration, integer type, or bitset) |
Member constants
| space [static] |
the value of mask identifying whitespace character classification (public static member constant) |
| print [static] |
the value of mask identifying printable character classification (public static member constant) |
| cntrl [static] |
the value of mask identifying control character classification (public static member constant) |
| upper [static] |
the value of mask identifying uppercase character classification (public static member constant) |
| lower [static] |
the value of mask identifying lowercase character classification (public static member constant) |
| alpha [static] |
the value of mask identifying alphabetic character classification (public static member constant) |
| digit [static] |
the value of mask identifying digit character classification (public static member constant) |
| punct [static] |
the value of mask identifying punctuation character classification (public static member constant) |
| xdigit [static] |
the value of mask identifying hexadecimal digit character classification (public static member constant) |
| blank [static] (C++11) |
the value of mask identifying blank character classification (public static member constant) |
| alnum [static] |
alpha | digit (public static member constant) |
| graph [static] |
alnum | punct (public static member constant) |
