| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************* | 2 ******************************************************************************* |
| 3 * Copyright (c) 1996-2014, International Business Machines Corporation and other
s. | 3 * Copyright (c) 1996-2015, International Business Machines Corporation and other
s. |
| 4 * All Rights Reserved. | 4 * All Rights Reserved. |
| 5 ******************************************************************************* | 5 ******************************************************************************* |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef UCOL_H | 8 #ifndef UCOL_H |
| 9 #define UCOL_H | 9 #define UCOL_H |
| 10 | 10 |
| 11 #include "unicode/utypes.h" | 11 #include "unicode/utypes.h" |
| 12 | 12 |
| 13 #if !UCONFIG_NO_COLLATION | 13 #if !UCONFIG_NO_COLLATION |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 U_STABLE void U_EXPORT2 | 678 U_STABLE void U_EXPORT2 |
| 679 ucol_setStrength(UCollator *coll, | 679 ucol_setStrength(UCollator *coll, |
| 680 UCollationStrength strength); | 680 UCollationStrength strength); |
| 681 | 681 |
| 682 /** | 682 /** |
| 683 * Retrieves the reordering codes for this collator. | 683 * Retrieves the reordering codes for this collator. |
| 684 * These reordering codes are a combination of UScript codes and UColReorderCode
entries. | 684 * These reordering codes are a combination of UScript codes and UColReorderCode
entries. |
| 685 * @param coll The UCollator to query. | 685 * @param coll The UCollator to query. |
| 686 * @param dest The array to fill with the script ordering. | 686 * @param dest The array to fill with the script ordering. |
| 687 * @param destCapacity The length of dest. If it is 0, then dest may be NULL and
the function | 687 * @param destCapacity The length of dest. If it is 0, then dest may be NULL and
the function |
| 688 * will only return the length of the result without writing any of the result s
tring (pre-flighting). | 688 * will only return the length of the result without writing any codes (pre-flig
hting). |
| 689 * @param pErrorCode Must be a valid pointer to an error code value, which must
not indicate a | 689 * @param pErrorCode Must be a valid pointer to an error code value, which must
not indicate a |
| 690 * failure before the function call. | 690 * failure before the function call. |
| 691 * @return The number of reordering codes written to the dest array. | 691 * @return The number of reordering codes written to the dest array. |
| 692 * @see ucol_setReorderCodes | 692 * @see ucol_setReorderCodes |
| 693 * @see ucol_getEquivalentReorderCodes | 693 * @see ucol_getEquivalentReorderCodes |
| 694 * @see UScriptCode | 694 * @see UScriptCode |
| 695 * @see UColReorderCode | 695 * @see UColReorderCode |
| 696 * @stable ICU 4.8 | 696 * @stable ICU 4.8 |
| 697 */ | 697 */ |
| 698 U_STABLE int32_t U_EXPORT2 | 698 U_STABLE int32_t U_EXPORT2 |
| 699 ucol_getReorderCodes(const UCollator* coll, | 699 ucol_getReorderCodes(const UCollator* coll, |
| 700 int32_t* dest, | 700 int32_t* dest, |
| 701 int32_t destCapacity, | 701 int32_t destCapacity, |
| 702 UErrorCode *pErrorCode); | 702 UErrorCode *pErrorCode); |
| 703 /** | 703 /** |
| 704 * Sets the reordering codes for this collator. | 704 * Sets the reordering codes for this collator. |
| 705 * Collation reordering allows scripts and some other defined blocks of characte
rs | 705 * Collation reordering allows scripts and some other groups of characters |
| 706 * to be moved relative to each other as a block. This reordering is done on top
of | 706 * to be moved relative to each other. This reordering is done on top of |
| 707 * the DUCET/CLDR standard collation order. Reordering can specify groups to be
placed | 707 * the DUCET/CLDR standard collation order. Reordering can specify groups to be
placed |
| 708 * at the start and/or the end of the collation order. These groups are specifie
d using | 708 * at the start and/or the end of the collation order. These groups are specifie
d using |
| 709 * UScript codes and UColReorderCode entries. | 709 * UScript codes and UColReorderCode entries. |
| 710 * |
| 710 * <p>By default, reordering codes specified for the start of the order are plac
ed in the | 711 * <p>By default, reordering codes specified for the start of the order are plac
ed in the |
| 711 * order given after a group of "special" non-script blocks. These special group
s of characters | 712 * order given after several special non-script blocks. These special groups of
characters |
| 712 * are space, punctuation, symbol, currency, and digit. These special groups are
represented with | 713 * are space, punctuation, symbol, currency, and digit. These special groups are
represented with |
| 713 * UColReorderCode entries. Script groups can be intermingled with | 714 * UColReorderCode entries. Script groups can be intermingled with |
| 714 * these special non-script blocks if those special blocks are explicitly specif
ied in the reordering. | 715 * these special non-script groups if those special groups are explicitly specif
ied in the reordering. |
| 716 * |
| 715 * <p>The special code OTHERS stands for any script that is not explicitly | 717 * <p>The special code OTHERS stands for any script that is not explicitly |
| 716 * mentioned in the list of reordering codes given. Anything that is after OTHER
S | 718 * mentioned in the list of reordering codes given. Anything that is after OTHER
S |
| 717 * will go at the very end of the reordering in the order given. | 719 * will go at the very end of the reordering in the order given. |
| 720 * |
| 718 * <p>The special reorder code DEFAULT will reset the reordering for this collat
or | 721 * <p>The special reorder code DEFAULT will reset the reordering for this collat
or |
| 719 * to the default for this collator. The default reordering may be the DUCET/CLD
R order or may be a reordering that | 722 * to the default for this collator. The default reordering may be the DUCET/CLD
R order or may be a reordering that |
| 720 * was specified when this collator was created from resource data or from rules
. The | 723 * was specified when this collator was created from resource data or from rules
. The |
| 721 * DEFAULT code <b>must</b> be the sole code supplied when it used. If not | 724 * DEFAULT code <b>must</b> be the sole code supplied when it is used. |
| 722 * that will result in a U_ILLEGAL_ARGUMENT_ERROR being set. | 725 * If not, then U_ILLEGAL_ARGUMENT_ERROR will be set. |
| 726 * |
| 723 * <p>The special reorder code NONE will remove any reordering for this collator
. | 727 * <p>The special reorder code NONE will remove any reordering for this collator
. |
| 724 * The result of setting no reordering will be to have the DUCET/CLDR ordering u
sed. The | 728 * The result of setting no reordering will be to have the DUCET/CLDR ordering u
sed. The |
| 725 * NONE code <b>must</b> be the sole code supplied when it used. | 729 * NONE code <b>must</b> be the sole code supplied when it is used. |
| 730 * |
| 726 * @param coll The UCollator to set. | 731 * @param coll The UCollator to set. |
| 727 * @param reorderCodes An array of script codes in the new order. This can be NU
LL if the | 732 * @param reorderCodes An array of script codes in the new order. This can be NU
LL if the |
| 728 * length is also set to 0. An empty array will clear any reordering codes on th
e collator. | 733 * length is also set to 0. An empty array will clear any reordering codes on th
e collator. |
| 729 * @param reorderCodesLength The length of reorderCodes. | 734 * @param reorderCodesLength The length of reorderCodes. |
| 730 * @param pErrorCode Must be a valid pointer to an error code value, which must
not indicate a | 735 * @param pErrorCode Must be a valid pointer to an error code value, which must
not indicate a |
| 731 * failure before the function call. | 736 * failure before the function call. |
| 732 * @see ucol_getReorderCodes | 737 * @see ucol_getReorderCodes |
| 733 * @see ucol_getEquivalentReorderCodes | 738 * @see ucol_getEquivalentReorderCodes |
| 734 * @see UScriptCode | 739 * @see UScriptCode |
| 735 * @see UColReorderCode | 740 * @see UColReorderCode |
| 736 * @stable ICU 4.8 | 741 * @stable ICU 4.8 |
| 737 */ | 742 */ |
| 738 U_STABLE void U_EXPORT2 | 743 U_STABLE void U_EXPORT2 |
| 739 ucol_setReorderCodes(UCollator* coll, | 744 ucol_setReorderCodes(UCollator* coll, |
| 740 const int32_t* reorderCodes, | 745 const int32_t* reorderCodes, |
| 741 int32_t reorderCodesLength, | 746 int32_t reorderCodesLength, |
| 742 UErrorCode *pErrorCode); | 747 UErrorCode *pErrorCode); |
| 743 | 748 |
| 744 /** | 749 /** |
| 745 * Retrieves the reorder codes that are grouped with the given reorder code. Som
e reorder | 750 * Retrieves the reorder codes that are grouped with the given reorder code. Som
e reorder |
| 746 * codes will be grouped and must reorder together. | 751 * codes will be grouped and must reorder together. |
| 752 * Beginning with ICU 55, scripts only reorder together if they are primary-equa
l, |
| 753 * for example Hiragana and Katakana. |
| 754 * |
| 747 * @param reorderCode The reorder code to determine equivalence for. | 755 * @param reorderCode The reorder code to determine equivalence for. |
| 748 * @param dest The array to fill with the script ordering. | 756 * @param dest The array to fill with the script ordering. |
| 749 * @param destCapacity The length of dest. If it is 0, then dest may be NULL and
the function | 757 * @param destCapacity The length of dest. If it is 0, then dest may be NULL and
the function |
| 750 * will only return the length of the result without writing any of the result s
tring (pre-flighting). | 758 * will only return the length of the result without writing any codes (pre-flig
hting). |
| 751 * @param pErrorCode Must be a valid pointer to an error code value, which must
not indicate | 759 * @param pErrorCode Must be a valid pointer to an error code value, which must
not indicate |
| 752 * a failure before the function call. | 760 * a failure before the function call. |
| 753 * @return The number of reordering codes written to the dest array. | 761 * @return The number of reordering codes written to the dest array. |
| 754 * @see ucol_setReorderCodes | 762 * @see ucol_setReorderCodes |
| 755 * @see ucol_getReorderCodes | 763 * @see ucol_getReorderCodes |
| 756 * @see UScriptCode | 764 * @see UScriptCode |
| 757 * @see UColReorderCode | 765 * @see UColReorderCode |
| 758 * @stable ICU 4.8 | 766 * @stable ICU 4.8 |
| 759 */ | 767 */ |
| 760 U_STABLE int32_t U_EXPORT2 | 768 U_STABLE int32_t U_EXPORT2 |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 * @return attribute value | 1193 * @return attribute value |
| 1186 * @param status to indicate whether the operation went on smoothly or there wer
e errors | 1194 * @param status to indicate whether the operation went on smoothly or there wer
e errors |
| 1187 * @see UColAttribute | 1195 * @see UColAttribute |
| 1188 * @see UColAttributeValue | 1196 * @see UColAttributeValue |
| 1189 * @see ucol_setAttribute | 1197 * @see ucol_setAttribute |
| 1190 * @stable ICU 2.0 | 1198 * @stable ICU 2.0 |
| 1191 */ | 1199 */ |
| 1192 U_STABLE UColAttributeValue U_EXPORT2 | 1200 U_STABLE UColAttributeValue U_EXPORT2 |
| 1193 ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status)
; | 1201 ucol_getAttribute(const UCollator *coll, UColAttribute attr, UErrorCode *status)
; |
| 1194 | 1202 |
| 1195 #ifndef U_HIDE_DRAFT_API | |
| 1196 | |
| 1197 /** | 1203 /** |
| 1198 * Sets the variable top to the top of the specified reordering group. | 1204 * Sets the variable top to the top of the specified reordering group. |
| 1199 * The variable top determines the highest-sorting character | 1205 * The variable top determines the highest-sorting character |
| 1200 * which is affected by UCOL_ALTERNATE_HANDLING. | 1206 * which is affected by UCOL_ALTERNATE_HANDLING. |
| 1201 * If that attribute is set to UCOL_NON_IGNORABLE, then the variable top has no
effect. | 1207 * If that attribute is set to UCOL_NON_IGNORABLE, then the variable top has no
effect. |
| 1202 * @param coll the collator | 1208 * @param coll the collator |
| 1203 * @param group one of UCOL_REORDER_CODE_SPACE, UCOL_REORDER_CODE_PUNCTUATION, | 1209 * @param group one of UCOL_REORDER_CODE_SPACE, UCOL_REORDER_CODE_PUNCTUATION, |
| 1204 * UCOL_REORDER_CODE_SYMBOL, UCOL_REORDER_CODE_CURRENCY; | 1210 * UCOL_REORDER_CODE_SYMBOL, UCOL_REORDER_CODE_CURRENCY; |
| 1205 * or UCOL_REORDER_CODE_DEFAULT to restore the default max variable
group | 1211 * or UCOL_REORDER_CODE_DEFAULT to restore the default max variable
group |
| 1206 * @param pErrorCode Standard ICU error code. Its input value must | 1212 * @param pErrorCode Standard ICU error code. Its input value must |
| 1207 * pass the U_SUCCESS() test, or else the function returns | 1213 * pass the U_SUCCESS() test, or else the function returns |
| 1208 * immediately. Check for U_FAILURE() on output or use with | 1214 * immediately. Check for U_FAILURE() on output or use with |
| 1209 * function chaining. (See User Guide for details.) | 1215 * function chaining. (See User Guide for details.) |
| 1210 * @see ucol_getMaxVariable | 1216 * @see ucol_getMaxVariable |
| 1211 * @draft ICU 53 | 1217 * @stable ICU 53 |
| 1212 */ | 1218 */ |
| 1213 U_DRAFT void U_EXPORT2 | 1219 U_STABLE void U_EXPORT2 |
| 1214 ucol_setMaxVariable(UCollator *coll, UColReorderCode group, UErrorCode *pErrorCo
de); | 1220 ucol_setMaxVariable(UCollator *coll, UColReorderCode group, UErrorCode *pErrorCo
de); |
| 1215 | 1221 |
| 1216 /** | 1222 /** |
| 1217 * Returns the maximum reordering group whose characters are affected by UCOL_AL
TERNATE_HANDLING. | 1223 * Returns the maximum reordering group whose characters are affected by UCOL_AL
TERNATE_HANDLING. |
| 1218 * @param coll the collator | 1224 * @param coll the collator |
| 1219 * @return the maximum variable reordering group. | 1225 * @return the maximum variable reordering group. |
| 1220 * @see ucol_setMaxVariable | 1226 * @see ucol_setMaxVariable |
| 1221 * @draft ICU 53 | 1227 * @stable ICU 53 |
| 1222 */ | 1228 */ |
| 1223 U_DRAFT UColReorderCode U_EXPORT2 | 1229 U_STABLE UColReorderCode U_EXPORT2 |
| 1224 ucol_getMaxVariable(const UCollator *coll); | 1230 ucol_getMaxVariable(const UCollator *coll); |
| 1225 | 1231 |
| 1226 #endif /* U_HIDE_DRAFT_API */ | |
| 1227 | |
| 1228 #ifndef U_HIDE_DEPRECATED_API | 1232 #ifndef U_HIDE_DEPRECATED_API |
| 1229 /** | 1233 /** |
| 1230 * Sets the variable top to the primary weight of the specified string. | 1234 * Sets the variable top to the primary weight of the specified string. |
| 1231 * | 1235 * |
| 1232 * Beginning with ICU 53, the variable top is pinned to | 1236 * Beginning with ICU 53, the variable top is pinned to |
| 1233 * the top of one of the supported reordering groups, | 1237 * the top of one of the supported reordering groups, |
| 1234 * and it must not be beyond the last of those groups. | 1238 * and it must not be beyond the last of those groups. |
| 1235 * See ucol_setMaxVariable(). | 1239 * See ucol_setMaxVariable(). |
| 1236 * @param coll the collator | 1240 * @param coll the collator |
| 1237 * @param varTop one or more (if contraction) UChars to which the variable top s
hould be set | 1241 * @param varTop one or more (if contraction) UChars to which the variable top s
hould be set |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1258 * @param status error code (not changed by function). If error code is set, | 1262 * @param status error code (not changed by function). If error code is set, |
| 1259 * the return value is undefined. | 1263 * the return value is undefined. |
| 1260 * @return the variable top primary weight | 1264 * @return the variable top primary weight |
| 1261 * @see ucol_getMaxVariable | 1265 * @see ucol_getMaxVariable |
| 1262 * @see ucol_setVariableTop | 1266 * @see ucol_setVariableTop |
| 1263 * @see ucol_restoreVariableTop | 1267 * @see ucol_restoreVariableTop |
| 1264 * @stable ICU 2.0 | 1268 * @stable ICU 2.0 |
| 1265 */ | 1269 */ |
| 1266 U_STABLE uint32_t U_EXPORT2 ucol_getVariableTop(const UCollator *coll, UErrorCod
e *status); | 1270 U_STABLE uint32_t U_EXPORT2 ucol_getVariableTop(const UCollator *coll, UErrorCod
e *status); |
| 1267 | 1271 |
| 1272 #ifndef U_HIDE_DEPRECATED_API |
| 1268 /** | 1273 /** |
| 1269 * Sets the variable top to the specified primary weight. | 1274 * Sets the variable top to the specified primary weight. |
| 1270 * | 1275 * |
| 1271 * Beginning with ICU 53, the variable top is pinned to | 1276 * Beginning with ICU 53, the variable top is pinned to |
| 1272 * the top of one of the supported reordering groups, | 1277 * the top of one of the supported reordering groups, |
| 1273 * and it must not be beyond the last of those groups. | 1278 * and it must not be beyond the last of those groups. |
| 1274 * See ucol_setMaxVariable(). | 1279 * See ucol_setMaxVariable(). |
| 1275 * @param varTop primary weight, as returned by ucol_setVariableTop or ucol_getV
ariableTop | 1280 * @param varTop primary weight, as returned by ucol_setVariableTop or ucol_getV
ariableTop |
| 1276 * @param status error code | 1281 * @param status error code |
| 1277 * @see ucol_getVariableTop | 1282 * @see ucol_getVariableTop |
| 1278 * @see ucol_setVariableTop | 1283 * @see ucol_setVariableTop |
| 1279 * @deprecated ICU 53 Call ucol_setMaxVariable() instead. | 1284 * @deprecated ICU 53 Call ucol_setMaxVariable() instead. |
| 1280 */ | 1285 */ |
| 1281 U_DEPRECATED void U_EXPORT2 | 1286 U_DEPRECATED void U_EXPORT2 |
| 1282 ucol_restoreVariableTop(UCollator *coll, const uint32_t varTop, UErrorCode *stat
us); | 1287 ucol_restoreVariableTop(UCollator *coll, const uint32_t varTop, UErrorCode *stat
us); |
| 1288 #endif /* U_HIDE_DEPRECATED_API */ |
| 1283 | 1289 |
| 1284 /** | 1290 /** |
| 1285 * Thread safe cloning operation. The result is a clone of a given collator. | 1291 * Thread safe cloning operation. The result is a clone of a given collator. |
| 1286 * @param coll collator to be cloned | 1292 * @param coll collator to be cloned |
| 1287 * @param stackBuffer <em>Deprecated functionality as of ICU 52, use NULL.</em><
br> | 1293 * @param stackBuffer <em>Deprecated functionality as of ICU 52, use NULL.</em><
br> |
| 1288 * user allocated space for the new clone. | 1294 * user allocated space for the new clone. |
| 1289 * If NULL new memory will be allocated. | 1295 * If NULL new memory will be allocated. |
| 1290 * If buffer is not large enough, new memory will be allocated. | 1296 * If buffer is not large enough, new memory will be allocated. |
| 1291 * Clients can use the U_COL_SAFECLONE_BUFFERSIZE. | 1297 * Clients can use the U_COL_SAFECLONE_BUFFERSIZE. |
| 1292 * @param pBufferSize <em>Deprecated functionality as of ICU 52, use NULL or 1.<
/em><br> | 1298 * @param pBufferSize <em>Deprecated functionality as of ICU 52, use NULL or 1.<
/em><br> |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1465 */ | 1471 */ |
| 1466 U_STABLE UCollator* U_EXPORT2 | 1472 U_STABLE UCollator* U_EXPORT2 |
| 1467 ucol_openBinary(const uint8_t *bin, int32_t length, | 1473 ucol_openBinary(const uint8_t *bin, int32_t length, |
| 1468 const UCollator *base, | 1474 const UCollator *base, |
| 1469 UErrorCode *status); | 1475 UErrorCode *status); |
| 1470 | 1476 |
| 1471 | 1477 |
| 1472 #endif /* #if !UCONFIG_NO_COLLATION */ | 1478 #endif /* #if !UCONFIG_NO_COLLATION */ |
| 1473 | 1479 |
| 1474 #endif | 1480 #endif |
| OLD | NEW |