Click on the banner to return to the class reference home page.

ctype<char>


ctype_base ctype<char> locale::facet

Summary

A specialization of the ctype facet.

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

Synopsis

#include <locale>
class ctype<char>; 

Description

This specialization of the ctype<charT> template provides inline versions of ctype's member functions. The facet provides the same public interface, and uses the same set of masks, as the ctype template.

Interface

template <>
class ctype<char> : public locale::facet, public ctype_base {
  public:
    typedef char char_type;
    explicit ctype(const mask* = 0, bool = false, 
                   size_t = 0);
    bool         is(mask, char) const;
    const charT* is(const char*, 
                    const char*, mask*) const;
    const charT* scan_is(mask,
                         const char*, 
                         const char*) const;
    const charT* scan_not(mask,
                          const char*, 
                          const char*) const;
    charT        toupper(char) const;
    const charT* toupper(char*, const charT*) const;
    charT        tolower(char) const;
    const charT* tolower(char*, const char*) const;
    charT        widen(char) const;
    const char*  widen(const char*, 
                     const char*, char*) const;
    char         narrow(char, char) const;
    const charT* narrow(const char*, const char*, 
                        char, char*) const;
    static locale::id id;
    static const size_t table_size = 256;

  protected:
    const mask* table() const throw();
    static const mask* classic_table() throw();

~ctype();  // virtual
    virtual charT        do_toupper(charT) const;
    virtual const charT* do_toupper(charT*, 
                                    const charT*) const;
    virtual charT        do_tolower(charT) const;
    virtual const charT* do_tolower(charT*, 
                                    const charT*) const;
};

Type

char_type

Constructors and Destructors

explicit ctype(const mask* tbl = 0, bool del = false,
               size_t refs = 0)
~ctype();  // virtual and protected

Public Member Functions

The public members of the ctype<char> facet specialization do not all serve the same purpose as the functions in the template. In many cases these functions implement functionality, rather than just forwarding a call to a protected implementation function.

static const mask* 
classic_table() throw();
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;
const mask* 
table() const throw();
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 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;

See Also

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


©Copyright 1996, Rogue Wave Software, Inc.