class ctype<char> : public locale::facet, public ctype_base {
public:
typedef char char_type;
explicit ctype(const mask *tab = 0, bool del = false,
size_t refs = 0);
bool is(mask msk, char ch) const;
const char *is(const char *first, const char *last,
mask *dst) const;
const char *scan_is(mask msk,
const char *first, const char *last) const;
const char *scan_not(mask msk,
const char *first, const char *last) const;
char toupper(char ch) const;
const char *toupper(char *first, char *last) const;
char tolower(char ch) const;
const char *tolower(char *first, char *last) const;
char widen(char ch) const;
const char *widen(char *first, char *last, char *dst) const;
char narrow(char ch, char dflt) const;
const char *narrow(const char *first, const char *last,
char dflt, char *dst) const;
static locale::id id;
protected:
~ctype();
virtual char do_toupper(char ch) const;
virtual const char *do_toupper(char *first, char *last) const;
virtual char do_tolower(char ch) const;
virtual const char *do_tolower(char *first, char *last) const;
const mask *table() const throw();
static const mask *classic_table() const throw();
static const size_t table_size;
};
The class is an explicit specialization of template class ctype
for type char. Hence, it describes an object that can
serve as a locale facet, to characterize various properties of a "character" (element) of type char. The explicit
specialization differs from the template class in several ways:
tab
, the ctype mask table, and del
, the Boolean object that is true if
the array should be deleted when the ctype<char>
object is destroyed -- as well as the usual reference-count
parameter refs
.table
()
returns the stored ctype mask table.table_size
specifies the minimum number of elements in a ctype mask table.classic_table
()
returns the ctype mask table appropriate to the "C"
locale.do_is
, do_narrow
, do_scan_is
, do_scan_not
, or
do_widen
. The corresponding public member functions perform the equivalent operations themselves.narrow
and widen
simply copy elements unaltered.