| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************* | 2 ******************************************************************************* |
| 3 * Copyright (C) 2013-2014, International Business Machines | 3 * Copyright (C) 2013-2015, International Business Machines |
| 4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
| 5 ******************************************************************************* | 5 ******************************************************************************* |
| 6 * collationfastlatinbuilder.h | 6 * collationfastlatinbuilder.h |
| 7 * | 7 * |
| 8 * created on: 2013aug09 | 8 * created on: 2013aug09 |
| 9 * created by: Markus W. Scherer | 9 * created by: Markus W. Scherer |
| 10 */ | 10 */ |
| 11 | 11 |
| 12 #ifndef __COLLATIONFASTLATINBUILDER_H__ | 12 #ifndef __COLLATIONFASTLATINBUILDER_H__ |
| 13 #define __COLLATIONFASTLATINBUILDER_H__ | 13 #define __COLLATIONFASTLATINBUILDER_H__ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 32 ~CollationFastLatinBuilder(); | 32 ~CollationFastLatinBuilder(); |
| 33 | 33 |
| 34 UBool forData(const CollationData &data, UErrorCode &errorCode); | 34 UBool forData(const CollationData &data, UErrorCode &errorCode); |
| 35 | 35 |
| 36 const uint16_t *getTable() const { | 36 const uint16_t *getTable() const { |
| 37 return reinterpret_cast<const uint16_t *>(result.getBuffer()); | 37 return reinterpret_cast<const uint16_t *>(result.getBuffer()); |
| 38 } | 38 } |
| 39 int32_t lengthOfTable() const { return result.length(); } | 39 int32_t lengthOfTable() const { return result.length(); } |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 // space, punct, symbol, currency (not digit) |
| 43 enum { NUM_SPECIAL_GROUPS = UCOL_REORDER_CODE_CURRENCY - UCOL_REORDER_CODE_F
IRST + 1 }; |
| 44 |
| 42 UBool loadGroups(const CollationData &data, UErrorCode &errorCode); | 45 UBool loadGroups(const CollationData &data, UErrorCode &errorCode); |
| 43 UBool inSameGroup(uint32_t p, uint32_t q) const; | 46 UBool inSameGroup(uint32_t p, uint32_t q) const; |
| 44 | 47 |
| 45 void resetCEs(); | 48 void resetCEs(); |
| 46 void getCEs(const CollationData &data, UErrorCode &errorCode); | 49 void getCEs(const CollationData &data, UErrorCode &errorCode); |
| 47 UBool getCEsFromCE32(const CollationData &data, UChar32 c, uint32_t ce32, | 50 UBool getCEsFromCE32(const CollationData &data, UChar32 c, uint32_t ce32, |
| 48 UErrorCode &errorCode); | 51 UErrorCode &errorCode); |
| 49 UBool getCEsFromContractionCE32(const CollationData &data, uint32_t ce32, | 52 UBool getCEsFromContractionCE32(const CollationData &data, uint32_t ce32, |
| 50 UErrorCode &errorCode); | 53 UErrorCode &errorCode); |
| 51 void addContractionEntry(int32_t x, int64_t cce0, int64_t cce1, UErrorCode &
errorCode); | 54 void addContractionEntry(int32_t x, int64_t cce0, int64_t cce1, UErrorCode &
errorCode); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 66 int64_t ce0, ce1; | 69 int64_t ce0, ce1; |
| 67 | 70 |
| 68 int64_t charCEs[CollationFastLatin::NUM_FAST_CHARS][2]; | 71 int64_t charCEs[CollationFastLatin::NUM_FAST_CHARS][2]; |
| 69 | 72 |
| 70 UVector64 contractionCEs; | 73 UVector64 contractionCEs; |
| 71 UVector64 uniqueCEs; | 74 UVector64 uniqueCEs; |
| 72 | 75 |
| 73 /** One 16-bit mini CE per unique CE. */ | 76 /** One 16-bit mini CE per unique CE. */ |
| 74 uint16_t *miniCEs; | 77 uint16_t *miniCEs; |
| 75 | 78 |
| 76 // These are constant for a given list of CollationData.scripts. | 79 // These are constant for a given root collator. |
| 80 uint32_t lastSpecialPrimaries[NUM_SPECIAL_GROUPS]; |
| 77 uint32_t firstDigitPrimary; | 81 uint32_t firstDigitPrimary; |
| 78 uint32_t firstLatinPrimary; | 82 uint32_t firstLatinPrimary; |
| 79 uint32_t lastLatinPrimary; | 83 uint32_t lastLatinPrimary; |
| 80 // This determines the first normal primary weight which is mapped to | 84 // This determines the first normal primary weight which is mapped to |
| 81 // a short mini primary. It must be >=firstDigitPrimary. | 85 // a short mini primary. It must be >=firstDigitPrimary. |
| 82 uint32_t firstShortPrimary; | 86 uint32_t firstShortPrimary; |
| 83 | 87 |
| 84 UBool shortPrimaryOverflow; | 88 UBool shortPrimaryOverflow; |
| 85 | 89 |
| 86 UnicodeString result; | 90 UnicodeString result; |
| 87 int32_t headerLength; | 91 int32_t headerLength; |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 U_NAMESPACE_END | 94 U_NAMESPACE_END |
| 91 | 95 |
| 92 #endif // !UCONFIG_NO_COLLATION | 96 #endif // !UCONFIG_NO_COLLATION |
| 93 #endif // __COLLATIONFASTLATINBUILDER_H__ | 97 #endif // __COLLATIONFASTLATINBUILDER_H__ |
| OLD | NEW |