Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

ctype


inherits from ctype_base ctype... inherits fromlocale::facet

Summary

A facet that includes character classification facilities.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <locale>
class ctype_base;
template <class charT> class ctype;

Specializations

class ctype<char>; 

Description

ctype<charT> is a facet that allows you to classify characters and perform simple conversions. ctype<charT> also converts upper to lower and lower to upper case, and converts between charT and char. ctype<charT> relies on ctype_base for a set of masks that identify the various classes of characters. These classes are:

The masks are passed to member functions of ctype to obtain the classifications of a character or range of characters.

Interface

Types

char_type

Constructors

explicit ctype(size_t refs = 0) 

Destructors

~ctype();  // virtual and protected

Public Member Functions

The public members of the ctype facet include an interface to protected members. Each public member xxx has a corresponding virtual protected member do_xxx. All work is delegated to these protected members. For instance, the public widen function simply calls its protected cousin do_widen.

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*, 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; 

Facet ID

static locale::id id;

Protected Member Functions

virtual bool         
do_is(mask m, charT c) const; 
virtual const charT* 
do_is(const charT* low, const charT* high,
      mask* vec) 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 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 charT        
do_tolower(charT) 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 c) const; 
virtual const char*  
do_widen(const char* low, const char* high, charT* dest) const; 

Example

See Also

locale, facets, collate, ctype<char>, ctype_byname



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998