ICU 4.8.1.1
4.8.1.1
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
i18n
unicode
sortkey.h
Go to the documentation of this file.
1
/*
2
*****************************************************************************
3
* Copyright (C) 1996-2011, International Business Machines Corporation and others.
4
* All Rights Reserved.
5
*****************************************************************************
6
*
7
* File sortkey.h
8
*
9
* Created by: Helena Shih
10
*
11
* Modification History:
12
*
13
* Date Name Description
14
*
15
* 6/20/97 helena Java class name change.
16
* 8/18/97 helena Added internal API documentation.
17
* 6/26/98 erm Changed to use byte arrays and memcmp.
18
*****************************************************************************
19
*/
20
21
#ifndef SORTKEY_H
22
#define SORTKEY_H
23
24
#include "
unicode/utypes.h
"
25
31
#if !UCONFIG_NO_COLLATION
32
33
#include "
unicode/uobject.h
"
34
#include "
unicode/unistr.h
"
35
#include "
unicode/coll.h
"
36
37
U_NAMESPACE_BEGIN
38
39
/* forward declaration */
40
class
RuleBasedCollator
;
41
96
class
U_I18N_API
CollationKey
:
public
UObject
{
97
public
:
105
CollationKey
();
106
107
114
CollationKey
(
const
uint8_t* values,
115
int32_t count);
116
122
CollationKey
(
const
CollationKey
& other);
123
128
virtual
~
CollationKey
();
129
135
const
CollationKey
& operator=(
const
CollationKey
& other);
136
143
UBool
operator==
(
const
CollationKey
& source)
const
;
144
151
UBool
operator!=
(
const
CollationKey
& source)
const
;
152
153
160
UBool
isBogus(
void
)
const
;
161
171
const
uint8_t* getByteArray(int32_t& count)
const
;
172
173
#ifdef U_USE_COLLATION_KEY_DEPRECATES
174
181
uint8_t* toByteArray(int32_t& count)
const
;
182
#endif
183
193
Collator::EComparisonResult
compareTo(
const
CollationKey
& target)
const
;
194
205
UCollationResult
compareTo(
const
CollationKey
& target,
UErrorCode
&status)
const
;
206
227
int32_t hashCode(
void
)
const
;
228
233
virtual
UClassID
getDynamicClassID
()
const
;
234
239
static
UClassID
U_EXPORT2
getStaticClassID();
240
241
private
:
250
void
adopt(uint8_t *values, int32_t capacity, int32_t count);
254
void
setLength(int32_t newLength);
255
256
/*
257
* Creates a collation key with a string.
258
*/
259
266
CollationKey
& ensureCapacity(int32_t newSize);
271
CollationKey
& setToBogus(
void
);
276
CollationKey
& reset(
void
);
277
281
friend
class
RuleBasedCollator
;
285
UBool
fBogus;
290
int32_t fCount;
294
int32_t fCapacity;
298
int32_t fHashCode;
302
uint8_t* fBytes;
303
304
};
305
306
inline
UBool
307
CollationKey::operator!=
(
const
CollationKey
& other)
const
308
{
309
return
!(*
this
== other);
310
}
311
312
inline
UBool
313
CollationKey::isBogus
()
const
314
{
315
return
fBogus;
316
}
317
318
inline
const
uint8_t*
319
CollationKey::getByteArray
(int32_t &count)
const
320
{
321
count = fCount;
322
return
fBytes;
323
}
324
325
U_NAMESPACE_END
326
327
#endif
/* #if !UCONFIG_NO_COLLATION */
328
329
#endif
Generated by
1.8.1.1