31 #if !UCONFIG_NO_COLLATION
41 class CollationKeyByteSink;
161 UBool isBogus(
void)
const;
172 const uint8_t* getByteArray(int32_t& count)
const;
174 #ifdef U_USE_COLLATION_KEY_DEPRECATES
182 uint8_t* toByteArray(int32_t& count)
const;
185 #ifndef U_HIDE_DEPRECATED_API
250 uint8_t *reallocate(int32_t newCapacity, int32_t length);
254 void setLength(int32_t newLength);
256 uint8_t *getBytes() {
257 return (fFlagAndLength >= 0) ? fUnion.fStackBuffer : fUnion.fFields.fBytes;
259 const uint8_t *getBytes()
const {
260 return (fFlagAndLength >= 0) ? fUnion.fStackBuffer : fUnion.fFields.fBytes;
262 int32_t getCapacity()
const {
263 return (fFlagAndLength >= 0) ? (int32_t)
sizeof(fUnion) : fUnion.fFields.fCapacity;
265 int32_t getLength()
const {
return fFlagAndLength & 0x7fffffff; }
282 friend class CollationKeyByteSink;
295 int32_t fFlagAndLength;
300 mutable int32_t fHashCode;
305 union StackBufferOrFields {
307 uint8_t fStackBuffer[32];
318 return !(*
this == other);
324 return fHashCode == 2;
327 inline const uint8_t*
Collation keys are generated by the Collator class.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
int32_t hashCode(void) const
Creates an integer that is unique to the collation key.
CollationKey()
This creates an empty collation key based on the null string.
const CollationKey & operator=(const CollationKey &other)
Assignment operator.
virtual ~CollationKey()
Sort key destructor.
UCollationResult compareTo(const CollationKey &target, UErrorCode &status) const
Convenience method which does a string(bit-wise) comparison of the two collation keys.
CollationKey(const CollationKey &other)
Copy constructor.
Collator::EComparisonResult compareTo(const CollationKey &target) const
Convenience method which does a string(bit-wise) comparison of the two collation keys.
UBool operator==(const CollationKey &source) const
Compare if two collation keys are the same.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
const uint8_t * getByteArray(int32_t &count) const
Returns a pointer to the collation key values.
UBool isBogus(void) const
Test to see if the key is in an invalid state.
UBool operator!=(const CollationKey &source) const
Compare if two collation keys are not the same.
CollationKey(const uint8_t *values, int32_t count)
Creates a collation key based on the collation key values.
EComparisonResult
LESS is returned if source string is compared to be less than target string in the compare() method.
The RuleBasedCollator class provides the implementation of Collator, using data-driven tables.
UObject is the common ICU "boilerplate" class.
C++ API: Collation Service.
UBool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
UCollationResult
UCOL_LESS is returned if source string is compared to be less than target string in the ucol_strcoll(...
int8_t UBool
The ICU boolean type.
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.