SourcePro® 2025.1 |
SourcePro® API Reference Guide |
Stores preprocessed comparison information for a Unicode string to speed repeated string comparisons. More...
#include <rw/i18n/RWUCollationKey.h>
Public Member Functions | |
RWUCollationKey (const RWUCollationKey &original) | |
RWUCollationKey (void) | |
~RWUCollationKey (void) | |
RWUString | getString (void) const |
unsigned | hash () const |
bool | isValid (void) const |
RWUCollationKey & | operator= (const RWUCollationKey &rhs) |
Friends | |
std::strong_ordering | operator<=> (const RWUCollationKey &lhs, const RWUCollationKey &rhs) |
bool | operator== (const RWUCollationKey &lhs, const RWUCollationKey &rhs) |
class | RWUCollator |
RWUCollationKey stores preprocessed comparison information for a Unicode string, and can be used to speed repeated string comparisons. For example, you might choose to use collation keys when sorting a set of strings.
To create a valid RWUCollationKey, call RWUCollator::getCollationKey(). Generating a key is a non-trivial operation, since it involves determining the collation elements and weights for an entire string. Comparing two RWUCollationKey objects, however, is fast.
Program output:
|
inline |
Default constructor. Creates an invalid key.
Invalid keys are equal to each other, and not equal to any other key. They are less than all other keys. Calling getString() on an invalid key results in an RWUException.
This constructor exists only as a convenience–for example, when creating an array of RWUCollationKey objects. To create a valid, usable RWUCollationKey, call RWUCollator::getCollationKey().
RWUCollationKey::RWUCollationKey | ( | const RWUCollationKey & | original | ) |
Copy constructor. Makes self a deep copy of original.
|
inline |
Destructor.
RWUString RWUCollationKey::getString | ( | void | ) | const |
Returns the string whose collation value self holds. Throws RWUException if self is an invalid key.
|
inline |
Returns a hash value for self.
|
inline |
Returns true
if self is a valid key. Otherwise, returns false
.
RWUCollationKey & RWUCollationKey::operator= | ( | const RWUCollationKey & | rhs | ) |
Assignment operator. Makes self a deep copy of rhs.
|
friend |
Performs a comparison of the collation keys represented by lhs to rhs.
|
friend |
Returns true
if lhs compares equal to rhs. Otherwise, returns false
.
Copyright © 2025 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |