Class Collation.

Inherits Garbage. Inherited by AsciiCasemap, AsciiNumeric and Octet.

This abstract base class represents an RFC 4790 Collation.

"A collation is a named function which takes two arbitrary length strings as input and can be used to perform one or more of three basic comparison operations: equality test, substring match, and ordering test."

Collation::Collation()

Creates a new Collation.

Reimplements Garbage::Garbage().

int Collation::compare( const UString & a, const UString & b ) const

= 0; Returns 0 if a and b are equal; and -1 if a is smaller, or 1 if a is greater, than b.

bool Collation::contains( const UString & a, const UString & b ) const

= 0; Returns true if a contains b, i.e. if b is a substring of a, and false otherwise.

static Collation * Collation::create( const UString & s )

Returns a pointer to a newly-created Collation object corresponding to s, or 0 if no such collation is recognised.

bool Collation::equals( const UString & a, const UString & b ) const

= 0; Returns true if a and b are equal according to this Collation, and false otherwise.

static EStringList * Collation::supported()

Returns a list of all collations implementated. The list is allocated for the purpose and may be changed by the caller. The names are sorted alphabetically.

bool Collation::valid( const UString & s ) const

= 0; Returns true if s is valid input to this Collation, and false otherwise.

Collation::~Collation()

Boilerplate virtual destructor.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.