IPortableCollation provides portable language-sensitive text string comparison. IPortableCollation is an abstract class derived from ICollation. It provides the protocol for portable language-sensitive text collation. The client calls IPortableCollation::createCollation to instantiate an IPortableCollation object. The provision of a portable text collation is not only for Unicode support for non-multibyte text support platforms. More importantly, it supports portable information sharing between machines for client/server applications.
Constructors & DestructorConstruct and destruct IPortableCollation objects.
![]() |
public:
virtual ~IPortableCollation()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
Constructors for creating a portable collation object.
protected:
IPortableCollation()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
protected:
IPortableCollation(const IPortableCollation& copy)
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
protected:
IPortableCollation(const IText& rules)
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
ANSI Compliant ImplementationOverrides for parent's implementation methods.
![]() |
protected:
virtual int do_compare( const UniChar* sourceLow, const UniChar* sourceHigh, const UniChar* targetLow, const UniChar* targetHigh ) const
The actual comparison algorithm. Returns 1 if the source is greater than the target, 0 if both are equal, and -1 if the source is less than the target.
| IInvalidParameter | If sourceHigh is less than sourceLow, or targetHigh is less than targetLow. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual int do_matchCompare( const UniChar* sourceLow, const UniChar* sourceHigh, const UniChar* targetLow, const UniChar* targetHigh, IText::length_type& matchSourceLen, IText::length_type& matchTargetLen ) const = 0
Returns 1 if the source is greater than the target, 0 if both are equal, and -1 if the source is less than the target.
| IInvalidParameter | If sourceHigh is less than sourceLow, or targetHigh is less than targetLow. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual IText do_transform(const IText& source) const = 0
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Assignment OperatorAssign one IPortableCollation object to another.
![]() |
protected:
IPortableCollation& operator =( const IPortableCollation& that )
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Comparing, Transforming, and HashingCompares, transforms, or hashes text based on this collation.
![]() |
public:
virtual int compare( const UniChar* sourceLow, const UniChar* sourceHigh, const UniChar* targetLow, const UniChar* targetHigh, IText::length_type& matchSourceLen = nlength, IText::length_type& matchTargetLen = nlength ) const
| IInvalidParameter | If sourceHigh is less than sourceLow, or targetHigh is less than targetLow. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
public:
virtual int compare( const IText& source, const IText& target, IText::length_type& matchSourceLen = nlength, IText::length_type& matchTargetLen = nlength ) const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
public:
virtual int compare( const ITextIterator& sourceBegin, const ITextIterator& sourceEnd, const ITextIterator& targetBegin, const ITextIterator& targetEnd, IText::length_type& matchSourceLen = nlength, IText::length_type& matchTargetLen = nlength ) const
| IInvalidParameter | If sourceEnd is less than sourceBegin, or targetEnd is less than targetBegin. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Display NameProvides access to the displayable name.
![]() |
public:
IText displayName( const ILocaleKey& desiredLanguage = ILocaleKey::defaultLocale ( ), ILocaleKey::ELookupStrategy strategy = ILocaleKey::kAnyLanguage ) const
Returns the displayable name of a bitwise collation object. Specify the desired locale and look-up strategy for which the display name is based on. Refer to the ILocaleKey class description for details on look-up strategy.
At the current time IPortableCollation::displayName always returns an IText().
| IOutofSystemResource | If there is no display name for the given collation object. |
| IInvalidRequest | If the desired locale is supported but not installed. |
| IInvalidParameter | If the desired locale ID is invalid. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Instantiation HelperFactory method to create new objects of this class.
![]() |
public:
static IPortableCollation* createCollation( const ILocaleKey& key, ICollation::ECollationStrength strength = kTertiaryDifference )
Returns a pointer to constructed IPortableCollation instance.
At the current time IPortableCollation::createCollation always returns a NULL pointer.
| IInvalidRequestion | If no portable collation object can be found. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
virtual ~ICollation()
int compare(const IText& source, const IText& target) const
int compare( const UniChar* sourceLow, const UniChar* sourceHigh, const UniChar* targetLow, const UniChar* targetHigh ) const
int compare( ITextIterator sourceBegin, ITextIterator sourceEnd, ITextIterator targetBegin, ITextIterator targetEnd ) const
static ICollation* createCollation( const ILocaleKey& localeId = ILocaleKey::defaultLocale ( ), ECollationStrength strength = kTertiaryDifference )
virtual IText displayName( const ILocaleKey& desiredLanguage = ILocaleKey::defaultLocale ( ), ILocaleKey::ELookupStrategy strategy = ILocaleKey::kAnyLanguage ) const = 0
long hash( const UniChar* sourceLow, const UniChar* sourceHigh ) const
long hash(const IText& source) const
long hash( ITextIterator sourceBegin, ITextIterator sourceEnd ) const
virtual bool isEqual( const IText& sourceText, const IText& targetText ) const
virtual bool isGreaterThan( const IText& sourceText, const IText& targetText ) const
virtual bool isLessThan( const IText& sourceText, const IText& targetText ) const
ILocaleKey localeKey() const
void setStrength(ECollationStrength newStrength)
ECollationStrength strength() const
IText transform( ITextIterator sourceBegin, ITextIterator sourceEnd ) const
IText transform(const IText& source) const
UniChar* createUniCharChunk( const IText& source, IText::length_type& chunkLength ) const
virtual int do_compare( const UniChar* sourceLow, const UniChar* sourceHigh, const UniChar* targetLow, const UniChar* targetHigh ) const = 0
virtual long do_hash( const UniChar* sourceLow, const UniChar* sourceHigh ) const
ICollation(const ICollation& source)
ICollation()
ICollation& operator =(const ICollation& that)
void setLocaleKey(const ILocaleKey& newLocale)