Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

collate, collate_byname


collate_bynamecollatelocale::facet

Summary

A string collation, comparison, and hashing facet.

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

Synopsis

#include <locale>
template <class charT> class collate;
template <class charT> class collate_byname;

Description

The collate and collate_byname facets allow for string collation, comparison, and hashing. Use the collate facet for the "C" locale, and use the collate_byname for named locales.

Interface

Types

char_type
string_type

Constructors

explicit collate(size_t refs = 0) 
explicit collate_byname(const char* name, size_t refs = 0); 

Destructors

~collate();  // virtual and protected
~collate_byname();  // virtual and protected

Facet ID

static locale::id id; 

Public Member Functions

The public members of the collate 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 long version of the public compare function simply calls its protected cousin do_compare.

int 
compare(const charT* low1, const charT* high1,
        const charT* low2, const charT* high2) const; 
long 
hash(const charT* low, const charT* high) const; 
string_type 
transform(const charT* low, const charT* high) const; 

Protected Member Functions

virtual int    
do_compare(const charT* low1, const charT* high1,
           const charT* low2, const charT* high2) const; 
virtual long   
do_hash( const charT* low, const charT* high) 
virtual string_type 
do_transform(const charT* low, const charT* high) const; 

Example

See Also

locale, facets, ctype



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