1999-12-28 23:57:50 +00:00
|
|
|
|
/*
|
2001-02-20 00:26:50 +00:00
|
|
|
|
******************************************************************************
|
2001-03-21 20:31:13 +00:00
|
|
|
|
* Copyright (C) 1997-2001, International Business Machines
|
1999-12-28 23:57:50 +00:00
|
|
|
|
* Corporation and others. All Rights Reserved.
|
2001-02-20 00:26:50 +00:00
|
|
|
|
******************************************************************************
|
1999-12-28 23:57:50 +00:00
|
|
|
|
*/
|
2001-01-18 00:22:38 +00:00
|
|
|
|
|
2001-01-30 18:52:58 +00:00
|
|
|
|
/**
|
|
|
|
|
* File coleitr.h
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Created by: Helena Shih
|
|
|
|
|
*
|
|
|
|
|
* Modification History:
|
|
|
|
|
*
|
2001-02-20 00:26:50 +00:00
|
|
|
|
* Date Name Description
|
2001-01-30 18:52:58 +00:00
|
|
|
|
*
|
2001-02-20 00:26:50 +00:00
|
|
|
|
* 8/18/97 helena Added internal API documentation.
|
|
|
|
|
* 08/03/98 erm Synched with 1.2 version CollationElementIterator.java
|
|
|
|
|
* 12/10/99 aliu Ported Thai collation support from Java.
|
|
|
|
|
* 01/25/01 swquek Modified into a C++ wrapper calling C APIs (ucoliter.h)
|
|
|
|
|
* 02/19/01 swquek Removed CollationElementsIterator() since it is
|
|
|
|
|
* private constructor and no calls are made to it
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
|
|
|
|
#ifndef COLEITR_H
|
|
|
|
|
#define COLEITR_H
|
|
|
|
|
|
2002-06-27 01:19:20 +00:00
|
|
|
|
#include "unicode/utypes.h"
|
2002-09-20 01:54:48 +00:00
|
|
|
|
|
|
|
|
|
#if !UCONFIG_NO_COLLATION
|
|
|
|
|
|
2002-06-27 01:19:20 +00:00
|
|
|
|
#include "unicode/uobject.h"
|
1999-12-28 23:57:50 +00:00
|
|
|
|
#include "unicode/tblcoll.h"
|
2001-02-20 00:26:50 +00:00
|
|
|
|
#include "unicode/ucoleitr.h"
|
|
|
|
|
|
2002-12-17 23:37:09 +00:00
|
|
|
|
/**
|
|
|
|
|
* The UCollationElements struct.
|
|
|
|
|
* For usage in C programs.
|
|
|
|
|
* @stable ICU 2.0
|
|
|
|
|
*/
|
2001-02-20 00:26:50 +00:00
|
|
|
|
typedef struct UCollationElements UCollationElements;
|
|
|
|
|
|
2001-10-08 23:26:58 +00:00
|
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
|
/**
|
2001-01-18 00:22:38 +00:00
|
|
|
|
* The CollationElementIterator class is used as an iterator to walk through
|
|
|
|
|
* each character of an international string. Use the iterator to return the
|
|
|
|
|
* ordering priority of the positioned character. The ordering priority of a
|
|
|
|
|
* character, which we refer to as a key, defines how a character is collated in
|
|
|
|
|
* the given collation object.
|
|
|
|
|
* For example, consider the following in Spanish:
|
|
|
|
|
* <pre>
|
|
|
|
|
* \code
|
|
|
|
|
* "ca" -> the first key is key('c') and second key is key('a').
|
|
|
|
|
* "cha" -> the first key is key('ch') and second key is key('a').
|
|
|
|
|
* \endcode
|
|
|
|
|
* </pre>
|
|
|
|
|
* And in German,
|
|
|
|
|
* <pre>
|
|
|
|
|
* \code
|
|
|
|
|
* "<EFBFBD>b"-> the first key is key('a'), the second key is key('e'), and
|
|
|
|
|
* the third key is key('b').
|
2000-12-08 18:46:55 +00:00
|
|
|
|
* \endcode
|
2001-01-18 00:22:38 +00:00
|
|
|
|
* </pre>
|
|
|
|
|
* The key of a character, is an integer composed of primary order(short),
|
|
|
|
|
* secondary order(char), and tertiary order(char). Java strictly defines the
|
|
|
|
|
* size and signedness of its primitive data types. Therefore, the static
|
|
|
|
|
* functions primaryOrder(), secondaryOrder(), and tertiaryOrder() return
|
|
|
|
|
* int32_t to ensure the correctness of the key value.
|
|
|
|
|
* <p>Example of the iterator usage: (without error checking)
|
|
|
|
|
* <pre>
|
|
|
|
|
* \code
|
|
|
|
|
* void CollationElementIterator_Example()
|
|
|
|
|
* {
|
|
|
|
|
* UnicodeString str = "This is a test";
|
|
|
|
|
* UErrorCode success = U_ZERO_ERROR;
|
|
|
|
|
* RuleBasedCollator* rbc =
|
|
|
|
|
* (RuleBasedCollator*) RuleBasedCollator::createInstance(success);
|
|
|
|
|
* CollationElementIterator* c =
|
|
|
|
|
* rbc->createCollationElementIterator( str );
|
|
|
|
|
* int32_t order = c->next(success);
|
2001-02-23 23:34:34 +00:00
|
|
|
|
* c->reset();
|
|
|
|
|
* order = c->previous(success);
|
2001-01-18 00:22:38 +00:00
|
|
|
|
* delete c;
|
|
|
|
|
* delete rbc;
|
|
|
|
|
* }
|
|
|
|
|
* \endcode
|
|
|
|
|
* </pre>
|
|
|
|
|
* <p>
|
|
|
|
|
* CollationElementIterator::next returns the collation order of the next
|
2001-02-23 23:34:34 +00:00
|
|
|
|
* character based on the comparison level of the collator.
|
|
|
|
|
* CollationElementIterator::previous returns the collation order of the
|
|
|
|
|
* previous character based on the comparison level of the collator.
|
|
|
|
|
* The Collation Element Iterator moves only in one direction between calls to
|
|
|
|
|
* CollationElementIterator::reset. That is, CollationElementIterator::next()
|
|
|
|
|
* and CollationElementIterator::previous can not be inter-used. Whenever
|
|
|
|
|
* CollationElementIterator::previous is to be called after
|
|
|
|
|
* CollationElementIterator::next() or vice versa,
|
|
|
|
|
* CollationElementIterator::reset has to be called first to reset the status,
|
|
|
|
|
* shifting pointers to either the end or the start of the string. Hence at the
|
|
|
|
|
* next call of CollationElementIterator::previous or
|
|
|
|
|
* CollationElementIterator::next(), the first or last collation order will be
|
|
|
|
|
* returned.
|
|
|
|
|
* If a change of direction is done without a CollationElementIterator::reset(),
|
|
|
|
|
* the result is undefined.
|
|
|
|
|
* The result of a forward iterate (CollationElementIterator::next) and
|
|
|
|
|
* reversed result of the backward iterate (CollationElementIterator::previous)
|
|
|
|
|
* on the same string are equivalent, if collation orders with the value
|
|
|
|
|
* UCOL_IGNORABLE are ignored.
|
|
|
|
|
* Character based on the comparison level of the collator. A collation order
|
|
|
|
|
* consists of primary order, secondary order and tertiary order. The data
|
|
|
|
|
* type of the collation order is <strong>t_int32</strong>.
|
|
|
|
|
*
|
2001-01-18 00:22:38 +00:00
|
|
|
|
* Note, CollationElementIterator should not be subclassed.
|
|
|
|
|
* @see Collator
|
|
|
|
|
* @see RuleBasedCollator
|
|
|
|
|
* @version 1.8 Jan 16 2001
|
|
|
|
|
*/
|
2002-06-27 01:19:20 +00:00
|
|
|
|
class U_I18N_API CollationElementIterator : public UObject {
|
2000-08-14 23:23:20 +00:00
|
|
|
|
public:
|
2001-01-18 00:22:38 +00:00
|
|
|
|
|
|
|
|
|
// CollationElementIterator public data member ------------------------------
|
|
|
|
|
|
|
|
|
|
/**
|
2001-02-21 01:58:55 +00:00
|
|
|
|
* NULLORDER indicates that an error has occured while processing
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
2001-02-21 01:58:55 +00:00
|
|
|
|
static int32_t const NULLORDER;
|
|
|
|
|
|
2001-01-18 00:22:38 +00:00
|
|
|
|
// CollationElementIterator public constructor/destructor -------------------
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Copy constructor.
|
2002-07-01 11:04:45 +00:00
|
|
|
|
*
|
|
|
|
|
* @param other the object to be copied from
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
CollationElementIterator(const CollationElementIterator& other);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destructor
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
~CollationElementIterator();
|
|
|
|
|
|
|
|
|
|
// CollationElementIterator public methods ----------------------------------
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if "other" is the same as "this"
|
2002-07-01 11:04:45 +00:00
|
|
|
|
*
|
|
|
|
|
* @param other the object to be compared
|
|
|
|
|
* @return true if "other" is the same as "this"
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
UBool operator==(const CollationElementIterator& other) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if "other" is not the same as "this".
|
2002-07-01 11:04:45 +00:00
|
|
|
|
*
|
|
|
|
|
* @param other the object to be compared
|
|
|
|
|
* @return true if "other" is not the same as "this"
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
UBool operator!=(const CollationElementIterator& other) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Resets the cursor to the beginning of the string.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
void reset(void);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the ordering priority of the next character in the string.
|
|
|
|
|
* @param status the error code status.
|
2001-02-21 01:58:55 +00:00
|
|
|
|
* @return the next character's ordering. otherwise returns NULLORDER if an
|
2001-02-22 23:16:06 +00:00
|
|
|
|
* error has occured or if the end of string has been reached
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
int32_t next(UErrorCode& status);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the ordering priority of the previous collation element in the string.
|
|
|
|
|
* @param status the error code status.
|
2001-02-21 01:58:55 +00:00
|
|
|
|
* @return the previous element's ordering. otherwise returns NULLORDER if an
|
2001-02-22 23:16:06 +00:00
|
|
|
|
* error has occured or if the start of string has been reached
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
int32_t previous(UErrorCode& status);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the primary order of a collation order.
|
|
|
|
|
* @param order the collation order
|
|
|
|
|
* @return the primary order of a collation order.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
static int32_t primaryOrder(int32_t order);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the secondary order of a collation order.
|
|
|
|
|
* @param order the collation order
|
|
|
|
|
* @return the secondary order of a collation order.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
static int32_t secondaryOrder(int32_t order);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the tertiary order of a collation order.
|
|
|
|
|
* @param order the collation order
|
|
|
|
|
* @return the tertiary order of a collation order.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
static int32_t tertiaryOrder(int32_t order);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return the maximum length of any expansion sequences that end with the
|
|
|
|
|
* specified comparison order.
|
|
|
|
|
* @param order a collation order returned by previous or next.
|
2001-03-03 04:06:43 +00:00
|
|
|
|
* @return maximum size of the expansion sequences ending with the collation
|
|
|
|
|
* element or 1 if collation element does not occur at the end of any
|
|
|
|
|
* expansion sequence
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
int32_t getMaxExpansion(int32_t order) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the comparison order in the desired strength. Ignore the other
|
|
|
|
|
* differences.
|
|
|
|
|
* @param order The order value
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
int32_t strengthOrder(int32_t order) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the source string.
|
|
|
|
|
* @param str the source string.
|
|
|
|
|
* @param status the error code status.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
void setText(const UnicodeString& str, UErrorCode& status);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the source string.
|
|
|
|
|
* @param str the source character iterator.
|
|
|
|
|
* @param status the error code status.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
void setText(CharacterIterator& str, UErrorCode& status);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Checks if a comparison order is ignorable.
|
|
|
|
|
* @param order the collation order.
|
|
|
|
|
* @return TRUE if a character is ignorable, FALSE otherwise.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
static UBool isIgnorable(int32_t order);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets the offset of the currently processed character in the source string.
|
|
|
|
|
* @return the offset of the character.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
2002-03-12 01:32:42 +00:00
|
|
|
|
int32_t getOffset(void) const;
|
2001-01-18 00:22:38 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the offset of the currently processed character in the source string.
|
|
|
|
|
* @param newOffset the new offset.
|
|
|
|
|
* @param status the error code status.
|
|
|
|
|
* @return the offset of the character.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
2002-03-12 01:32:42 +00:00
|
|
|
|
void setOffset(int32_t newOffset, UErrorCode& status);
|
2001-01-18 00:22:38 +00:00
|
|
|
|
|
2002-06-29 00:04:16 +00:00
|
|
|
|
/**
|
|
|
|
|
* ICU "poor man's RTTI", returns a UClassID for the actual class.
|
|
|
|
|
*
|
|
|
|
|
* @draft ICU 2.2
|
|
|
|
|
*/
|
2003-02-06 22:03:58 +00:00
|
|
|
|
virtual inline UClassID getDynamicClassID() const;
|
2002-06-29 00:04:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ICU "poor man's RTTI", returns a UClassID for this class.
|
|
|
|
|
*
|
|
|
|
|
* @draft ICU 2.2
|
|
|
|
|
*/
|
2003-02-06 22:03:58 +00:00
|
|
|
|
static inline UClassID getStaticClassID();
|
2002-06-29 00:04:16 +00:00
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
|
protected:
|
2001-01-18 00:22:38 +00:00
|
|
|
|
|
|
|
|
|
// CollationElementIterator protected constructors --------------------------
|
2002-08-09 22:37:04 +00:00
|
|
|
|
/**
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2002-08-09 22:37:04 +00:00
|
|
|
|
*/
|
2001-03-01 23:12:34 +00:00
|
|
|
|
friend class RuleBasedCollator;
|
2001-02-20 00:26:50 +00:00
|
|
|
|
|
2001-01-18 00:22:38 +00:00
|
|
|
|
/**
|
|
|
|
|
* CollationElementIterator constructor. This takes the source string and the
|
|
|
|
|
* collation object. The cursor will walk thru the source string based on the
|
|
|
|
|
* predefined collation rules. If the source string is empty, NULLORDER will
|
|
|
|
|
* be returned on the calls to next().
|
2002-07-01 11:04:45 +00:00
|
|
|
|
* @param sourceText the source string.
|
|
|
|
|
* @param order the collation object.
|
|
|
|
|
* @param status the error code status.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
CollationElementIterator(const UnicodeString& sourceText,
|
|
|
|
|
const RuleBasedCollator* order, UErrorCode& status);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* CollationElementIterator constructor. This takes the source string and the
|
|
|
|
|
* collation object. The cursor will walk thru the source string based on the
|
|
|
|
|
* predefined collation rules. If the source string is empty, NULLORDER will
|
|
|
|
|
* be returned on the calls to next().
|
2002-07-01 11:04:45 +00:00
|
|
|
|
* @param sourceText the source string.
|
|
|
|
|
* @param order the collation object.
|
|
|
|
|
* @param status the error code status.
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
CollationElementIterator(const CharacterIterator& sourceText,
|
|
|
|
|
const RuleBasedCollator* order, UErrorCode& status);
|
|
|
|
|
|
|
|
|
|
// CollationElementIterator protected methods -------------------------------
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Assignment operator
|
2002-07-01 11:04:45 +00:00
|
|
|
|
*
|
|
|
|
|
* @param other the object to be copied
|
2002-12-04 23:46:16 +00:00
|
|
|
|
* @stable ICU 2.0
|
2001-01-18 00:22:38 +00:00
|
|
|
|
*/
|
|
|
|
|
const CollationElementIterator&
|
|
|
|
|
operator=(const CollationElementIterator& other);
|
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
|
private:
|
2001-01-18 00:22:38 +00:00
|
|
|
|
|
|
|
|
|
// CollationElementIterator private data members ----------------------------
|
|
|
|
|
|
2001-02-20 00:26:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* Data wrapper for collation elements
|
|
|
|
|
*/
|
|
|
|
|
UCollationElements *m_data_;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Indicates if m_data_ belongs to this object.
|
|
|
|
|
*/
|
|
|
|
|
UBool isDataOwned_;
|
2002-06-29 00:04:16 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The address of this static class variable serves as this class's ID
|
|
|
|
|
* for ICU "poor man's RTTI".
|
|
|
|
|
*/
|
|
|
|
|
static const char fgClassID;
|
1999-12-28 23:57:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
2001-01-18 00:22:38 +00:00
|
|
|
|
// CollationElementIterator inline method defination --------------------------
|
1999-12-28 23:57:50 +00:00
|
|
|
|
|
2003-02-06 22:03:58 +00:00
|
|
|
|
inline UClassID
|
|
|
|
|
CollationElementIterator::getStaticClassID()
|
|
|
|
|
{ return (UClassID)&fgClassID; }
|
|
|
|
|
|
|
|
|
|
inline UClassID
|
|
|
|
|
CollationElementIterator::getDynamicClassID() const
|
|
|
|
|
{ return CollationElementIterator::getStaticClassID(); }
|
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
|
/**
|
2001-01-18 00:22:38 +00:00
|
|
|
|
* Get the primary order of a collation order.
|
|
|
|
|
* @param order the collation order
|
|
|
|
|
* @return the primary order of a collation order.
|
|
|
|
|
*/
|
|
|
|
|
inline int32_t CollationElementIterator::primaryOrder(int32_t order)
|
1999-12-28 23:57:50 +00:00
|
|
|
|
{
|
2001-01-18 00:22:38 +00:00
|
|
|
|
order &= RuleBasedCollator::PRIMARYORDERMASK;
|
|
|
|
|
return (order >> RuleBasedCollator::PRIMARYORDERSHIFT);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
}
|
2001-01-18 00:22:38 +00:00
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
|
/**
|
2001-01-18 00:22:38 +00:00
|
|
|
|
* Get the secondary order of a collation order.
|
|
|
|
|
* @param order the collation order
|
|
|
|
|
* @return the secondary order of a collation order.
|
|
|
|
|
*/
|
|
|
|
|
inline int32_t CollationElementIterator::secondaryOrder(int32_t order)
|
1999-12-28 23:57:50 +00:00
|
|
|
|
{
|
2001-01-18 00:22:38 +00:00
|
|
|
|
order = order & RuleBasedCollator::SECONDARYORDERMASK;
|
|
|
|
|
return (order >> RuleBasedCollator::SECONDARYORDERSHIFT);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
}
|
2001-01-18 00:22:38 +00:00
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
|
/**
|
2001-01-18 00:22:38 +00:00
|
|
|
|
* Get the tertiary order of a collation order.
|
|
|
|
|
* @param order the collation order
|
|
|
|
|
* @return the tertiary order of a collation order.
|
|
|
|
|
*/
|
|
|
|
|
inline int32_t CollationElementIterator::tertiaryOrder(int32_t order)
|
1999-12-28 23:57:50 +00:00
|
|
|
|
{
|
2001-01-18 00:22:38 +00:00
|
|
|
|
return (order &= RuleBasedCollator::TERTIARYORDERMASK);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 00:22:38 +00:00
|
|
|
|
inline int32_t CollationElementIterator::getMaxExpansion(int32_t order) const
|
1999-12-28 23:57:50 +00:00
|
|
|
|
{
|
2001-03-15 22:56:24 +00:00
|
|
|
|
return ucol_getMaxExpansion(m_data_, (uint32_t)order);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-01-18 00:22:38 +00:00
|
|
|
|
inline UBool CollationElementIterator::isIgnorable(int32_t order)
|
1999-12-28 23:57:50 +00:00
|
|
|
|
{
|
2001-01-18 00:22:38 +00:00
|
|
|
|
return (primaryOrder(order) == RuleBasedCollator::PRIMIGNORABLE);
|
1999-12-28 23:57:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-08 23:26:58 +00:00
|
|
|
|
U_NAMESPACE_END
|
|
|
|
|
|
2002-09-20 01:54:48 +00:00
|
|
|
|
#endif /* #if !UCONFIG_NO_COLLATION */
|
|
|
|
|
|
1999-12-28 23:57:50 +00:00
|
|
|
|
#endif
|