Class Name ctype
Header File <locale>
Classification abstract data type
Class Relationship Diagram
Class Description
Member Classes
locale::id
Methods
explicit ctype(size_t refs = 0);
~ctype();
virtual bool do_is(mask m, charT c) const;
virtual const charT* do_is(const charT* low, const charT* high,
mask* vec) const;
virtual const charT* do_scan_is(mask m, const charT* low,
const charT* high) const;
virtual const charT* do_scan_not(mask m, const charT* low,
const charT* high) const;
virtual char do_narrow(charT, char dfault) const;
virtual const charT* do_narrow(const charT* low, const charT* high,
char dfault, char* dest) const;
virtual charT do_tolower(charT c) const;
virtual const charT* do_tolower(charT* low, const charT* high) const;
virtual charT do_toupper(charT c) const;
virtual const charT* do_toupper(charT* low, const charT* high) const;
virtual charT do_widen(char) const;
virtual const char* do_widen(const char* low, const char* high,
charT* dest) const;
bool is(mask m, charT c) const;
const charT* is(const charT* low, const charT* high, mask* vec) const;
char narrow(charT c, char dfault) const;
const charT* narrow(const charT* low, const charT*, char dfault,
char* to) const;
const charT* scan_is(mask m, const charT* low, const charT* high) const;
const charT* scan_not(mask m, const charT* low, const charT* high) const;
charT tolower(charT c) const;
const charT* tolower(charT* low, const charT* high) const;
charT toupper(charT) const;
const charT* toupper(charT* low, const charT* high) const;
charT widen(char c) const;
const char* widen(const char* low, const char* high, charT* to) const;
Class Description
The ctype template class describes a class used to provide character classifications
and simple conversions.
locale::id
locale::id is a class used to provide an identification of a locale facet interfaces used as
an index for lookup and to encapsulate initialization.
Method ctype()
Access Public
Classification Constructor
Syntax explicit ctype(size_t refs = 0);
Parmeters refs, if the refs argument = 0 then the destruction
of the object is delegated to the locale or locales
which contain it. If refs = 1 then the object must
be explicitly deleted. The locale will not delete it.
The object can then be maintained across the lifetime
of multiple locales.
Returns None
Description
This constructor constructs a ctype facet object.
Method ctype()
Access Protected
Classification Destructor
Syntax ~ctype();
Parmeters None
Returns None
Description
The destructor destroys a ctype facet object.
Method do_is()
Access Protected
Classification Accessor
Syntax virtual bool do_is(mask m, charT c) const;
Parameters m is one of the mask available from the ctype_base.
c is the character to be classified.
Return This method returns true if the character matches the
classification indicated by the mask.
Description
The do_is() method classifies a character. The method determines if the character
matches the classification indicated by the mask argument m. It returns
true if the character matches the classification indicated by the mask.
Method do_is()
Access Protected
Classification Accessor
Syntax virtual const charT* do_is(const charT* low,
const charT* high,
mask* vec) const;
Parameters low is the beginning of a sequence of characters.
high is the end of a sequence of characters.
vec is a vector of masks.
Return This method returns the high argument.
Description
The do_is() method classifies a sequence of characters. The method fills vec with
every mask from the ctype_base and applies it to the sequence of characters in the
range [low, high).
Method do_scan_is()
Access Protected
Classification Accessor
Syntax virtual const charT* do_scan_is(mask m,
const charT* low,
const charT* high) const;
Parameters m is one of the mask available from the ctype_base.
low is the beginning of a sequence of characters.
high is the end of a sequence of characters.
Returns This method returns the first character in the
range that matches the classification indicated
by the mask m.
Description
The do_scan_is() method locates a character in the range [low, high) that
conforms to the classification indicated by the mask argument m.
This method returns the first character in the range that matches the
classification indicated by the mask m. If the character is not in
the range high is returned.
Method do_scan_not()
Access Protected
Classification Accessor
Syntax virtual const charT* do_scan_not(mask m,
const charT* low,
const charT* high) const;
Parameters m is one of the mask available from the ctype_base.
low is the beginning of a sequence of characters.
high is the end of a sequence of characters.
Returns This method returns the first character in the
range that does not match the classification
indicated by the mask m.
Description
The do_scan_is() method locates a character in the range [low, high) that
does not conform to the classification indicated by the mask argument m.
This method returns the first character in the range that does not match the
classification indicated by the mask m. If the character is not in
the range high is returned.
Method do_narrow()
Access Protected
Classification Modifier
Syntax virtual char do_narrow(charT c, char dfault) const;
Parameters c is the character to be transformed.
dfault is character that is returned if no
transformation takes places.
Returns This method returns the transformed value or
dfault if no transformation takes place.
Description
The do_narrow() method applies the simplest transformation from a charT value
to the corresponding char value if it exist. The method returns the transformed
value or returns the dfault argument if no transformation is possible.
Method do_narrow()
Access Protected
Classification Modifier
Syntax virtual const charT* do_narrow(const charT* low,
const charT* high,
char dfault,
char* dest) const;
Parameters low is the beginning of a sequence of
characters.
high is the end of a sequence of
characters.
dfault is used as a default transformation.
dest is the destination of the results.
Returns This method returns high.
Description
The do_narrow() method applies the simplest transformation from a sequence of charT
values to the corresponding char values if they exist. If no simple transformation
is possible then dfault is used. The method returns the transformed
values in dest argument.
Method do_tolower()
Access Protected
Classification Modifier
Syntax virtual charT do_tolower(charT c) const;
Parameters c is the character to be converted.
Returns This method returns the converted character.
Description
The do_tolower() method converts the character argument c to
lower case. The method returns the converted character. If no conversion is
possible the argument is returned.
Method do_tolower()
Access Protected
Classification Modifier
Syntax virtual charT do_tolower(charT* low,
const charT* high) const;
Parameters low is the beginning of a sequence of
characters.
high is the end of a sequence of
characters.
Returns This method returns high.
Description
The do_tolower() method converts each character in the character sequence
[low, high) argument to lower case. Each character in the range is replaced
with the lower case character. The method returns high.
Method do_toupper()
Access Protected
Classification Modifier
Syntax virtual charT do_toupper(charT c) const;
Parameters c is the character to be converted.
Returns This method returns the converted character.
Description
The do_tolower() method converts the character argument c to
upper case. The method returns the converted character. If no conversion is
possible the argument is returned.
Method do_toupper()
Access Protected
Classification Modifier
Syntax virtual charT do_toupper(charT* low,
const charT* high) const;
Parameters low is the beginning of a sequence of
characters.
high is the end of a sequence of
characters.
Returns This method returns high.
Description
The do_tolower() method converts each character in the character sequence
[low, high) argument to upper case. Each character in the range is replaced
with the upper case character. The method returns high.
Method do_widen()
Access Protected
Classification Modifier
Syntax virtual charT do_widen(charT c) const;
Parameters c is the character to be converted.
Returns This method returns the transformed character.
Description
The do_tolower() method applies the simplest transformation from a char value
to the corresponding charT value.
Method do_widen()
Access Protected
Classification Modifier
Syntax virtual const charT* do_widen(const char* low,
const char* high,
charT* dest) const;
Parameters low is the beginning of a sequence of
characters.
high is the end of a sequence of
characters.
dest is the destination of the results.
Returns This method returns high.
Description
The do_narrow() method applies the simplest transformation from a sequence of char
values to the corresponding charT values if they exist. The method returns the
transformed values in dest argument. The method returns high.
Method is()
Access Public
Classification Accessor
Syntax bool is(mask m, charT c) const;
Parameters m is one of the mask available from the ctype_base.
c is the character to be classified.
Return This method returns true if the character matches the
classification indicated by the mask.
Description
The do_is() method returns do_is(m, c).
Method is()
Access Public
Classification Accessor
Syntax const charT* is(const charT* low,
const charT* high,
mask* vec) const;
Parameters low is the beginning of a sequence of characters.
high is the end of a sequence of characters.
vec is a vector of masks.
Return This method returns the high argument.
Description
The do_is() method returns do_is(low, high, vec).
Method scan_is()
Access Public
Classification Accessor
Syntax const charT* scan_is(mask m,
const charT* low,
const charT* high) const;
Parameters m is one of the mask available from the ctype_base.
low is the beginning of a sequence of characters.
high is the end of a sequence of characters.
Returns This method returns the first character in the
range that matches the classification indicated
by the mask m.
Description
The scan_is() method returns do_scan_is(m, low, high).
Method scan_not()
Access Public
Classification Accessor
Syntax const charT* scan_not(mask m,
const charT* low,
const charT* high) const;
Parameters m is one of the mask available from the ctype_base.
low is the beginning of a sequence of characters.
high is the end of a sequence of characters.
Returns This method returns the first character in the
range that does not match the classification
indicated by the mask m.
Description
The scan_not() method returns scan_not(m, low, high).
Method narrow()
Access Public
Classification Modifier
Syntax char narrow(charT c, char dfault) const;
Parameters c is the character to be transformed.
dfault is character that is returned if no
transformation takes places.
Returns This method returns the transformed value or
dfault if no transformation takes place.
Description
The narrow() method returns do_narrow(c, dfault).
Method narrow()
Access Public
Classification Modifier
Syntax const charT* narrow(const charT* low,
const charT* high,
char dfault,
char* to) const;
Parameters low is the beginning of a sequence of
characters.
high is the end of a sequence of
characters.
dfault is used as a default transformation.
to is the destination of the results.
Returns This method returns high.
Description
The narrow() method returns do_narrow(low, high, dfault,to).
Method tolower()
Access Public
Classification Modifier
Syntax charT tolower(charT c) const;
Parameters c is the character to be converted.
Returns This method returns the converted character.
Description
The tolower() method returns do_tolower(c).
Method tolower()
Access Public
Classification Modifier
Syntax charT tolower(charT* low,
const charT* high) const;
Parameters low is the beginning of a sequence of
characters.
high is the end of a sequence of
characters.
Returns This method returns high.
Description
The tolower() method returns do_tolower(low, high).
Method toupper()
Access Public
Classification Modifier
Syntax charT toupper(charT c) const;
Parameters c is the character to be converted.
Returns This method returns the converted character.
Description
The toupper() method returns do_toupper(c).
Method toupper()
Access Public
Classification Modifier
Syntax charT do_toupper(charT* low,
const charT* high) const;
Parameters low is the beginning of a sequence of
characters.
high is the end of a sequence of
characters.
Returns This method returns high.
Description
The toupper() method returns do_toupper(low, high).
Method widen()
Access Public
Classification Modifier
Syntax charT widen(charT c) const;
Parameters c is the character to be converted.
Returns This method returns the transformed character.
Description
The widen() method returns do_widen(c).
Method widen()
Access Public
Classification Modifier
Syntax const charT* widen(const char* low,
const char* high,
charT* to) const;
Parameters low is the beginning of a sequence of
characters.
high is the end of a sequence of
characters.
to is the destination of the results.
Returns This method returns high.
Description
The widen() method returns do_widen(low, high, to).
No comments:
Post a Comment