Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

collate, collate_byname

Library:  Localization


collate_byname collate locale::facet

Local Index

Members

Summary

A string collation, comparison, and hashing facet.

Synopsis

#include <locale>

namespace std {
  template <class charT> class collate;
  template <class charT> class collate_byname;
}

Specializations

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 facet for named locales.

Interface

Member Types

char_type
string_type

Constructors

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

Destructors

virtual ~collate(); 
virtual ~collate_byname();

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() calls the corresponding virtual protected member do_xxx(). For instance, the public member function compare() 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) const; 
virtual string_type 
do_transform(const charT* low, const charT* high) const; 

Example

See Also

locale, Facets, ctype

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 22.2.4



Previous fileTop of DocumentContentsIndex pageNext file