| LETypes.h | | LETypes.h | |
| /* | | /* | |
| * | | * | |
|
| * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved | | * (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved | |
| * | | * | |
| */ | | */ | |
| | | | |
| #ifndef __LETYPES_H | | #ifndef __LETYPES_H | |
| #define __LETYPES_H | | #define __LETYPES_H | |
| | | | |
| #if !defined(LE_USE_CMEMORY) && (defined(U_LAYOUT_IMPLEMENTATION) || define
d(U_LAYOUTEX_IMPLEMENTATION) || defined(U_STATIC_IMPLEMENTATION) || defined
(U_COMBINED_IMPLEMENTATION)) | | #if !defined(LE_USE_CMEMORY) && (defined(U_LAYOUT_IMPLEMENTATION) || define
d(U_LAYOUTEX_IMPLEMENTATION) || defined(U_STATIC_IMPLEMENTATION) || defined
(U_COMBINED_IMPLEMENTATION)) | |
| #define LE_USE_CMEMORY | | #define LE_USE_CMEMORY | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 401 | | skipping to change at line 401 | |
| LE_ABVM_FEATURE_TAG = 0x6162766DUL, /**< 'abvm' */ | | LE_ABVM_FEATURE_TAG = 0x6162766DUL, /**< 'abvm' */ | |
| LE_ABVS_FEATURE_TAG = 0x61627673UL, /**< 'abvs' */ | | LE_ABVS_FEATURE_TAG = 0x61627673UL, /**< 'abvs' */ | |
| LE_AFRC_FEATURE_TAG = 0x61667263UL, /**< 'afrc' */ | | LE_AFRC_FEATURE_TAG = 0x61667263UL, /**< 'afrc' */ | |
| LE_AKHN_FEATURE_TAG = 0x616B686EUL, /**< 'akhn' */ | | LE_AKHN_FEATURE_TAG = 0x616B686EUL, /**< 'akhn' */ | |
| LE_BLWF_FEATURE_TAG = 0x626C7766UL, /**< 'blwf' */ | | LE_BLWF_FEATURE_TAG = 0x626C7766UL, /**< 'blwf' */ | |
| LE_BLWM_FEATURE_TAG = 0x626C776DUL, /**< 'blwm' */ | | LE_BLWM_FEATURE_TAG = 0x626C776DUL, /**< 'blwm' */ | |
| LE_BLWS_FEATURE_TAG = 0x626C7773UL, /**< 'blws' */ | | LE_BLWS_FEATURE_TAG = 0x626C7773UL, /**< 'blws' */ | |
| LE_CALT_FEATURE_TAG = 0x63616C74UL, /**< 'calt' */ | | LE_CALT_FEATURE_TAG = 0x63616C74UL, /**< 'calt' */ | |
| LE_CASE_FEATURE_TAG = 0x63617365UL, /**< 'case' */ | | LE_CASE_FEATURE_TAG = 0x63617365UL, /**< 'case' */ | |
| LE_CCMP_FEATURE_TAG = 0x63636D70UL, /**< 'ccmp' */ | | LE_CCMP_FEATURE_TAG = 0x63636D70UL, /**< 'ccmp' */ | |
|
| | | LE_CJCT_FEATURE_TAG = 0x636A6374UL, /**< 'cjct' */ | |
| LE_CLIG_FEATURE_TAG = 0x636C6967UL, /**< 'clig' */ | | LE_CLIG_FEATURE_TAG = 0x636C6967UL, /**< 'clig' */ | |
| LE_CPSP_FEATURE_TAG = 0x63707370UL, /**< 'cpsp' */ | | LE_CPSP_FEATURE_TAG = 0x63707370UL, /**< 'cpsp' */ | |
| LE_CSWH_FEATURE_TAG = 0x63737768UL, /**< 'cswh' */ | | LE_CSWH_FEATURE_TAG = 0x63737768UL, /**< 'cswh' */ | |
| LE_CURS_FEATURE_TAG = 0x63757273UL, /**< 'curs' */ | | LE_CURS_FEATURE_TAG = 0x63757273UL, /**< 'curs' */ | |
| LE_C2SC_FEATURE_TAG = 0x63327363UL, /**< 'c2sc' */ | | LE_C2SC_FEATURE_TAG = 0x63327363UL, /**< 'c2sc' */ | |
| LE_C2PC_FEATURE_TAG = 0x63327063UL, /**< 'c2pc' */ | | LE_C2PC_FEATURE_TAG = 0x63327063UL, /**< 'c2pc' */ | |
| LE_DIST_FEATURE_TAG = 0x64697374UL, /**< 'dist' */ | | LE_DIST_FEATURE_TAG = 0x64697374UL, /**< 'dist' */ | |
| LE_DLIG_FEATURE_TAG = 0x646C6967UL, /**< 'dlig' */ | | LE_DLIG_FEATURE_TAG = 0x646C6967UL, /**< 'dlig' */ | |
| LE_DNOM_FEATURE_TAG = 0x646E6F6DUL, /**< 'dnom' */ | | LE_DNOM_FEATURE_TAG = 0x646E6F6DUL, /**< 'dnom' */ | |
| LE_EXPT_FEATURE_TAG = 0x65787074UL, /**< 'expt' */ | | LE_EXPT_FEATURE_TAG = 0x65787074UL, /**< 'expt' */ | |
| | | | |
| skipping to change at line 464 | | skipping to change at line 465 | |
| LE_PNUM_FEATURE_TAG = 0x706E756DUL, /**< 'pnum' */ | | LE_PNUM_FEATURE_TAG = 0x706E756DUL, /**< 'pnum' */ | |
| LE_PREF_FEATURE_TAG = 0x70726566UL, /**< 'pref' */ | | LE_PREF_FEATURE_TAG = 0x70726566UL, /**< 'pref' */ | |
| LE_PRES_FEATURE_TAG = 0x70726573UL, /**< 'pres' */ | | LE_PRES_FEATURE_TAG = 0x70726573UL, /**< 'pres' */ | |
| LE_PSTF_FEATURE_TAG = 0x70737466UL, /**< 'pstf' */ | | LE_PSTF_FEATURE_TAG = 0x70737466UL, /**< 'pstf' */ | |
| LE_PSTS_FEATURE_TAG = 0x70737473UL, /**< 'psts' */ | | LE_PSTS_FEATURE_TAG = 0x70737473UL, /**< 'psts' */ | |
| LE_PWID_FEATURE_TAG = 0x70776964UL, /**< 'pwid' */ | | LE_PWID_FEATURE_TAG = 0x70776964UL, /**< 'pwid' */ | |
| LE_QWID_FEATURE_TAG = 0x71776964UL, /**< 'qwid' */ | | LE_QWID_FEATURE_TAG = 0x71776964UL, /**< 'qwid' */ | |
| LE_RAND_FEATURE_TAG = 0x72616E64UL, /**< 'rand' */ | | LE_RAND_FEATURE_TAG = 0x72616E64UL, /**< 'rand' */ | |
| LE_RLIG_FEATURE_TAG = 0x726C6967UL, /**< 'rlig' */ | | LE_RLIG_FEATURE_TAG = 0x726C6967UL, /**< 'rlig' */ | |
| LE_RPHF_FEATURE_TAG = 0x72706866UL, /**< 'rphf' */ | | LE_RPHF_FEATURE_TAG = 0x72706866UL, /**< 'rphf' */ | |
|
| | | LE_RKRF_FEATURE_TAG = 0x726B7266UL, /**< 'rkrf' */ | |
| LE_RTBD_FEATURE_TAG = 0x72746264UL, /**< 'rtbd' */ | | LE_RTBD_FEATURE_TAG = 0x72746264UL, /**< 'rtbd' */ | |
| LE_RTLA_FEATURE_TAG = 0x72746C61UL, /**< 'rtla' */ | | LE_RTLA_FEATURE_TAG = 0x72746C61UL, /**< 'rtla' */ | |
| LE_RUBY_FEATURE_TAG = 0x72756279UL, /**< 'ruby' */ | | LE_RUBY_FEATURE_TAG = 0x72756279UL, /**< 'ruby' */ | |
| LE_SALT_FEATURE_TAG = 0x73616C74UL, /**< 'salt' */ | | LE_SALT_FEATURE_TAG = 0x73616C74UL, /**< 'salt' */ | |
| LE_SINF_FEATURE_TAG = 0x73696E66UL, /**< 'sinf' */ | | LE_SINF_FEATURE_TAG = 0x73696E66UL, /**< 'sinf' */ | |
| LE_SIZE_FEATURE_TAG = 0x73697A65UL, /**< 'size' */ | | LE_SIZE_FEATURE_TAG = 0x73697A65UL, /**< 'size' */ | |
| LE_SMCP_FEATURE_TAG = 0x736D6370UL, /**< 'smcp' */ | | LE_SMCP_FEATURE_TAG = 0x736D6370UL, /**< 'smcp' */ | |
| LE_SMPL_FEATURE_TAG = 0x736D706CUL, /**< 'smpl' */ | | LE_SMPL_FEATURE_TAG = 0x736D706CUL, /**< 'smpl' */ | |
| LE_SS01_FEATURE_TAG = 0x73733031UL, /**< 'ss01' */ | | LE_SS01_FEATURE_TAG = 0x73733031UL, /**< 'ss01' */ | |
| LE_SS02_FEATURE_TAG = 0x73733032UL, /**< 'ss02' */ | | LE_SS02_FEATURE_TAG = 0x73733032UL, /**< 'ss02' */ | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 3 lines changed or added | |
|
| bms.h | | bms.h | |
| | | | |
| skipping to change at line 16 | | skipping to change at line 16 | |
| /** | | /** | |
| * \file | | * \file | |
| * \brief C API: Boyer-Moore StringSearch prototype. | | * \brief C API: Boyer-Moore StringSearch prototype. | |
| * \internal | | * \internal | |
| */ | | */ | |
| | | | |
| #ifndef _BMS_H | | #ifndef _BMS_H | |
| #define _BMS_H | | #define _BMS_H | |
| | | | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
|
| | | | |
| | | #if !UCONFIG_NO_COLLATION | |
| | | | |
| #include "unicode/ucol.h" | | #include "unicode/ucol.h" | |
| | | | |
| /** | | /** | |
| * A <code>UCD</code> object holds the Collator-specific data needed to | | * A <code>UCD</code> object holds the Collator-specific data needed to | |
| * compute the length of the shortest string that can | | * compute the length of the shortest string that can | |
| * generate a partcular list of CEs. | | * generate a partcular list of CEs. | |
| * | | * | |
| * <code>UCD</code> objects are quite expensive to compute. Because | | * <code>UCD</code> objects are quite expensive to compute. Because | |
| * of this, they are cached. When you call <code>ucd_open</code> it | | * of this, they are cached. When you call <code>ucd_open</code> it | |
| * returns a reference counted cached object. When you call <code>ucd_close
</code> | | * returns a reference counted cached object. When you call <code>ucd_close
</code> | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 40 | |
| * | | * | |
| * If you do not need to reuse any unreferenced objects in the cache, you c
an call | | * If you do not need to reuse any unreferenced objects in the cache, you c
an call | |
| * <code>ucd_flushCCache</code>. If you no longer need any <code>UCD</code> | | * <code>ucd_flushCCache</code>. If you no longer need any <code>UCD</code> | |
| * objects, you can call <code>ucd_freeCache</code> | | * objects, you can call <code>ucd_freeCache</code> | |
| */ | | */ | |
| typedef void UCD; | | typedef void UCD; | |
| | | | |
| /** | | /** | |
| * Open a <code>UCD</code> object. | | * Open a <code>UCD</code> object. | |
| * | | * | |
|
| * @param collator - the collator | | * @param coll - the collator | |
| * @param status - will be set if any errors occur. | | * @param status - will be set if any errors occur. | |
| * | | * | |
| * @return the <code>UCD</code> object. You must call | | * @return the <code>UCD</code> object. You must call | |
| * <code>ucd_close</code> when you are done using the object. | | * <code>ucd_close</code> when you are done using the object. | |
| * | | * | |
| * Note: if on return status is set to an error, the only safe | | * Note: if on return status is set to an error, the only safe | |
| * thing to do with the returned object is to call <code>ucd_close</code>. | | * thing to do with the returned object is to call <code>ucd_close</code>. | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| | | | |
| skipping to change at line 109 | | skipping to change at line 112 | |
| U_CAPI void U_EXPORT2 | | U_CAPI void U_EXPORT2 | |
| ucd_flushCache(); | | ucd_flushCache(); | |
| | | | |
| /** | | /** | |
| * BMS | | * BMS | |
| * | | * | |
| * This object holds the information needed to do a Collation sensitive Boy
er-Moore search. It encapulates | | * This object holds the information needed to do a Collation sensitive Boy
er-Moore search. It encapulates | |
| * the pattern, the "bad character" and "good suffix" tables, the Collator-
based data needed to compute them, | | * the pattern, the "bad character" and "good suffix" tables, the Collator-
based data needed to compute them, | |
| * and a reference to the text being searched. | | * and a reference to the text being searched. | |
| * | | * | |
|
| * To do a search, you fist need to get a <code>UCD</code> object by callin
g <code>ucd_open</code>. | | * To do a search, you first need to get a <code>UCD</code> object by calli
ng <code>ucd_open</code>. | |
| * Then you construct a <code>BMS</code> object from the <code>UCD</code> o
bject, the pattern | | * Then you construct a <code>BMS</code> object from the <code>UCD</code> o
bject, the pattern | |
| * string and the target string. Then you call the <code>search</code> meth
od. Here's a code sample: | | * string and the target string. Then you call the <code>search</code> meth
od. Here's a code sample: | |
| * | | * | |
| * <pre> | | * <pre> | |
| * void boyerMooreExample(UCollator *collator, UChar *pattern, int32_t patt
ernLen, UChar *target, int32_t targetLength) | | * void boyerMooreExample(UCollator *collator, UChar *pattern, int32_t patt
ernLen, UChar *target, int32_t targetLength) | |
| * { | | * { | |
| * UErrorCode status = U_ZERO_ERROR; | | * UErrorCode status = U_ZERO_ERROR; | |
| * int32_t offset = 0, start = -1, end = -1; | | * int32_t offset = 0, start = -1, end = -1; | |
| * UCD *ucd = NULL); | | * UCD *ucd = NULL); | |
| * BMS *bms = NULL; | | * BMS *bms = NULL; | |
| | | | |
| skipping to change at line 180 | | skipping to change at line 183 | |
| * in a discontiguous contraction may fail. The only known cases of th
is are with | | * in a discontiguous contraction may fail. The only known cases of th
is are with | |
| * the Tibetan script. For example searching for the pattern | | * the Tibetan script. For example searching for the pattern | |
| * "\u0F7F\u0F80\u0F81\u0F82\u0F83\u0F84\u0F85" will fail. (This case
is artificial. We've | | * "\u0F7F\u0F80\u0F81\u0F82\u0F83\u0F84\u0F85" will fail. (This case
is artificial. We've | |
| * been unable to find a pratical, real-world example of this failure.
) | | * been unable to find a pratical, real-world example of this failure.
) | |
| * | | * | |
| * NOTE: This is a technology preview. The final version of this API may no
t bear any resenblence to this API. | | * NOTE: This is a technology preview. The final version of this API may no
t bear any resenblence to this API. | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| struct BMS; | | struct BMS; | |
|
| typedef struct BMS BMS; | | typedef struct BMS BMS; /**< @see BMS */ | |
| | | | |
| /** | | /** | |
| * Construct a <code>MBS</code> object. | | * Construct a <code>MBS</code> object. | |
| * | | * | |
| * @param ucd - A <code>UCD</code> object holding the Collator-sensitive da
ta | | * @param ucd - A <code>UCD</code> object holding the Collator-sensitive da
ta | |
| * @param pattern - the string for which to search | | * @param pattern - the string for which to search | |
|
| * @param latternLength - the length of the string for which to search | | * @param patternLength - the length of the string for which to search | |
| * @param target - the string in which to search | | * @param target - the string in which to search | |
| * @param targetLength - the length of the string in which to search | | * @param targetLength - the length of the string in which to search | |
| * @param status - will be set if any errors occur. | | * @param status - will be set if any errors occur. | |
| * | | * | |
| * @return the <code>BMS</code> object. | | * @return the <code>BMS</code> object. | |
| * | | * | |
| * Note: if on return status is set to an error, the only safe | | * Note: if on return status is set to an error, the only safe | |
| * thing to do with the returned object is to call | | * thing to do with the returned object is to call | |
| * <code>bms_close</code>. | | * <code>bms_close</code>. | |
| * | | * | |
| | | | |
| skipping to change at line 218 | | skipping to change at line 221 | |
| * storage associated with it. | | * storage associated with it. | |
| * | | * | |
| * @param bms - the <code>BMS</code> object to close. | | * @param bms - the <code>BMS</code> object to close. | |
| */ | | */ | |
| U_CAPI void U_EXPORT2 | | U_CAPI void U_EXPORT2 | |
| bms_close(BMS *bms); | | bms_close(BMS *bms); | |
| | | | |
| /** | | /** | |
| * Test the pattern to see if it generates any CEs. | | * Test the pattern to see if it generates any CEs. | |
| * | | * | |
|
| | | * @param bms - the <code>BMS</code> object | |
| * @return <code>TRUE</code> if the pattern string did not generate any CEs | | * @return <code>TRUE</code> if the pattern string did not generate any CEs | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| U_CAPI UBool U_EXPORT2 | | U_CAPI UBool U_EXPORT2 | |
| bms_empty(BMS *bms); | | bms_empty(BMS *bms); | |
| | | | |
| /** | | /** | |
| * Get the <code>UCD</code> object used to create | | * Get the <code>UCD</code> object used to create | |
| * a given <code>BMS</code> object. | | * a given <code>BMS</code> object. | |
| | | | |
| skipping to change at line 242 | | skipping to change at line 246 | |
| * the given <code>BMS</code> object. | | * the given <code>BMS</code> object. | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| U_CAPI UCD * U_EXPORT2 | | U_CAPI UCD * U_EXPORT2 | |
| bms_getData(BMS *bms); | | bms_getData(BMS *bms); | |
| | | | |
| /** | | /** | |
| * Search for the pattern string in the target string. | | * Search for the pattern string in the target string. | |
| * | | * | |
|
| | | * @param bms - the <code>BMS</code> object | |
| * @param offset - the offset in the target string at which to begin the se
arch | | * @param offset - the offset in the target string at which to begin the se
arch | |
| * @param start - will be set to the starting offset of the match, or -1 if
there's no match | | * @param start - will be set to the starting offset of the match, or -1 if
there's no match | |
| * @param end - will be set to the ending offset of the match, or -1 if the
re's no match | | * @param end - will be set to the ending offset of the match, or -1 if the
re's no match | |
| * | | * | |
| * @return <code>TRUE</code> if the match succeeds, <code>FALSE</code> othe
rwise. | | * @return <code>TRUE</code> if the match succeeds, <code>FALSE</code> othe
rwise. | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| U_CAPI UBool U_EXPORT2 | | U_CAPI UBool U_EXPORT2 | |
| bms_search(BMS *bms, int32_t offset, int32_t *start, int32_t *end); | | bms_search(BMS *bms, int32_t offset, int32_t *start, int32_t *end); | |
| | | | |
| /** | | /** | |
| * Set the target string for the match. | | * Set the target string for the match. | |
| * | | * | |
|
| | | * @param bms - the <code>BMS</code> object | |
| * @param target - the new target string | | * @param target - the new target string | |
| * @param targetLength - the length of the new target string | | * @param targetLength - the length of the new target string | |
| * @param status - will be set if any errors occur. | | * @param status - will be set if any errors occur. | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| U_CAPI void U_EXPORT2 | | U_CAPI void U_EXPORT2 | |
| bms_setTargetString(BMS *bms, const UChar *target, int32_t targetLength, UE
rrorCode *status); | | bms_setTargetString(BMS *bms, const UChar *target, int32_t targetLength, UE
rrorCode *status); | |
| | | | |
|
| | | #endif | |
| | | | |
| #endif /* _BMS_H */ | | #endif /* _BMS_H */ | |
| | | | |
End of changes. 9 change blocks. |
| 4 lines changed or deleted | | 12 lines changed or added | |
|
| coll.h | | coll.h | |
| | | | |
| skipping to change at line 62 | | skipping to change at line 62 | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| | | | |
| #if !UCONFIG_NO_COLLATION | | #if !UCONFIG_NO_COLLATION | |
| | | | |
| #include "unicode/uobject.h" | | #include "unicode/uobject.h" | |
| #include "unicode/ucol.h" | | #include "unicode/ucol.h" | |
| #include "unicode/normlzr.h" | | #include "unicode/normlzr.h" | |
| #include "unicode/locid.h" | | #include "unicode/locid.h" | |
| #include "unicode/uniset.h" | | #include "unicode/uniset.h" | |
| #include "unicode/umisc.h" | | #include "unicode/umisc.h" | |
|
| | | #include "unicode/uiter.h" | |
| | | #include "unicode/stringpiece.h" | |
| | | | |
| U_NAMESPACE_BEGIN | | U_NAMESPACE_BEGIN | |
| | | | |
| class StringEnumeration; | | class StringEnumeration; | |
| | | | |
| #if !UCONFIG_NO_SERVICE | | #if !UCONFIG_NO_SERVICE | |
| /** | | /** | |
| * @stable ICU 2.6 | | * @stable ICU 2.6 | |
| */ | | */ | |
| class CollatorFactory; | | class CollatorFactory; | |
| | | | |
| skipping to change at line 441 | | skipping to change at line 443 | |
| * @return Returns an enum value. UCOL_GREATER if source is greater | | * @return Returns an enum value. UCOL_GREATER if source is greater | |
| * than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if s
ource is less | | * than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if s
ource is less | |
| * than target | | * than target | |
| * @stable ICU 2.6 | | * @stable ICU 2.6 | |
| */ | | */ | |
| virtual UCollationResult compare(const UChar* source, int32_t sourceLen
gth, | | virtual UCollationResult compare(const UChar* source, int32_t sourceLen
gth, | |
| const UChar* target, int32_t targetLe
ngth, | | const UChar* target, int32_t targetLe
ngth, | |
| UErrorCode &status) const = 0; | | UErrorCode &status) const = 0; | |
| | | | |
| /** | | /** | |
|
| | | * Compares two strings using the Collator. | |
| | | * Returns whether the first one compares less than/equal to/greater th | |
| | | an | |
| | | * the second one. | |
| | | * This version takes UCharIterator input. | |
| | | * @param sIter the first ("source") string iterator | |
| | | * @param tIter the second ("target") string iterator | |
| | | * @param status ICU status | |
| | | * @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | virtual UCollationResult compare(UCharIterator &sIter, | |
| | | UCharIterator &tIter, | |
| | | UErrorCode &status) const; | |
| | | | |
| | | /** | |
| | | * Compares two UTF-8 strings using the Collator. | |
| | | * Returns whether the first one compares less than/equal to/greater th | |
| | | an | |
| | | * the second one. | |
| | | * This version takes UTF-8 input. | |
| | | * Note that a StringPiece can be implicitly constructed | |
| | | * from a std::string or a NUL-terminated const char * string. | |
| | | * @param source the first UTF-8 string | |
| | | * @param target the second UTF-8 string | |
| | | * @param status ICU status | |
| | | * @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | virtual UCollationResult compareUTF8(const StringPiece &source, | |
| | | const StringPiece &target, | |
| | | UErrorCode &status) const; | |
| | | | |
| | | /** | |
| * Transforms the string into a series of characters that can be compar
ed | | * Transforms the string into a series of characters that can be compar
ed | |
| * with CollationKey::compareTo. It is not possible to restore the orig
inal | | * with CollationKey::compareTo. It is not possible to restore the orig
inal | |
| * string from the chars in the sort key. The generated sort key handl
es | | * string from the chars in the sort key. The generated sort key handl
es | |
| * only a limited number of ignorable characters. | | * only a limited number of ignorable characters. | |
| * <p>Use CollationKey::equals or CollationKey::compare to compare the | | * <p>Use CollationKey::equals or CollationKey::compare to compare the | |
| * generated sort keys. | | * generated sort keys. | |
| * If the source string is null, a null collation key will be returned. | | * If the source string is null, a null collation key will be returned. | |
| * @param source the source string to be transformed into a sort key. | | * @param source the source string to be transformed into a sort key. | |
| * @param key the collation key to be filled in | | * @param key the collation key to be filled in | |
| * @param status the error code status. | | * @param status the error code status. | |
| | | | |
| skipping to change at line 643 | | skipping to change at line 677 | |
| * @stable ICU 3.0 | | * @stable ICU 3.0 | |
| */ | | */ | |
| static StringEnumeration* U_EXPORT2 getKeywordValues(const char *keywor
d, UErrorCode& status); | | static StringEnumeration* U_EXPORT2 getKeywordValues(const char *keywor
d, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Given a key and a locale, returns an array of string values in a pre
ferred | | * Given a key and a locale, returns an array of string values in a pre
ferred | |
| * order that would make a difference. These are all and only those val
ues where | | * order that would make a difference. These are all and only those val
ues where | |
| * the open (creation) of the service with the locale formed from the i
nput locale | | * the open (creation) of the service with the locale formed from the i
nput locale | |
| * plus input keyword and that value has different behavior than creati
on with the | | * plus input keyword and that value has different behavior than creati
on with the | |
| * input locale alone. | | * input locale alone. | |
|
| * @param key one of the keys supported by this service. For
now, only | | * @param keyword one of the keys supported by this service. Fo
r now, only | |
| * "collation" is supported. | | * "collation" is supported. | |
| * @param locale the locale | | * @param locale the locale | |
| * @param commonlyUsed if set to true it will return only commonly use
d values | | * @param commonlyUsed if set to true it will return only commonly use
d values | |
| * with the given locale in preferred order. Othe
rwise, | | * with the given locale in preferred order. Othe
rwise, | |
| * it will return all the available values for the
locale. | | * it will return all the available values for the
locale. | |
|
| | | * @param status ICU status | |
| * @return a string enumeration over keyword values for the given key a
nd the locale. | | * @return a string enumeration over keyword values for the given key a
nd the locale. | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| static StringEnumeration* U_EXPORT2 getKeywordValuesForLocale(const cha
r* keyword, const Locale& locale, | | static StringEnumeration* U_EXPORT2 getKeywordValuesForLocale(const cha
r* keyword, const Locale& locale, | |
| UBool c
ommonlyUsed, UErrorCode& status); | | UBool c
ommonlyUsed, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Return the functionally equivalent locale for the given | | * Return the functionally equivalent locale for the given | |
| * requested locale, with respect to given keyword, for the | | * requested locale, with respect to given keyword, for the | |
| * collation service. If two locales return the same result, then | | * collation service. If two locales return the same result, then | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 38 lines changed or added | |
|
| colldata.h | | colldata.h | |
| | | | |
| skipping to change at line 26 | | skipping to change at line 26 | |
| | | | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| | | | |
| #if !UCONFIG_NO_COLLATION | | #if !UCONFIG_NO_COLLATION | |
| | | | |
| #include "unicode/uobject.h" | | #include "unicode/uobject.h" | |
| #include "unicode/ucol.h" | | #include "unicode/ucol.h" | |
| | | | |
| U_NAMESPACE_BEGIN | | U_NAMESPACE_BEGIN | |
| | | | |
|
| /* | | /** | |
| * The size of the internal buffer for the Collator's short description str
ing. | | * The size of the internal buffer for the Collator's short description str
ing. | |
| */ | | */ | |
| #define KEY_BUFFER_SIZE 64 | | #define KEY_BUFFER_SIZE 64 | |
| | | | |
|
| /* | | /** | |
| * The size of the internal CE buffer in a <code>CEList</code> object | | * The size of the internal CE buffer in a <code>CEList</code> object | |
| */ | | */ | |
| #define CELIST_BUFFER_SIZE 4 | | #define CELIST_BUFFER_SIZE 4 | |
| | | | |
|
| /* | | /** | |
| * Define this to enable the <code>CEList</code> objects to collect | | * Define this to enable the <code>CEList</code> objects to collect | |
| * statistics. | | * statistics. | |
| */ | | */ | |
| //#define INSTRUMENT_CELIST | | //#define INSTRUMENT_CELIST | |
| | | | |
|
| /* | | /** | |
| * The size of the initial list in a <code>StringList</code> object. | | * The size of the initial list in a <code>StringList</code> object. | |
| */ | | */ | |
| #define STRING_LIST_BUFFER_SIZE 16 | | #define STRING_LIST_BUFFER_SIZE 16 | |
| | | | |
|
| /* | | /** | |
| * Define this to enable the <code>StringList</code> objects to | | * Define this to enable the <code>StringList</code> objects to | |
| * collect statistics. | | * collect statistics. | |
| */ | | */ | |
| //#define INSTRUMENT_STRING_LIST | | //#define INSTRUMENT_STRING_LIST | |
| | | | |
| /** | | /** | |
|
| * CEList | | | |
| * | | | |
| * This object holds a list of CEs generated from a particular | | * This object holds a list of CEs generated from a particular | |
| * <code>UnicodeString</code> | | * <code>UnicodeString</code> | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| class U_I18N_API CEList : public UObject | | class U_I18N_API CEList : public UObject | |
| { | | { | |
| public: | | public: | |
| /** | | /** | |
| * Construct a <code>CEList</code> object. | | * Construct a <code>CEList</code> object. | |
| | | | |
| skipping to change at line 108 | | skipping to change at line 106 | |
| * @return the CE, or <code>0</code> if <code>index</code> is out of ra
nge | | * @return the CE, or <code>0</code> if <code>index</code> is out of ra
nge | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| uint32_t get(int32_t index) const; | | uint32_t get(int32_t index) const; | |
| | | | |
| /** | | /** | |
| * Check if the CEs in another <code>CEList</code> match the | | * Check if the CEs in another <code>CEList</code> match the | |
| * suffix of this list starting at a give offset. | | * suffix of this list starting at a give offset. | |
| * | | * | |
|
| * @param offsset - the offset of the suffix | | * @param offset - the offset of the suffix | |
| * @param other - the other <code>CEList</code> | | * @param other - the other <code>CEList</code> | |
| * | | * | |
| * @return <code>TRUE</code> if the CEs match, <code>FALSE</code> other
wise. | | * @return <code>TRUE</code> if the CEs match, <code>FALSE</code> other
wise. | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| UBool matchesAt(int32_t offset, const CEList *other) const; | | UBool matchesAt(int32_t offset, const CEList *other) const; | |
| | | | |
| /** | | /** | |
| * The index operator. | | * The index operator. | |
| * | | * | |
| * @param index - the index | | * @param index - the index | |
| * | | * | |
| * @return a reference to the given CE in the list | | * @return a reference to the given CE in the list | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| uint32_t &operator[](int32_t index) const; | | uint32_t &operator[](int32_t index) const; | |
| | | | |
|
| /* | | /** | |
| * UObject glue... | | * UObject glue... | |
| */ | | */ | |
| virtual UClassID getDynamicClassID() const; | | virtual UClassID getDynamicClassID() const; | |
|
| | | /** | |
| | | * UObject glue... | |
| | | */ | |
| static UClassID getStaticClassID(); | | static UClassID getStaticClassID(); | |
| | | | |
| private: | | private: | |
| void add(uint32_t ce, UErrorCode &status); | | void add(uint32_t ce, UErrorCode &status); | |
| | | | |
| uint32_t ceBuffer[CELIST_BUFFER_SIZE]; | | uint32_t ceBuffer[CELIST_BUFFER_SIZE]; | |
| uint32_t *ces; | | uint32_t *ces; | |
| int32_t listMax; | | int32_t listMax; | |
| int32_t listSize; | | int32_t listSize; | |
| | | | |
| | | | |
| skipping to change at line 220 | | skipping to change at line 221 | |
| | | | |
| /** | | /** | |
| * Get the number of stings in the list. | | * Get the number of stings in the list. | |
| * | | * | |
| * @return the number of strings in the list. | | * @return the number of strings in the list. | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| int32_t size() const; | | int32_t size() const; | |
| | | | |
|
| /* | | /** | |
| * the UObject glue... | | * the UObject glue... | |
| */ | | */ | |
| virtual UClassID getDynamicClassID() const; | | virtual UClassID getDynamicClassID() const; | |
|
| | | /** | |
| | | * the UObject glue... | |
| | | */ | |
| static UClassID getStaticClassID(); | | static UClassID getStaticClassID(); | |
| | | | |
| private: | | private: | |
| UnicodeString *strings; | | UnicodeString *strings; | |
| int32_t listMax; | | int32_t listMax; | |
| int32_t listSize; | | int32_t listSize; | |
| | | | |
| #ifdef INSTRUMENT_STRING_LIST | | #ifdef INSTRUMENT_STRING_LIST | |
| static int32_t _lists; | | static int32_t _lists; | |
| static int32_t _strings; | | static int32_t _strings; | |
| | | | |
| skipping to change at line 329 | | skipping to change at line 333 | |
| * must call <code>freeCEList</code> when you are finished | | * must call <code>freeCEList</code> when you are finished | |
| * using the <code>CEList</code>/ | | * using the <code>CEList</code>/ | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview. | | * @internal ICU 4.0.1 technology preview. | |
| */ | | */ | |
| const CEList *getCEList(const UnicodeString *string) const; | | const CEList *getCEList(const UnicodeString *string) const; | |
| | | | |
| /** | | /** | |
| * Release a <code>CEList</code> returned by <code>getCEList</code>. | | * Release a <code>CEList</code> returned by <code>getCEList</code>. | |
| * | | * | |
|
| * @param list - the <CEList> to free. | | * @param list - the <code>CEList</code> to free. | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| void freeCEList(const CEList *list); | | void freeCEList(const CEList *list); | |
| | | | |
| /** | | /** | |
| * Return the length of the shortest string that will generate | | * Return the length of the shortest string that will generate | |
| * the given list of CEs. | | * the given list of CEs. | |
| * | | * | |
| * @param ces - the CEs | | * @param ces - the CEs | |
| | | | |
| skipping to change at line 360 | | skipping to change at line 364 | |
| * the given list of CEs. | | * the given list of CEs. | |
| * | | * | |
| * Note: the algorithm used to do this computation is recursive. To | | * Note: the algorithm used to do this computation is recursive. To | |
| * limit the amount of recursion, a "history" list is used to record | | * limit the amount of recursion, a "history" list is used to record | |
| * the best answer starting at a particular offset in the list of CEs. | | * the best answer starting at a particular offset in the list of CEs. | |
| * If the same offset is visited again during the recursion, the answer | | * If the same offset is visited again during the recursion, the answer | |
| * in the history list is used. | | * in the history list is used. | |
| * | | * | |
| * @param ces - the CEs | | * @param ces - the CEs | |
| * @param offset - the offset of the first CE in the list to use. | | * @param offset - the offset of the first CE in the list to use. | |
|
| * param history - the history list. Must be at least as long as | | * @param history - the history list. Must be at least as long as | |
| * the number of cEs in the <code>CEList</code> | | * the number of cEs in the <code>CEList</code> | |
| * | | * | |
| * @return the length of the shortest string. | | * @return the length of the shortest string. | |
| * | | * | |
| * @internal ICU 4.0.1 technology preview | | * @internal ICU 4.0.1 technology preview | |
| */ | | */ | |
| int32_t minLengthInChars(const CEList *ces, int32_t offset, int32_t *his
tory) const; | | int32_t minLengthInChars(const CEList *ces, int32_t offset, int32_t *his
tory) const; | |
| | | | |
|
| /* | | /** | |
| * UObject glue... | | * UObject glue... | |
| */ | | */ | |
| virtual UClassID getDynamicClassID() const; | | virtual UClassID getDynamicClassID() const; | |
|
| | | /** | |
| | | * UObject glue... | |
| | | */ | |
| static UClassID getStaticClassID(); | | static UClassID getStaticClassID(); | |
| | | | |
| /** | | /** | |
| * <code>CollData</code> objects are expensive to compute, and so | | * <code>CollData</code> objects are expensive to compute, and so | |
| * may be cached. This routine will free the cached objects and delete | | * may be cached. This routine will free the cached objects and delete | |
| * the cache. | | * the cache. | |
| * | | * | |
| * WARNING: Don't call this until you are have called <code>close</code
> | | * WARNING: Don't call this until you are have called <code>close</code
> | |
| * for each <code>CollData</code> object that you have used. also, | | * for each <code>CollData</code> object that you have used. also, | |
| * DO NOT call this if another thread may be calling <code>flushCollDat
aCache</code> | | * DO NOT call this if another thread may be calling <code>flushCollDat
aCache</code> | |
| | | | |
End of changes. 15 change blocks. |
| 13 lines changed or deleted | | 20 lines changed or added | |
|
| decimfmt.h | | decimfmt.h | |
| | | | |
| skipping to change at line 48 | | skipping to change at line 48 | |
| | | | |
| union UHashTok; | | union UHashTok; | |
| | | | |
| U_NAMESPACE_BEGIN | | U_NAMESPACE_BEGIN | |
| | | | |
| U_CDECL_BEGIN | | U_CDECL_BEGIN | |
| | | | |
| /** | | /** | |
| * @internal ICU 4.2 | | * @internal ICU 4.2 | |
| */ | | */ | |
|
| static UBool U_CALLCONV AffixValueComparator(UHashTok val1, UHashTok val2)
; | | UBool U_CALLCONV decimfmtAffixValueComparator(UHashTok val1, UHashTok val2)
; | |
| | | | |
| /** | | /** | |
| * @internal ICU 4.2 | | * @internal ICU 4.2 | |
| */ | | */ | |
|
| static UBool U_CALLCONV AffixPatternValueComparator(UHashTok val1, UHashTok
val2) ; | | UBool U_CALLCONV decimfmtAffixPatternValueComparator(UHashTok val1, UHashTo
k val2) ; | |
| | | | |
| U_CDECL_END | | U_CDECL_END | |
| | | | |
| class DigitList; | | class DigitList; | |
| class ChoiceFormat; | | class ChoiceFormat; | |
| class CurrencyPluralInfo; | | class CurrencyPluralInfo; | |
| class Hashtable; | | class Hashtable; | |
| | | | |
| /** | | /** | |
| * DecimalFormat is a concrete subclass of NumberFormat that formats decima
l | | * DecimalFormat is a concrete subclass of NumberFormat that formats decima
l | |
| | | | |
| skipping to change at line 735 | | skipping to change at line 735 | |
| * @param symbolsToAdopt the set of symbols to be used. The caller
should not | | * @param symbolsToAdopt the set of symbols to be used. The caller
should not | |
| * delete this object after making this call. | | * delete this object after making this call. | |
| * @param status Output param set to success/failure code. I
f the | | * @param status Output param set to success/failure code. I
f the | |
| * pattern is invalid this will be set to a fa
ilure code. | | * pattern is invalid this will be set to a fa
ilure code. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| DecimalFormat( const UnicodeString& pattern, | | DecimalFormat( const UnicodeString& pattern, | |
| DecimalFormatSymbols* symbolsToAdopt, | | DecimalFormatSymbols* symbolsToAdopt, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
|
| /* | | /** | |
| * This API is for ICU use only. | | * This API is for ICU use only. | |
| * Create a DecimalFormat from the given pattern, symbols, and style. | | * Create a DecimalFormat from the given pattern, symbols, and style. | |
| * | | * | |
| * @param pattern a non-localized pattern string | | * @param pattern a non-localized pattern string | |
| * @param symbolsToAdopt the set of symbols to be used. The caller
should not | | * @param symbolsToAdopt the set of symbols to be used. The caller
should not | |
| * delete this object after making this call. | | * delete this object after making this call. | |
| * @param style style of decimal format, kNumberStyle etc. | | * @param style style of decimal format, kNumberStyle etc. | |
| * @param status Output param set to success/failure code. I
f the | | * @param status Output param set to success/failure code. I
f the | |
| * pattern is invalid this will be set to a fa
ilure code. | | * pattern is invalid this will be set to a fa
ilure code. | |
| * @internal ICU 4.2 | | * @internal ICU 4.2 | |
| | | | |
| skipping to change at line 1734 | | skipping to change at line 1734 | |
| * clone() methods call this method. | | * clone() methods call this method. | |
| * | | * | |
| * @return The class ID for this object. All objects of a | | * @return The class ID for this object. All objects of a | |
| * given class have the same class ID. Objects of | | * given class have the same class ID. Objects of | |
| * other classes have different class IDs. | | * other classes have different class IDs. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| virtual UClassID getDynamicClassID(void) const; | | virtual UClassID getDynamicClassID(void) const; | |
| | | | |
| private: | | private: | |
|
| friend UBool U_CALLCONV AffixValueComparator(UHashTok val1, UHashTok va | | friend UBool U_CALLCONV decimfmtAffixValueComparator(UHashTok val1, UHa | |
| l2); | | shTok val2); | |
| friend UBool U_CALLCONV AffixPatternValueComparator(UHashTok val1, UHas | | friend UBool U_CALLCONV decimfmtAffixPatternValueComparator(UHashTok va | |
| hTok val2); | | l1, UHashTok val2); | |
| | | | |
| DecimalFormat(); // default constructor not implemented | | DecimalFormat(); // default constructor not implemented | |
| | | | |
| int32_t precision(UBool isIntegral) const; | | int32_t precision(UBool isIntegral) const; | |
| | | | |
| /** | | /** | |
| * Do real work of constructing a new DecimalFormat. | | * Do real work of constructing a new DecimalFormat. | |
| */ | | */ | |
| void construct(UErrorCode& status, | | void construct(UErrorCode& status, | |
| UParseError& parseErr, | | UParseError& parseErr, | |
| | | | |
| skipping to change at line 1829 | | skipping to change at line 1829 | |
| fgStatusInfinite, | | fgStatusInfinite, | |
| fgStatusLength // Leave last in list. | | fgStatusLength // Leave last in list. | |
| } StatusFlags; | | } StatusFlags; | |
| | | | |
| UBool subparse(const UnicodeString& text, | | UBool subparse(const UnicodeString& text, | |
| const UnicodeString* negPrefix, | | const UnicodeString* negPrefix, | |
| const UnicodeString* negSuffix, | | const UnicodeString* negSuffix, | |
| const UnicodeString* posPrefix, | | const UnicodeString* posPrefix, | |
| const UnicodeString* posSuffix, | | const UnicodeString* posSuffix, | |
| UBool currencyParsing, | | UBool currencyParsing, | |
|
| | | int8_t type, | |
| ParsePosition& parsePosition, | | ParsePosition& parsePosition, | |
| DigitList& digits, UBool* status, | | DigitList& digits, UBool* status, | |
| UChar* currency) const; | | UChar* currency) const; | |
| | | | |
| // Mixed style parsing for currency. | | // Mixed style parsing for currency. | |
| // It parses against the current currency pattern | | // It parses against the current currency pattern | |
| // using complex affix comparison | | // using complex affix comparison | |
| // parses against the currency plural patterns using complex affix comp
arison, | | // parses against the currency plural patterns using complex affix comp
arison, | |
| // and parses against the current pattern using simple affix comparison
. | | // and parses against the current pattern using simple affix comparison
. | |
| UBool parseForCurrency(const UnicodeString& text, | | UBool parseForCurrency(const UnicodeString& text, | |
| | | | |
| skipping to change at line 1852 | | skipping to change at line 1853 | |
| UChar* currency) const; | | UChar* currency) const; | |
| | | | |
| int32_t skipPadding(const UnicodeString& text, int32_t position) const; | | int32_t skipPadding(const UnicodeString& text, int32_t position) const; | |
| | | | |
| int32_t compareAffix(const UnicodeString& input, | | int32_t compareAffix(const UnicodeString& input, | |
| int32_t pos, | | int32_t pos, | |
| UBool isNegative, | | UBool isNegative, | |
| UBool isPrefix, | | UBool isPrefix, | |
| const UnicodeString* affixPat, | | const UnicodeString* affixPat, | |
| UBool currencyParsing, | | UBool currencyParsing, | |
|
| | | int8_t type, | |
| UChar* currency) const; | | UChar* currency) const; | |
| | | | |
| static int32_t compareSimpleAffix(const UnicodeString& affix, | | static int32_t compareSimpleAffix(const UnicodeString& affix, | |
| const UnicodeString& input, | | const UnicodeString& input, | |
| int32_t pos); | | int32_t pos); | |
| | | | |
| static int32_t skipRuleWhiteSpace(const UnicodeString& text, int32_t po
s); | | static int32_t skipRuleWhiteSpace(const UnicodeString& text, int32_t po
s); | |
| | | | |
| static int32_t skipUWhiteSpace(const UnicodeString& text, int32_t pos); | | static int32_t skipUWhiteSpace(const UnicodeString& text, int32_t pos); | |
| | | | |
| int32_t compareComplexAffix(const UnicodeString& affixPat, | | int32_t compareComplexAffix(const UnicodeString& affixPat, | |
| const UnicodeString& input, | | const UnicodeString& input, | |
| int32_t pos, | | int32_t pos, | |
|
| | | int8_t type, | |
| UChar* currency) const; | | UChar* currency) const; | |
| | | | |
| static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch
); | | static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch
); | |
| | | | |
| static int32_t match(const UnicodeString& text, int32_t pos, const Unic
odeString& str); | | static int32_t match(const UnicodeString& text, int32_t pos, const Unic
odeString& str); | |
| | | | |
| /** | | /** | |
| * Get a decimal format symbol. | | * Get a decimal format symbol. | |
| * Returns a const reference to the symbol string. | | * Returns a const reference to the symbol string. | |
| * @internal | | * @internal | |
| | | | |
| skipping to change at line 2037 | | skipping to change at line 2040 | |
| // TODO: innerclass? | | // TODO: innerclass? | |
| struct AffixPatternsForCurrency : public UMemory { | | struct AffixPatternsForCurrency : public UMemory { | |
| // negative prefix pattern | | // negative prefix pattern | |
| UnicodeString negPrefixPatternForCurrency; | | UnicodeString negPrefixPatternForCurrency; | |
| // negative suffix pattern | | // negative suffix pattern | |
| UnicodeString negSuffixPatternForCurrency; | | UnicodeString negSuffixPatternForCurrency; | |
| // positive prefix pattern | | // positive prefix pattern | |
| UnicodeString posPrefixPatternForCurrency; | | UnicodeString posPrefixPatternForCurrency; | |
| // positive suffix pattern | | // positive suffix pattern | |
| UnicodeString posSuffixPatternForCurrency; | | UnicodeString posSuffixPatternForCurrency; | |
|
| | | int8_t patternType; | |
| | | | |
| AffixPatternsForCurrency(const UnicodeString& negPrefix, | | AffixPatternsForCurrency(const UnicodeString& negPrefix, | |
| const UnicodeString& negSuffix, | | const UnicodeString& negSuffix, | |
| const UnicodeString& posPrefix, | | const UnicodeString& posPrefix, | |
|
| const UnicodeString& posSuffix) { | | const UnicodeString& posSuffix, | |
| | | int8_t type) { | |
| negPrefixPatternForCurrency = negPrefix; | | negPrefixPatternForCurrency = negPrefix; | |
| negSuffixPatternForCurrency = negSuffix; | | negSuffixPatternForCurrency = negSuffix; | |
| posPrefixPatternForCurrency = posPrefix; | | posPrefixPatternForCurrency = posPrefix; | |
| posSuffixPatternForCurrency = posSuffix; | | posSuffixPatternForCurrency = posSuffix; | |
|
| | | patternType = type; | |
| } | | } | |
| }; | | }; | |
| | | | |
| /* affix for currency formatting when the currency sign in the pattern | | /* affix for currency formatting when the currency sign in the pattern | |
| * equals to 3, such as the pattern contains 3 currency sign or | | * equals to 3, such as the pattern contains 3 currency sign or | |
| * the formatter style is currency plural format style. | | * the formatter style is currency plural format style. | |
| */ | | */ | |
| struct AffixesForCurrency : public UMemory { | | struct AffixesForCurrency : public UMemory { | |
| // negative prefix | | // negative prefix | |
| UnicodeString negPrefixForCurrency; | | UnicodeString negPrefixForCurrency; | |
| | | | |
End of changes. 10 change blocks. |
| 8 lines changed or deleted | | 14 lines changed or added | |
|
| dtitvfmt.h | | dtitvfmt.h | |
| /**************************************************************************
****** | | /**************************************************************************
****** | |
|
| * Copyright (C) 2008, International Business Machines Corporation and other
s. All Rights Reserved. | | * Copyright (C) 2008-2009, International Business Machines Corporation and
others. All Rights Reserved. | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
| * File DTITVFMT.H | | * File DTITVFMT.H | |
| * | | * | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| */ | | */ | |
| | | | |
| #ifndef __DTITVFMT_H__ | | #ifndef __DTITVFMT_H__ | |
| #define __DTITVFMT_H__ | | #define __DTITVFMT_H__ | |
| | | | |
| | | | |
| skipping to change at line 229 | | skipping to change at line 229 | |
| * Construct a DateIntervalFormat from skeleton and the default locale
. | | * Construct a DateIntervalFormat from skeleton and the default locale
. | |
| * | | * | |
| * This is a convenient override of | | * This is a convenient override of | |
| * createInstance(const UnicodeString& skeleton, const Locale& locale, | | * createInstance(const UnicodeString& skeleton, const Locale& locale, | |
| * UErrorCode&) | | * UErrorCode&) | |
| * with the value of locale as default locale. | | * with the value of locale as default locale. | |
| * | | * | |
| * @param skeleton the skeleton on which interval format based. | | * @param skeleton the skeleton on which interval format based. | |
| * @param status output param set to success/failure code on exit | | * @param status output param set to success/failure code on exit | |
| * @return a date time interval formatter which the caller own
s. | | * @return a date time interval formatter which the caller own
s. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| static DateIntervalFormat* U_EXPORT2 createInstance( | | static DateIntervalFormat* U_EXPORT2 createInstance( | |
| const UnicodeString& skeleto
n, | | const UnicodeString& skeleto
n, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Construct a DateIntervalFormat from skeleton and a given locale. | | * Construct a DateIntervalFormat from skeleton and a given locale. | |
| * <P> | | * <P> | |
| * In this factory method, | | * In this factory method, | |
| * the date interval pattern information is load from resource files. | | * the date interval pattern information is load from resource files. | |
| | | | |
| skipping to change at line 261 | | skipping to change at line 261 | |
| * For example, for en_GB, if skeleton is UDAT_YEAR_ABBR_MONTH_WEEKDAY_
DAY, | | * For example, for en_GB, if skeleton is UDAT_YEAR_ABBR_MONTH_WEEKDAY_
DAY, | |
| * which is "yMMMEEEd", | | * which is "yMMMEEEd", | |
| * the interval patterns defined in resource file to above skeleton are
: | | * the interval patterns defined in resource file to above skeleton are
: | |
| * "EEE, d MMM, yyyy - EEE, d MMM, yyyy" for year differs, | | * "EEE, d MMM, yyyy - EEE, d MMM, yyyy" for year differs, | |
| * "EEE, d MMM - EEE, d MMM, yyyy" for month differs, | | * "EEE, d MMM - EEE, d MMM, yyyy" for month differs, | |
| * "EEE, d - EEE, d MMM, yyyy" for day differs, | | * "EEE, d - EEE, d MMM, yyyy" for day differs, | |
| * @param skeleton the skeleton on which interval format based. | | * @param skeleton the skeleton on which interval format based. | |
| * @param locale the given locale | | * @param locale the given locale | |
| * @param status output param set to success/failure code on exit | | * @param status output param set to success/failure code on exit | |
| * @return a date time interval formatter which the caller own
s. | | * @return a date time interval formatter which the caller own
s. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| | | | |
| static DateIntervalFormat* U_EXPORT2 createInstance( | | static DateIntervalFormat* U_EXPORT2 createInstance( | |
| const UnicodeString& skeleto
n, | | const UnicodeString& skeleto
n, | |
| const Locale& locale, | | const Locale& locale, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Construct a DateIntervalFormat from skeleton | | * Construct a DateIntervalFormat from skeleton | |
| * DateIntervalInfo, and default locale. | | * DateIntervalInfo, and default locale. | |
| * | | * | |
| * This is a convenient override of | | * This is a convenient override of | |
| * createInstance(const UnicodeString& skeleton, const Locale& locale, | | * createInstance(const UnicodeString& skeleton, const Locale& locale, | |
| * const DateIntervalInfo& dtitvinf, UErrorCode&) | | * const DateIntervalInfo& dtitvinf, UErrorCode&) | |
| * with the locale value as default locale. | | * with the locale value as default locale. | |
| * | | * | |
| * @param skeleton the skeleton on which interval format based. | | * @param skeleton the skeleton on which interval format based. | |
| * @param dtitvinf the DateIntervalInfo object. | | * @param dtitvinf the DateIntervalInfo object. | |
| * @param status output param set to success/failure code on exit | | * @param status output param set to success/failure code on exit | |
| * @return a date time interval formatter which the caller own
s. | | * @return a date time interval formatter which the caller own
s. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| static DateIntervalFormat* U_EXPORT2 createInstance( | | static DateIntervalFormat* U_EXPORT2 createInstance( | |
| const UnicodeString& skeleton
, | | const UnicodeString& skeleton
, | |
| const DateIntervalInfo& dtitv
inf, | | const DateIntervalInfo& dtitv
inf, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Construct a DateIntervalFormat from skeleton | | * Construct a DateIntervalFormat from skeleton | |
| * a DateIntervalInfo, and the given locale. | | * a DateIntervalInfo, and the given locale. | |
| * | | * | |
| | | | |
| skipping to change at line 322 | | skipping to change at line 322 | |
| * field is not found ( if user not set it ), interval format fallback
to | | * field is not found ( if user not set it ), interval format fallback
to | |
| * the default interval pattern. | | * the default interval pattern. | |
| * If user does not provide default interval pattern, it fallback to | | * If user does not provide default interval pattern, it fallback to | |
| * "{date0} - {date1}" | | * "{date0} - {date1}" | |
| * | | * | |
| * @param skeleton the skeleton on which interval format based. | | * @param skeleton the skeleton on which interval format based. | |
| * @param locale the given locale | | * @param locale the given locale | |
| * @param dtitvinf the DateIntervalInfo object. | | * @param dtitvinf the DateIntervalInfo object. | |
| * @param status output param set to success/failure code on exit | | * @param status output param set to success/failure code on exit | |
| * @return a date time interval formatter which the caller own
s. | | * @return a date time interval formatter which the caller own
s. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| static DateIntervalFormat* U_EXPORT2 createInstance( | | static DateIntervalFormat* U_EXPORT2 createInstance( | |
| const UnicodeString& skeleton
, | | const UnicodeString& skeleton
, | |
| const Locale& locale, | | const Locale& locale, | |
| const DateIntervalInfo& dtitv
inf, | | const DateIntervalInfo& dtitv
inf, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual ~DateIntervalFormat(); | | virtual ~DateIntervalFormat(); | |
| | | | |
| /** | | /** | |
| * Clone this Format object polymorphically. The caller owns the result
and | | * Clone this Format object polymorphically. The caller owns the result
and | |
| * should delete it when done. | | * should delete it when done. | |
| * @return A copy of the object. | | * @return A copy of the object. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual Format* clone(void) const; | | virtual Format* clone(void) const; | |
| | | | |
| /** | | /** | |
| * Return true if the given Format objects are semantically equal. Obje
cts | | * Return true if the given Format objects are semantically equal. Obje
cts | |
| * of different subclasses are considered unequal. | | * of different subclasses are considered unequal. | |
| * @param other the object to be compared with. | | * @param other the object to be compared with. | |
| * @return true if the given Format objects are semantically eq
ual. | | * @return true if the given Format objects are semantically eq
ual. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UBool operator==(const Format& other) const; | | virtual UBool operator==(const Format& other) const; | |
| | | | |
| /** | | /** | |
| * Return true if the given Format objects are not semantically equal. | | * Return true if the given Format objects are not semantically equal. | |
| * Objects of different subclasses are considered unequal. | | * Objects of different subclasses are considered unequal. | |
| * @param other the object to be compared with. | | * @param other the object to be compared with. | |
| * @return true if the given Format objects are not semantically e
qual. | | * @return true if the given Format objects are not semantically e
qual. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UBool operator!=(const Format& other) const; | | UBool operator!=(const Format& other) const; | |
| | | | |
| /** | | /** | |
| * Format an object to produce a string. This method handles Formattabl
e | | * Format an object to produce a string. This method handles Formattabl
e | |
| * objects with a DateInterval type. | | * objects with a DateInterval type. | |
| * If a the Formattable object type is not a DateInterval, | | * If a the Formattable object type is not a DateInterval, | |
| * then it returns a failing UErrorCode. | | * then it returns a failing UErrorCode. | |
| * | | * | |
| * @param obj The object to format. | | * @param obj The object to format. | |
| * Must be a DateInterval. | | * Must be a DateInterval. | |
| * @param appendTo Output parameter to receive result. | | * @param appendTo Output parameter to receive result. | |
| * Result is appended to existing contents. | | * Result is appended to existing contents. | |
| * @param fieldPosition On input: an alignment field, if desired. | | * @param fieldPosition On input: an alignment field, if desired. | |
| * On output: the offsets of the alignment fie
ld. | | * On output: the offsets of the alignment fie
ld. | |
| * @param status Output param filled with success/failure st
atus. | | * @param status Output param filled with success/failure st
atus. | |
| * @return Reference to 'appendTo' parameter. | | * @return Reference to 'appendTo' parameter. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UnicodeString& format(const Formattable& obj, | | virtual UnicodeString& format(const Formattable& obj, | |
| UnicodeString& appendTo, | | UnicodeString& appendTo, | |
| FieldPosition& fieldPosition, | | FieldPosition& fieldPosition, | |
| UErrorCode& status) const ; | | UErrorCode& status) const ; | |
| | | | |
| /** | | /** | |
| * Format a DateInterval to produce a string. | | * Format a DateInterval to produce a string. | |
| * | | * | |
| * @param dtInterval DateInterval to be formatted. | | * @param dtInterval DateInterval to be formatted. | |
| * @param appendTo Output parameter to receive result. | | * @param appendTo Output parameter to receive result. | |
| * Result is appended to existing contents. | | * Result is appended to existing contents. | |
| * @param fieldPosition On input: an alignment field, if desired. | | * @param fieldPosition On input: an alignment field, if desired. | |
| * On output: the offsets of the alignment fie
ld. | | * On output: the offsets of the alignment fie
ld. | |
| * @param status Output param filled with success/failure st
atus. | | * @param status Output param filled with success/failure st
atus. | |
| * @return Reference to 'appendTo' parameter. | | * @return Reference to 'appendTo' parameter. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString& format(const DateInterval* dtInterval, | | UnicodeString& format(const DateInterval* dtInterval, | |
| UnicodeString& appendTo, | | UnicodeString& appendTo, | |
| FieldPosition& fieldPosition, | | FieldPosition& fieldPosition, | |
| UErrorCode& status) const ; | | UErrorCode& status) const ; | |
| | | | |
| /** | | /** | |
| * Format 2 Calendars to produce a string. | | * Format 2 Calendars to produce a string. | |
| * | | * | |
| * Note: "fromCalendar" and "toCalendar" are not const, | | * Note: "fromCalendar" and "toCalendar" are not const, | |
| | | | |
| skipping to change at line 418 | | skipping to change at line 418 | |
| * @param toCalendar calendar set to the to date in date interva
l | | * @param toCalendar calendar set to the to date in date interva
l | |
| * to be formatted into date interval string | | * to be formatted into date interval string | |
| * @param appendTo Output parameter to receive result. | | * @param appendTo Output parameter to receive result. | |
| * Result is appended to existing contents. | | * Result is appended to existing contents. | |
| * @param fieldPosition On input: an alignment field, if desired. | | * @param fieldPosition On input: an alignment field, if desired. | |
| * On output: the offsets of the alignment fie
ld. | | * On output: the offsets of the alignment fie
ld. | |
| * @param status Output param filled with success/failure st
atus. | | * @param status Output param filled with success/failure st
atus. | |
| * Caller needs to make sure it is SUCCESS | | * Caller needs to make sure it is SUCCESS | |
| * at the function entrance | | * at the function entrance | |
| * @return Reference to 'appendTo' parameter. | | * @return Reference to 'appendTo' parameter. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString& format(Calendar& fromCalendar, | | UnicodeString& format(Calendar& fromCalendar, | |
| Calendar& toCalendar, | | Calendar& toCalendar, | |
| UnicodeString& appendTo, | | UnicodeString& appendTo, | |
| FieldPosition& fieldPosition, | | FieldPosition& fieldPosition, | |
| UErrorCode& status) const ; | | UErrorCode& status) const ; | |
| | | | |
| /** | | /** | |
| * Date interval parsing is not supported. Please do not use. | | * Date interval parsing is not supported. Please do not use. | |
| * <P> | | * <P> | |
| | | | |
| skipping to change at line 460 | | skipping to change at line 460 | |
| * @internal ICU 4.0 | | * @internal ICU 4.0 | |
| */ | | */ | |
| virtual void parseObject(const UnicodeString& source, | | virtual void parseObject(const UnicodeString& source, | |
| Formattable& result, | | Formattable& result, | |
| ParsePosition& parse_pos) const; | | ParsePosition& parse_pos) const; | |
| | | | |
| /** | | /** | |
| * Gets the date time interval patterns. | | * Gets the date time interval patterns. | |
| * @return the date time interval patterns associated with | | * @return the date time interval patterns associated with | |
| * this date interval formatter. | | * this date interval formatter. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| const DateIntervalInfo* getDateIntervalInfo(void) const; | | const DateIntervalInfo* getDateIntervalInfo(void) const; | |
| | | | |
| /** | | /** | |
| * Set the date time interval patterns. | | * Set the date time interval patterns. | |
| * @param newIntervalPatterns the given interval patterns to copy. | | * @param newIntervalPatterns the given interval patterns to copy. | |
| * @param status output param set to success/failure code on e
xit | | * @param status output param set to success/failure code on e
xit | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| void setDateIntervalInfo(const DateIntervalInfo& newIntervalPatterns, | | void setDateIntervalInfo(const DateIntervalInfo& newIntervalPatterns, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Gets the date formatter | | * Gets the date formatter | |
| * @return the date formatter associated with this date interval format
ter. | | * @return the date formatter associated with this date interval format
ter. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| const DateFormat* getDateFormat(void) const; | | const DateFormat* getDateFormat(void) const; | |
| | | | |
| /** | | /** | |
| * Return the class ID for this class. This is useful only for comparin
g to | | * Return the class ID for this class. This is useful only for comparin
g to | |
| * a return value from getDynamicClassID(). For example: | | * a return value from getDynamicClassID(). For example: | |
| * <pre> | | * <pre> | |
| * . Base* polymorphic_pointer = createPolymorphicObject(); | | * . Base* polymorphic_pointer = createPolymorphicObject(); | |
| * . if (polymorphic_pointer->getDynamicClassID() == | | * . if (polymorphic_pointer->getDynamicClassID() == | |
| * . erived::getStaticClassID()) ... | | * . erived::getStaticClassID()) ... | |
| * </pre> | | * </pre> | |
| * @return The class ID for all objects of this class. | | * @return The class ID for all objects of this class. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| static UClassID U_EXPORT2 getStaticClassID(void); | | static UClassID U_EXPORT2 getStaticClassID(void); | |
| | | | |
| /** | | /** | |
| * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. Th
is | | * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. Th
is | |
| * method is to implement a simple version of RTTI, since not all C++ | | * method is to implement a simple version of RTTI, since not all C++ | |
| * compilers support genuine RTTI. Polymorphic operator==() and clone() | | * compilers support genuine RTTI. Polymorphic operator==() and clone() | |
| * methods call this method. | | * methods call this method. | |
| * | | * | |
| * @return The class ID for this object. All objects of a | | * @return The class ID for this object. All objects of a | |
| * given class have the same class ID. Objects of | | * given class have the same class ID. Objects of | |
| * other classes have different class IDs. | | * other classes have different class IDs. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UClassID getDynamicClassID(void) const; | | virtual UClassID getDynamicClassID(void) const; | |
| | | | |
| protected: | | protected: | |
| | | | |
| /** | | /** | |
| * Copy constructor. | | * Copy constructor. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| DateIntervalFormat(const DateIntervalFormat&); | | DateIntervalFormat(const DateIntervalFormat&); | |
| | | | |
| /** | | /** | |
| * Assignment operator. | | * Assignment operator. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| DateIntervalFormat& operator=(const DateIntervalFormat&); | | DateIntervalFormat& operator=(const DateIntervalFormat&); | |
| | | | |
| private: | | private: | |
| | | | |
| /* | | /* | |
| * This is for ICU internal use only. Please do not use. | | * This is for ICU internal use only. Please do not use. | |
| * Save the interval pattern information. | | * Save the interval pattern information. | |
| * Interval pattern consists of 2 single date patterns and the separato
r. | | * Interval pattern consists of 2 single date patterns and the separato
r. | |
| * For example, interval pattern "MMM d - MMM d, yyyy" consists | | * For example, interval pattern "MMM d - MMM d, yyyy" consists | |
| | | | |
End of changes. 19 change blocks. |
| 19 lines changed or deleted | | 19 lines changed or added | |
|
| dtitvinf.h | | dtitvinf.h | |
| /* | | /* | |
| **************************************************************************
***** | | **************************************************************************
***** | |
|
| * Copyright (C) 2008, International Business Machines Corporation and | | * Copyright (C) 2008-2009, International Business Machines Corporation and | |
| * others. All Rights Reserved. | | * others. All Rights Reserved. | |
| **************************************************************************
***** | | **************************************************************************
***** | |
| * | | * | |
| * File DTITVINF.H | | * File DTITVINF.H | |
| * | | * | |
| **************************************************************************
***** | | **************************************************************************
***** | |
| */ | | */ | |
| | | | |
| #ifndef __DTITVINF_H__ | | #ifndef __DTITVINF_H__ | |
| #define __DTITVINF_H__ | | #define __DTITVINF_H__ | |
| | | | |
| skipping to change at line 43 | | skipping to change at line 43 | |
| | | | |
| union UHashTok; | | union UHashTok; | |
| | | | |
| U_NAMESPACE_BEGIN | | U_NAMESPACE_BEGIN | |
| | | | |
| U_CDECL_BEGIN | | U_CDECL_BEGIN | |
| | | | |
| /** | | /** | |
| * @internal ICU 4.0 | | * @internal ICU 4.0 | |
| */ | | */ | |
|
| static UBool U_CALLCONV hashTableValueComparator(UHashTok val1, UHashTok va
l2) ; | | UBool U_CALLCONV dtitvinfHashTableValueComparator(UHashTok val1, UHashTok v
al2) ; | |
| | | | |
| U_CDECL_END | | U_CDECL_END | |
| | | | |
| /** | | /** | |
| * DateIntervalInfo is a public class for encapsulating localizable | | * DateIntervalInfo is a public class for encapsulating localizable | |
| * date time interval patterns. It is used by DateIntervalFormat. | | * date time interval patterns. It is used by DateIntervalFormat. | |
| * | | * | |
| * <P> | | * <P> | |
| * For most users, ordinary use of DateIntervalFormat does not need to crea
te | | * For most users, ordinary use of DateIntervalFormat does not need to crea
te | |
| * DateIntervalInfo object directly. | | * DateIntervalInfo object directly. | |
| | | | |
| skipping to change at line 163 | | skipping to change at line 163 | |
| * DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, and MINUTE. | | * DAY_OF_WEEK, AM_PM, HOUR, HOUR_OF_DAY, and MINUTE. | |
| * Interval patterns when other calendar fields are different is not suppor
ted. | | * Interval patterns when other calendar fields are different is not suppor
ted. | |
| * <P> | | * <P> | |
| * DateIntervalInfo objects are cloneable. | | * DateIntervalInfo objects are cloneable. | |
| * When clients obtain a DateIntervalInfo object, | | * When clients obtain a DateIntervalInfo object, | |
| * they can feel free to modify it as necessary. | | * they can feel free to modify it as necessary. | |
| * <P> | | * <P> | |
| * DateIntervalInfo are not expected to be subclassed. | | * DateIntervalInfo are not expected to be subclassed. | |
| * Data for a calendar is loaded out of resource bundles. | | * Data for a calendar is loaded out of resource bundles. | |
| * To ICU 4.0, date interval patterns are only supported in Gregorian calen
dar. | | * To ICU 4.0, date interval patterns are only supported in Gregorian calen
dar. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| **/ | | **/ | |
| | | | |
| class U_I18N_API DateIntervalInfo : public UObject { | | class U_I18N_API DateIntervalInfo : public UObject { | |
| public: | | public: | |
| /** | | /** | |
| * Default constructor. | | * Default constructor. | |
| * It does not initialize any interval patterns except | | * It does not initialize any interval patterns except | |
| * that it initialize default fall-back pattern as "{0} - {1}", | | * that it initialize default fall-back pattern as "{0} - {1}", | |
| * which can be reset by setFallbackIntervalPattern(). | | * which can be reset by setFallbackIntervalPattern(). | |
| * It should be followed by setFallbackIntervalPattern() and | | * It should be followed by setFallbackIntervalPattern() and | |
| | | | |
| skipping to change at line 188 | | skipping to change at line 188 | |
| * @param status output param set to success/failure code on exit | | * @param status output param set to success/failure code on exit | |
| * @internal ICU 4.0 | | * @internal ICU 4.0 | |
| */ | | */ | |
| DateIntervalInfo(UErrorCode& status); | | DateIntervalInfo(UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Construct DateIntervalInfo for the given locale, | | * Construct DateIntervalInfo for the given locale, | |
| * @param locale the interval patterns are loaded from the Gregorian | | * @param locale the interval patterns are loaded from the Gregorian | |
| * calendar data in this locale. | | * calendar data in this locale. | |
| * @param status output param set to success/failure code on exit | | * @param status output param set to success/failure code on exit | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| DateIntervalInfo(const Locale& locale, UErrorCode& status); | | DateIntervalInfo(const Locale& locale, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Copy constructor. | | * Copy constructor. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| DateIntervalInfo(const DateIntervalInfo&); | | DateIntervalInfo(const DateIntervalInfo&); | |
| | | | |
| /** | | /** | |
| * Assignment operator | | * Assignment operator | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| DateIntervalInfo& operator=(const DateIntervalInfo&); | | DateIntervalInfo& operator=(const DateIntervalInfo&); | |
| | | | |
| /** | | /** | |
| * Clone this object polymorphically. | | * Clone this object polymorphically. | |
| * The caller owns the result and should delete it when done. | | * The caller owns the result and should delete it when done. | |
| * @return a copy of the object | | * @return a copy of the object | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual DateIntervalInfo* clone(void) const; | | virtual DateIntervalInfo* clone(void) const; | |
| | | | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
| * It is virtual to be safe, but it is not designed to be subclassed. | | * It is virtual to be safe, but it is not designed to be subclassed. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual ~DateIntervalInfo(); | | virtual ~DateIntervalInfo(); | |
| | | | |
| /** | | /** | |
| * Return true if another object is semantically equal to this one. | | * Return true if another object is semantically equal to this one. | |
| * | | * | |
| * @param other the DateIntervalInfo object to be compared with. | | * @param other the DateIntervalInfo object to be compared with. | |
| * @return true if other is semantically equal to this. | | * @return true if other is semantically equal to this. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| | | | |
| skipping to change at line 267 | | skipping to change at line 267 | |
| * not supported. | | * not supported. | |
| * | | * | |
| * @param skeleton the skeleton on which interval pattern based | | * @param skeleton the skeleton on which interval pattern based | |
| * @param lrgDiffCalUnit the largest different calendar unit. | | * @param lrgDiffCalUnit the largest different calendar unit. | |
| * @param intervalPattern the interval pattern on the largest differen
t | | * @param intervalPattern the interval pattern on the largest differen
t | |
| * calendar unit. | | * calendar unit. | |
| * For example, if lrgDiffCalUnit is | | * For example, if lrgDiffCalUnit is | |
| * "year", the interval pattern for en_US when
year | | * "year", the interval pattern for en_US when
year | |
| * is different could be "'from' yyyy 'to' yyyy
". | | * is different could be "'from' yyyy 'to' yyyy
". | |
| * @param status output param set to success/failure code on
exit | | * @param status output param set to success/failure code on
exit | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| void setIntervalPattern(const UnicodeString& skeleton, | | void setIntervalPattern(const UnicodeString& skeleton, | |
| UCalendarDateFields lrgDiffCalUnit, | | UCalendarDateFields lrgDiffCalUnit, | |
| const UnicodeString& intervalPattern, | | const UnicodeString& intervalPattern, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Get the interval pattern given skeleton and | | * Get the interval pattern given skeleton and | |
| * the largest different calendar field. | | * the largest different calendar field. | |
| * @param skeleton the skeleton | | * @param skeleton the skeleton | |
| * @param field the largest different calendar field | | * @param field the largest different calendar field | |
| * @param result output param to receive the pattern | | * @param result output param to receive the pattern | |
| * @param status output param set to success/failure code on exit | | * @param status output param set to success/failure code on exit | |
| * @return a reference to 'result' | | * @return a reference to 'result' | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString& getIntervalPattern(const UnicodeString& skeleton, | | UnicodeString& getIntervalPattern(const UnicodeString& skeleton, | |
| UCalendarDateFields field, | | UCalendarDateFields field, | |
| UnicodeString& result, | | UnicodeString& result, | |
| UErrorCode& status) const; | | UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
| * Get the fallback interval pattern. | | * Get the fallback interval pattern. | |
| * @param result output param to receive the pattern | | * @param result output param to receive the pattern | |
| * @return a reference to 'result' | | * @return a reference to 'result' | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString& getFallbackIntervalPattern(UnicodeString& result) const; | | UnicodeString& getFallbackIntervalPattern(UnicodeString& result) const; | |
| | | | |
| /** | | /** | |
| * Re-set the fallback interval pattern. | | * Re-set the fallback interval pattern. | |
| * | | * | |
| * In construction, default fallback pattern is set as "{0} - {1}". | | * In construction, default fallback pattern is set as "{0} - {1}". | |
| * And constructor taking locale as parameter will set the | | * And constructor taking locale as parameter will set the | |
| * fallback pattern as what defined in the locale resource file. | | * fallback pattern as what defined in the locale resource file. | |
| * | | * | |
| * This method provides a way for user to replace the fallback pattern. | | * This method provides a way for user to replace the fallback pattern. | |
| * | | * | |
| * @param fallbackPattern fall-back interval pattern. | | * @param fallbackPattern fall-back interval pattern. | |
| * @param status output param set to success/failure code on
exit | | * @param status output param set to success/failure code on
exit | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| void setFallbackIntervalPattern(const UnicodeString& fallbackPattern, | | void setFallbackIntervalPattern(const UnicodeString& fallbackPattern, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** Get default order -- whether the first date in pattern is later dat
e | | /** Get default order -- whether the first date in pattern is later dat
e | |
| or not. | | or not. | |
| * return default date ordering in interval pattern. TRUE if the first
date | | * return default date ordering in interval pattern. TRUE if the first
date | |
| * in pattern is later date, FALSE otherwise. | | * in pattern is later date, FALSE otherwise. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UBool getDefaultOrder() const; | | UBool getDefaultOrder() const; | |
| | | | |
| /** | | /** | |
| * ICU "poor man's RTTI", returns a UClassID for the actual class. | | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
| * | | * | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UClassID getDynamicClassID() const; | | virtual UClassID getDynamicClassID() const; | |
| | | | |
| | | | |
| skipping to change at line 346 | | skipping to change at line 346 | |
| /** | | /** | |
| * DateIntervalFormat will need access to | | * DateIntervalFormat will need access to | |
| * getBestSkeleton(), parseSkeleton(), enum IntervalPatternIndex, | | * getBestSkeleton(), parseSkeleton(), enum IntervalPatternIndex, | |
| * and calendarFieldToPatternIndex(). | | * and calendarFieldToPatternIndex(). | |
| * | | * | |
| * Instead of making above public, | | * Instead of making above public, | |
| * make DateIntervalFormat a friend of DateIntervalInfo. | | * make DateIntervalFormat a friend of DateIntervalInfo. | |
| */ | | */ | |
| friend class DateIntervalFormat; | | friend class DateIntervalFormat; | |
| | | | |
|
| friend UBool U_CALLCONV hashTableValueComparator(UHashTok val1, UHashTo
k val2) ; | | friend UBool U_CALLCONV dtitvinfHashTableValueComparator(UHashTok val1,
UHashTok val2) ; | |
| | | | |
| /** | | /** | |
| * Following is for saving the interval patterns. | | * Following is for saving the interval patterns. | |
| * We only support interval patterns on | | * We only support interval patterns on | |
| * ERA, YEAR, MONTH, DAY, AM_PM, HOUR, and MINUTE | | * ERA, YEAR, MONTH, DAY, AM_PM, HOUR, and MINUTE | |
| */ | | */ | |
| enum IntervalPatternIndex | | enum IntervalPatternIndex | |
| { | | { | |
| kIPI_ERA, | | kIPI_ERA, | |
| kIPI_YEAR, | | kIPI_YEAR, | |
| | | | |
End of changes. 14 change blocks. |
| 14 lines changed or deleted | | 14 lines changed or added | |
|
| gregocal.h | | gregocal.h | |
| /* | | /* | |
|
| * Copyright (C) 1997-2006, International Business Machines Corporation and
others. | | * Copyright (C) 1997-2009, International Business Machines Corporation and
others. | |
| * All Rights Reserved. | | * All Rights Reserved. | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
| * | | * | |
| * File GREGOCAL.H | | * File GREGOCAL.H | |
| * | | * | |
| * Modification History: | | * Modification History: | |
| * | | * | |
| * Date Name Description | | * Date Name Description | |
| * 04/22/97 aliu Overhauled header. | | * 04/22/97 aliu Overhauled header. | |
| * 07/28/98 stephen Sync with JDK 1.2 | | * 07/28/98 stephen Sync with JDK 1.2 | |
| | | | |
| skipping to change at line 90 | | skipping to change at line 90 | |
| * return; | | * return; | |
| * } | | * } | |
| * | | * | |
| * // begin output | | * // begin output | |
| * cout << "Current Time" << endl; | | * cout << "Current Time" << endl; | |
| * | | * | |
| * // create a Pacific Standard Time time zone | | * // create a Pacific Standard Time time zone | |
| * SimpleTimeZone* pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids->u
next(NULL, success))); | | * SimpleTimeZone* pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids->u
next(NULL, success))); | |
| * | | * | |
| * // set up rules for daylight savings time | | * // set up rules for daylight savings time | |
|
| * pdt->setStartRule(Calendar::APRIL, 1, Calendar::SUNDAY, 2 * 60 * 60 | | * pdt->setStartRule(UCAL_MARCH, 1, UCAL_SUNDAY, 2 * 60 * 60 * 1000); | |
| * 1000); | | * pdt->setEndRule(UCAL_NOVEMBER, 2, UCAL_SUNDAY, 2 * 60 * 60 * 1000); | |
| * pdt->setEndRule(Calendar::OCTOBER, -1, Calendar::SUNDAY, 2 * 60 * 60 | | | |
| * 1000); | | | |
| * | | * | |
| * // create a GregorianCalendar with the Pacific Daylight time zone | | * // create a GregorianCalendar with the Pacific Daylight time zone | |
| * // and the current date and time | | * // and the current date and time | |
| * Calendar* calendar = new GregorianCalendar( pdt, success ); | | * Calendar* calendar = new GregorianCalendar( pdt, success ); | |
| * | | * | |
| * // print out a bunch of interesting things | | * // print out a bunch of interesting things | |
|
| * cout << "ERA: " << calendar->get( Calendar::ERA, success ) << endl; | | * cout << "ERA: " << calendar->get( UCAL_ERA, success ) << endl; | |
| * cout << "YEAR: " << calendar->get( Calendar::YEAR, success ) << endl | | * cout << "YEAR: " << calendar->get( UCAL_YEAR, success ) << endl; | |
| ; | | * cout << "MONTH: " << calendar->get( UCAL_MONTH, success ) << endl; | |
| * cout << "MONTH: " << calendar->get( Calendar::MONTH, success ) << en | | * cout << "WEEK_OF_YEAR: " << calendar->get( UCAL_WEEK_OF_YEAR, succes | |
| dl; | | s ) << endl; | |
| * cout << "WEEK_OF_YEAR: " << calendar->get( Calendar::WEEK_OF_YEAR, s | | * cout << "WEEK_OF_MONTH: " << calendar->get( UCAL_WEEK_OF_MONTH, succ | |
| uccess ) << endl; | | ess ) << endl; | |
| * cout << "WEEK_OF_MONTH: " << calendar->get( Calendar::WEEK_OF_MONTH, | | * cout << "DATE: " << calendar->get( UCAL_DATE, success ) << endl; | |
| success ) << endl; | | * cout << "DAY_OF_MONTH: " << calendar->get( UCAL_DAY_OF_MONTH, succes | |
| * cout << "DATE: " << calendar->get( Calendar::DATE, success ) << endl | | s ) << endl; | |
| ; | | * cout << "DAY_OF_YEAR: " << calendar->get( UCAL_DAY_OF_YEAR, success | |
| * cout << "DAY_OF_MONTH: " << calendar->get( Calendar::DAY_OF_MONTH, s | | ) << endl; | |
| uccess ) << endl; | | * cout << "DAY_OF_WEEK: " << calendar->get( UCAL_DAY_OF_WEEK, success | |
| * cout << "DAY_OF_YEAR: " << calendar->get( Calendar::DAY_OF_YEAR, suc | | ) << endl; | |
| cess ) << endl; | | * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( UCAL_DAY_OF_WEEK_ | |
| * cout << "DAY_OF_WEEK: " << calendar->get( Calendar::DAY_OF_WEEK, suc | | IN_MONTH, success ) << endl; | |
| cess ) << endl; | | * cout << "AM_PM: " << calendar->get( UCAL_AM_PM, success ) << endl; | |
| * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( Calendar::DAY_OF_ | | * cout << "HOUR: " << calendar->get( UCAL_HOUR, success ) << endl; | |
| WEEK_IN_MONTH, success ) << endl; | | * cout << "HOUR_OF_DAY: " << calendar->get( UCAL_HOUR_OF_DAY, success | |
| * cout << "AM_PM: " << calendar->get( Calendar::AM_PM, success ) << en | | ) << endl; | |
| dl; | | * cout << "MINUTE: " << calendar->get( UCAL_MINUTE, success ) << endl; | |
| * cout << "HOUR: " << calendar->get( Calendar::HOUR, success ) << endl | | * cout << "SECOND: " << calendar->get( UCAL_SECOND, success ) << endl; | |
| ; | | * cout << "MILLISECOND: " << calendar->get( UCAL_MILLISECOND, success | |
| * cout << "HOUR_OF_DAY: " << calendar->get( Calendar::HOUR_OF_DAY, suc | | ) << endl; | |
| cess ) << endl; | | * cout << "ZONE_OFFSET: " << (calendar->get( UCAL_ZONE_OFFSET, success | |
| * cout << "MINUTE: " << calendar->get( Calendar::MINUTE, success ) << | | )/(60*60*1000)) << endl; | |
| endl; | | * cout << "DST_OFFSET: " << (calendar->get( UCAL_DST_OFFSET, success ) | |
| * cout << "SECOND: " << calendar->get( Calendar::SECOND, success ) << | | /(60*60*1000)) << endl; | |
| endl; | | | |
| * cout << "MILLISECOND: " << calendar->get( Calendar::MILLISECOND, suc | | | |
| cess ) << endl; | | | |
| * cout << "ZONE_OFFSET: " << (calendar->get( Calendar::ZONE_OFFSET, su | | | |
| ccess )/(60*60*1000)) << endl; | | | |
| * cout << "DST_OFFSET: " << (calendar->get( Calendar::DST_OFFSET, succ | | | |
| ess )/(60*60*1000)) << endl; | | | |
| * | | * | |
| * cout << "Current Time, with hour reset to 3" << endl; | | * cout << "Current Time, with hour reset to 3" << endl; | |
|
| * calendar->clear(Calendar::HOUR_OF_DAY); // so doesn't override | | * calendar->clear(UCAL_HOUR_OF_DAY); // so doesn't override | |
| * calendar->set(Calendar::HOUR, 3); | | * calendar->set(UCAL_HOUR, 3); | |
| * cout << "ERA: " << calendar->get( Calendar::ERA, success ) << endl; | | * cout << "ERA: " << calendar->get( UCAL_ERA, success ) << endl; | |
| * cout << "YEAR: " << calendar->get( Calendar::YEAR, success ) << endl | | * cout << "YEAR: " << calendar->get( UCAL_YEAR, success ) << endl; | |
| ; | | * cout << "MONTH: " << calendar->get( UCAL_MONTH, success ) << endl; | |
| * cout << "MONTH: " << calendar->get( Calendar::MONTH, success ) << en | | * cout << "WEEK_OF_YEAR: " << calendar->get( UCAL_WEEK_OF_YEAR, succes | |
| dl; | | s ) << endl; | |
| * cout << "WEEK_OF_YEAR: " << calendar->get( Calendar::WEEK_OF_YEAR, s | | * cout << "WEEK_OF_MONTH: " << calendar->get( UCAL_WEEK_OF_MONTH, succ | |
| uccess ) << endl; | | ess ) << endl; | |
| * cout << "WEEK_OF_MONTH: " << calendar->get( Calendar::WEEK_OF_MONTH, | | * cout << "DATE: " << calendar->get( UCAL_DATE, success ) << endl; | |
| success ) << endl; | | * cout << "DAY_OF_MONTH: " << calendar->get( UCAL_DAY_OF_MONTH, succes | |
| * cout << "DATE: " << calendar->get( Calendar::DATE, success ) << endl | | s ) << endl; | |
| ; | | * cout << "DAY_OF_YEAR: " << calendar->get( UCAL_DAY_OF_YEAR, success | |
| * cout << "DAY_OF_MONTH: " << calendar->get( Calendar::DAY_OF_MONTH, s | | ) << endl; | |
| uccess ) << endl; | | * cout << "DAY_OF_WEEK: " << calendar->get( UCAL_DAY_OF_WEEK, success | |
| * cout << "DAY_OF_YEAR: " << calendar->get( Calendar::DAY_OF_YEAR, suc | | ) << endl; | |
| cess ) << endl; | | * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( UCAL_DAY_OF_WEEK_ | |
| * cout << "DAY_OF_WEEK: " << calendar->get( Calendar::DAY_OF_WEEK, suc | | IN_MONTH, success ) << endl; | |
| cess ) << endl; | | * cout << "AM_PM: " << calendar->get( UCAL_AM_PM, success ) << endl; | |
| * cout << "DAY_OF_WEEK_IN_MONTH: " << calendar->get( Calendar::DAY_OF_ | | * cout << "HOUR: " << calendar->get( UCAL_HOUR, success ) << endl; | |
| WEEK_IN_MONTH, success ) << endl; | | * cout << "HOUR_OF_DAY: " << calendar->get( UCAL_HOUR_OF_DAY, success | |
| * cout << "AM_PM: " << calendar->get( Calendar::AM_PM, success ) << en | | ) << endl; | |
| dl; | | * cout << "MINUTE: " << calendar->get( UCAL_MINUTE, success ) << endl; | |
| * cout << "HOUR: " << calendar->get( Calendar::HOUR, success ) << endl | | * cout << "SECOND: " << calendar->get( UCAL_SECOND, success ) << endl; | |
| ; | | * cout << "MILLISECOND: " << calendar->get( UCAL_MILLISECOND, success | |
| * cout << "HOUR_OF_DAY: " << calendar->get( Calendar::HOUR_OF_DAY, suc | | ) << endl; | |
| cess ) << endl; | | * cout << "ZONE_OFFSET: " << (calendar->get( UCAL_ZONE_OFFSET, success | |
| * cout << "MINUTE: " << calendar->get( Calendar::MINUTE, success ) << | | )/(60*60*1000)) << endl; // in hours | |
| endl; | | * cout << "DST_OFFSET: " << (calendar->get( UCAL_DST_OFFSET, success ) | |
| * cout << "SECOND: " << calendar->get( Calendar::SECOND, success ) << | | /(60*60*1000)) << endl; // in hours | |
| endl; | | | |
| * cout << "MILLISECOND: " << calendar->get( Calendar::MILLISECOND, suc | | | |
| cess ) << endl; | | | |
| * cout << "ZONE_OFFSET: " << (calendar->get( Calendar::ZONE_OFFSET, su | | | |
| ccess )/(60*60*1000)) << endl; // in hours | | | |
| * cout << "DST_OFFSET: " << (calendar->get( Calendar::DST_OFFSET, succ | | | |
| ess )/(60*60*1000)) << endl; // in hours | | | |
| * | | * | |
| * if (U_FAILURE(success)) { | | * if (U_FAILURE(success)) { | |
| * cout << "An error occured. success=" << u_errorName(success) <<
endl; | | * cout << "An error occured. success=" << u_errorName(success) <<
endl; | |
| * } | | * } | |
| * | | * | |
| * delete ids; | | * delete ids; | |
| * delete calendar; // also deletes pdt | | * delete calendar; // also deletes pdt | |
| * \endcode | | * \endcode | |
| * </pre> | | * </pre> | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| | | | |
End of changes. 4 change blocks. |
| 77 lines changed or deleted | | 61 lines changed or added | |
|
| msgfmt.h | | msgfmt.h | |
| /* | | /* | |
|
| * Copyright (C) 2007-2008, International Business Machines Corporation and
others. All Rights Reserved. | | * Copyright (C) 2007-2009, International Business Machines Corporation and
others. All Rights Reserved. | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
| * | | * | |
| * File MSGFMT.H | | * File MSGFMT.H | |
| * | | * | |
| * Modification History: | | * Modification History: | |
| * | | * | |
| * Date Name Description | | * Date Name Description | |
| * 02/19/97 aliu Converted from java. | | * 02/19/97 aliu Converted from java. | |
| * 03/20/97 helena Finished first cut of implementation. | | * 03/20/97 helena Finished first cut of implementation. | |
| * 07/22/98 stephen Removed operator!= (defined in Format) | | * 07/22/98 stephen Removed operator!= (defined in Format) | |
| | | | |
| skipping to change at line 500 | | skipping to change at line 500 | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| virtual void setFormat(int32_t formatNumber, const Format& format); | | virtual void setFormat(int32_t formatNumber, const Format& format); | |
| | | | |
| /** | | /** | |
| * Gets format names. This function returns formatNames in StringEnumer
ations | | * Gets format names. This function returns formatNames in StringEnumer
ations | |
| * which can be used with getFormat() and setFormat() to export formatt
able | | * which can be used with getFormat() and setFormat() to export formatt
able | |
| * array from current MessageFormat to another. It is caller's resposi
bility | | * array from current MessageFormat to another. It is caller's resposi
bility | |
| * to delete the returned formatNames. | | * to delete the returned formatNames. | |
| * @param status output param set to success/failure code. | | * @param status output param set to success/failure code. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual StringEnumeration* getFormatNames(UErrorCode& status); | | virtual StringEnumeration* getFormatNames(UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Gets subformat pointer for given format name. | | * Gets subformat pointer for given format name. | |
| * This function supports both named and numbered | | * This function supports both named and numbered | |
| * arguments-- if numbered, the formatName is the | | * arguments-- if numbered, the formatName is the | |
| * corresponding UnicodeStrings (e.g. "0", "1", "2"...). | | * corresponding UnicodeStrings (e.g. "0", "1", "2"...). | |
| * The returned Format object should not be deleted by the caller, | | * The returned Format object should not be deleted by the caller, | |
| * nor should the ponter of other object . The pointer and its | | * nor should the ponter of other object . The pointer and its | |
| * contents remain valid only until the next call to any method | | * contents remain valid only until the next call to any method | |
| * of this class is made with this object. | | * of this class is made with this object. | |
| * @param formatName the name or number specifying a format | | * @param formatName the name or number specifying a format | |
| * @param status output param set to success/failure code. | | * @param status output param set to success/failure code. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual Format* getFormat(const UnicodeString& formatName, UErrorCode&
status); | | virtual Format* getFormat(const UnicodeString& formatName, UErrorCode&
status); | |
| | | | |
| /** | | /** | |
| * Sets one subformat for given format name. | | * Sets one subformat for given format name. | |
| * See the class description about format name. | | * See the class description about format name. | |
| * This function supports both named and numbered | | * This function supports both named and numbered | |
| * arguments-- if numbered, the formatName is the | | * arguments-- if numbered, the formatName is the | |
| * corresponding UnicodeStrings (e.g. "0", "1", "2"...). | | * corresponding UnicodeStrings (e.g. "0", "1", "2"...). | |
| * If there is no matched formatName or wrong type, | | * If there is no matched formatName or wrong type, | |
| * the item will be ignored. | | * the item will be ignored. | |
| * @param formatName Name of the subformat. | | * @param formatName Name of the subformat. | |
| * @param format the format to be set. | | * @param format the format to be set. | |
| * @param status output param set to success/failure code. | | * @param status output param set to success/failure code. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual void setFormat(const UnicodeString& formatName, const Format& f
ormat, UErrorCode& status); | | virtual void setFormat(const UnicodeString& formatName, const Format& f
ormat, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Sets one subformat for given format name. | | * Sets one subformat for given format name. | |
| * See the class description about format name. | | * See the class description about format name. | |
| * This function supports both named and numbered | | * This function supports both named and numbered | |
| * arguments-- if numbered, the formatName is the | | * arguments-- if numbered, the formatName is the | |
| * corresponding UnicodeStrings (e.g. "0", "1", "2"...). | | * corresponding UnicodeStrings (e.g. "0", "1", "2"...). | |
| * If there is no matched formatName or wrong type, | | * If there is no matched formatName or wrong type, | |
| * the item will be ignored. | | * the item will be ignored. | |
| * The caller should not delete the Format object after this call. | | * The caller should not delete the Format object after this call. | |
| * @param formatName Name of the subformat. | | * @param formatName Name of the subformat. | |
| * @param formatToAdopt Format to be adopted. | | * @param formatToAdopt Format to be adopted. | |
| * @param status output param set to success/failure code. | | * @param status output param set to success/failure code. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual void adoptFormat(const UnicodeString& formatName, Format* forma
tToAdopt, UErrorCode& status); | | virtual void adoptFormat(const UnicodeString& formatName, Format* forma
tToAdopt, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Gets an array of subformats of this object. The returned array | | * Gets an array of subformats of this object. The returned array | |
| * should not be deleted by the caller, nor should the pointers | | * should not be deleted by the caller, nor should the pointers | |
| * within the array. The array and its contents remain valid only | | * within the array. The array and its contents remain valid only | |
| * until the next call to any method of this class is made with | | * until the next call to any method of this class is made with | |
| * this object. See the class description about format numbering. | | * this object. See the class description about format numbering. | |
| * @param count output parameter to receive the size of the array | | * @param count output parameter to receive the size of the array | |
| | | | |
| skipping to change at line 744 | | skipping to change at line 744 | |
| * @stable ICU 3.4 | | * @stable ICU 3.4 | |
| */ | | */ | |
| static UnicodeString autoQuoteApostrophe(const UnicodeString& pattern, | | static UnicodeString autoQuoteApostrophe(const UnicodeString& pattern, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Returns true if this MessageFormat uses named arguments, | | * Returns true if this MessageFormat uses named arguments, | |
| * and false otherwise. See class description. | | * and false otherwise. See class description. | |
| * | | * | |
| * @return true if named arguments are used. | | * @return true if named arguments are used. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UBool usesNamedArguments() const; | | UBool usesNamedArguments() const; | |
| | | | |
| /** | | /** | |
| * This API is for ICU internal use only. | | * This API is for ICU internal use only. | |
| * Please do not use it. | | * Please do not use it. | |
| * | | * | |
| * Returns argument types count in the parsed pattern. | | * Returns argument types count in the parsed pattern. | |
| * Used to distinguish pattern "{0} d" and "d". | | * Used to distinguish pattern "{0} d" and "d". | |
| * | | * | |
| | | | |
End of changes. 6 change blocks. |
| 6 lines changed or deleted | | 6 lines changed or added | |
|
| numsys.h | | numsys.h | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
| */ | | */ | |
| | | | |
| #ifndef NUMSYS | | #ifndef NUMSYS | |
| #define NUMSYS | | #define NUMSYS | |
| | | | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| | | | |
| /** | | /** | |
| * \file | | * \file | |
|
| * \brief C++ API: NumberingSystems object | | * \brief C++ API: NumberingSystem object | |
| */ | | */ | |
| | | | |
| #if !UCONFIG_NO_FORMATTING | | #if !UCONFIG_NO_FORMATTING | |
| | | | |
| #include "unicode/format.h" | | #include "unicode/format.h" | |
| #include "unicode/uobject.h" | | #include "unicode/uobject.h" | |
| | | | |
| U_NAMESPACE_BEGIN | | U_NAMESPACE_BEGIN | |
| | | | |
| /** | | /** | |
|
| * Defines numbering systems. Put more description here. | | * Defines numbering systems. A numbering system describes the scheme by wh | |
| | | ich | |
| | | * numbers are to be presented to the end user. In its simplest form, a nu | |
| | | mbering | |
| | | * system describes the set of digit characters that are to be used to disp | |
| | | lay | |
| | | * numbers, such as Western digits, Thai digits, Arabic-Indic digits, etc. | |
| | | * More complicated numbering systems are algorithmic in nature, and requir | |
| | | e use | |
| | | * of an RBNF formatter ( rule based number formatter ), in order to calcul | |
| | | ate | |
| | | * the characters to be displayed for a given number. Examples of algorith | |
| | | mic | |
| | | * numbering systems include Roman numerals, Chinese numerals, and Hebrew n | |
| | | umerals. | |
| | | * Formatting rules for many commonly used numbering systems are included i | |
| | | n | |
| | | * the ICU package, based on the numbering system rules defined in CLDR. | |
| | | * Alternate numbering systems can be specified to a locale by using the | |
| | | * numbers locale keyword. | |
| */ | | */ | |
| | | | |
| class U_I18N_API NumberingSystem : public UObject { | | class U_I18N_API NumberingSystem : public UObject { | |
| public: | | public: | |
| | | | |
| /** | | /** | |
| * Default Constructor. | | * Default Constructor. | |
| * | | * | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| | | | |
| skipping to change at line 62 | | skipping to change at line 73 | |
| | | | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| virtual ~NumberingSystem(); | | virtual ~NumberingSystem(); | |
| | | | |
| /** | | /** | |
| * Create the default numbering system associated with the specified lo
cale. | | * Create the default numbering system associated with the specified lo
cale. | |
| * @param inLocale The given locale. | | * @param inLocale The given locale. | |
|
| | | * @param status ICU status | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocal
e, UErrorCode& status); | | static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocal
e, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Create the default numbering system associated with the default loca
le. | | * Create the default numbering system associated with the default loca
le. | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status); | | static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Create a numbering system using the specified radix, type, and descr
iption. | | * Create a numbering system using the specified radix, type, and descr
iption. | |
| * @param radix The radix (base) for this numbering system. | | * @param radix The radix (base) for this numbering system. | |
| * @param isAlgorithmic TRUE if the numbering system is algorithmic rat
her than numeric. | | * @param isAlgorithmic TRUE if the numbering system is algorithmic rat
her than numeric. | |
| * @param description The string representing the set of digits used
in a numeric system, or the name of the RBNF | | * @param description The string representing the set of digits used
in a numeric system, or the name of the RBNF | |
| * ruleset to be used in an algorithmic system. | | * ruleset to be used in an algorithmic system. | |
|
| | | * @param status ICU status | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool i
sAlgorithmic, const UnicodeString& description, UErrorCode& status ); | | static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool i
sAlgorithmic, const UnicodeString& description, UErrorCode& status ); | |
| | | | |
| /** | | /** | |
| * Return a StringEnumeration over all the names of numbering systems k
nown to ICU. | | * Return a StringEnumeration over all the names of numbering systems k
nown to ICU. | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| | | | |
| static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& sta
tus); | | static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& sta
tus); | |
| | | | |
| /** | | /** | |
| * Create a numbering system from one of the predefined numbering syste
ms known to ICU. | | * Create a numbering system from one of the predefined numbering syste
ms known to ICU. | |
| * @param name The name of the numbering system. | | * @param name The name of the numbering system. | |
|
| | | * @param status ICU status | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name
, UErrorCode& status); | | static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name
, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Returns the radix of this numbering system. | | * Returns the radix of this numbering system. | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| int32_t getRadix(); | | int32_t getRadix(); | |
| | | | |
| | | | |
| skipping to change at line 122 | | skipping to change at line 136 | |
| * | | * | |
| * @return TRUE if the numbering system is algorithmic. | | * @return TRUE if the numbering system is algorithmic. | |
| * Otherwise, return FALSE. | | * Otherwise, return FALSE. | |
| * @draft ICU 4.2 | | * @draft ICU 4.2 | |
| */ | | */ | |
| UBool isAlgorithmic() const; | | UBool isAlgorithmic() const; | |
| | | | |
| /** | | /** | |
| * ICU "poor man's RTTI", returns a UClassID for this class. | | * ICU "poor man's RTTI", returns a UClassID for this class. | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @draft ICU 4.2 | |
| * | | * | |
| */ | | */ | |
| static UClassID U_EXPORT2 getStaticClassID(void); | | static UClassID U_EXPORT2 getStaticClassID(void); | |
| | | | |
| /** | | /** | |
| * ICU "poor man's RTTI", returns a UClassID for the actual class. | | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @draft ICU 4.2 | |
| */ | | */ | |
| virtual UClassID getDynamicClassID() const; | | virtual UClassID getDynamicClassID() const; | |
| | | | |
| private: | | private: | |
| UnicodeString desc; | | UnicodeString desc; | |
| int32_t radix; | | int32_t radix; | |
| UBool algorithmic; | | UBool algorithmic; | |
| | | | |
| void setRadix(int32_t radix); | | void setRadix(int32_t radix); | |
| | | | |
| | | | |
End of changes. 7 change blocks. |
| 4 lines changed or deleted | | 26 lines changed or added | |
|
| plurfmt.h | | plurfmt.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 2007-2008, International Business Machines Corporation and | | * Copyright (C) 2007-2009, International Business Machines Corporation and | |
| * others. All Rights Reserved. | | * others. All Rights Reserved. | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
| | | | |
| * File PLURFMT.H | | * File PLURFMT.H | |
| * | | * | |
| * Modification History:* | | * Modification History:* | |
| * Date Name Description | | * Date Name Description | |
| * | | * | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
| | | | |
| skipping to change at line 171 | | skipping to change at line 171 | |
| * create a <code>PluralRules</code> object and pass it to | | * create a <code>PluralRules</code> object and pass it to | |
| * <code>PluralFormat</code>'s constructor. If you also specify a locale in
this | | * <code>PluralFormat</code>'s constructor. If you also specify a locale in
this | |
| * constructor, this locale will be used to format the number in the messag
e | | * constructor, this locale will be used to format the number in the messag
e | |
| * texts. | | * texts. | |
| * </p><p> | | * </p><p> | |
| * For more information about <code>PluralRules</code>, see | | * For more information about <code>PluralRules</code>, see | |
| * {@link PluralRules}. | | * {@link PluralRules}. | |
| * </p> | | * </p> | |
| * | | * | |
| * ported from Java | | * ported from Java | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| | | | |
| class U_I18N_API PluralFormat : public Format { | | class U_I18N_API PluralFormat : public Format { | |
| public: | | public: | |
| | | | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for the default locale. | | * Creates a new <code>PluralFormat</code> for the default locale. | |
| * This locale will be used to get the set of plural rules and for stan
dard | | * This locale will be used to get the set of plural rules and for stan
dard | |
| * number formatting. | | * number formatting. | |
| * @param status output param set to success/failure code on exit, whi
ch | | * @param status output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(UErrorCode& status); | | PluralFormat(UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for a given locale. | | * Creates a new <code>PluralFormat</code> for a given locale. | |
| * @param locale the <code>PluralFormat</code> will be configured with | | * @param locale the <code>PluralFormat</code> will be configured with | |
| * rules for this locale. This locale will also be used f
or | | * rules for this locale. This locale will also be used f
or | |
| * standard number formatting. | | * standard number formatting. | |
| * @param status output param set to success/failure code on exit, whic
h | | * @param status output param set to success/failure code on exit, whic
h | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(const Locale& locale, UErrorCode& status); | | PluralFormat(const Locale& locale, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for a given set of rules. | | * Creates a new <code>PluralFormat</code> for a given set of rules. | |
| * The standard number formatting will be done using the default locale
. | | * The standard number formatting will be done using the default locale
. | |
| * @param rules defines the behavior of the <code>PluralFormat</code> | | * @param rules defines the behavior of the <code>PluralFormat</code> | |
| * object. | | * object. | |
| * @param status output param set to success/failure code on exit, whi
ch | | * @param status output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(const PluralRules& rules, UErrorCode& status); | | PluralFormat(const PluralRules& rules, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for a given set of rules. | | * Creates a new <code>PluralFormat</code> for a given set of rules. | |
| * The standard number formatting will be done using the given locale. | | * The standard number formatting will be done using the given locale. | |
| * @param locale the default number formatting will be done using this | | * @param locale the default number formatting will be done using this | |
| * locale. | | * locale. | |
| * @param rules defines the behavior of the <code>PluralFormat</code> | | * @param rules defines the behavior of the <code>PluralFormat</code> | |
| * object. | | * object. | |
| * @param status output param set to success/failure code on exit, whi
ch | | * @param status output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(const Locale& locale, const PluralRules& rules, UErrorCode
& status); | | PluralFormat(const Locale& locale, const PluralRules& rules, UErrorCode
& status); | |
| | | | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for a given pattern string. | | * Creates a new <code>PluralFormat</code> for a given pattern string. | |
| * The default locale will be used to get the set of plural rules and f
or | | * The default locale will be used to get the set of plural rules and f
or | |
| * standard number formatting. | | * standard number formatting. | |
| * @param pattern the pattern for this <code>PluralFormat</code>. | | * @param pattern the pattern for this <code>PluralFormat</code>. | |
| * errors are returned to status if the pattern is inva
lid. | | * errors are returned to status if the pattern is inva
lid. | |
| * @param status output param set to success/failure code on exit, wh
ich | | * @param status output param set to success/failure code on exit, wh
ich | |
| * must not indicate a failure before the function call
. | | * must not indicate a failure before the function call
. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(const UnicodeString& pattern, UErrorCode& status); | | PluralFormat(const UnicodeString& pattern, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for a given pattern string a
nd | | * Creates a new <code>PluralFormat</code> for a given pattern string a
nd | |
| * locale. | | * locale. | |
| * The locale will be used to get the set of plural rules and for | | * The locale will be used to get the set of plural rules and for | |
| * standard number formatting. | | * standard number formatting. | |
| * @param locale the <code>PluralFormat</code> will be configured wit
h | | * @param locale the <code>PluralFormat</code> will be configured wit
h | |
| * rules for this locale. This locale will also be used
for | | * rules for this locale. This locale will also be used
for | |
| * standard number formatting. | | * standard number formatting. | |
| * @param pattern the pattern for this <code>PluralFormat</code>. | | * @param pattern the pattern for this <code>PluralFormat</code>. | |
| * errors are returned to status if the pattern is inva
lid. | | * errors are returned to status if the pattern is inva
lid. | |
| * @param status output param set to success/failure code on exit, wh
ich | | * @param status output param set to success/failure code on exit, wh
ich | |
| * must not indicate a failure before the function call
. | | * must not indicate a failure before the function call
. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(const Locale& locale, const UnicodeString& pattern, UError
Code& status); | | PluralFormat(const Locale& locale, const UnicodeString& pattern, UError
Code& status); | |
| | | | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for a given set of rules, a | | * Creates a new <code>PluralFormat</code> for a given set of rules, a | |
| * pattern and a locale. | | * pattern and a locale. | |
| * @param rules defines the behavior of the <code>PluralFormat</code
> | | * @param rules defines the behavior of the <code>PluralFormat</code
> | |
| * object. | | * object. | |
| * @param pattern the pattern for this <code>PluralFormat</code>. | | * @param pattern the pattern for this <code>PluralFormat</code>. | |
| * errors are returned to status if the pattern is inva
lid. | | * errors are returned to status if the pattern is inva
lid. | |
| * @param status output param set to success/failure code on exit, wh
ich | | * @param status output param set to success/failure code on exit, wh
ich | |
| * must not indicate a failure before the function call
. | | * must not indicate a failure before the function call
. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(const PluralRules& rules, | | PluralFormat(const PluralRules& rules, | |
| const UnicodeString& pattern, | | const UnicodeString& pattern, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for a given set of rules, a | | * Creates a new <code>PluralFormat</code> for a given set of rules, a | |
| * pattern and a locale. | | * pattern and a locale. | |
| * @param locale the <code>PluralFormat</code> will be configured with | | * @param locale the <code>PluralFormat</code> will be configured with | |
| * rules for this locale. This locale will also be used
for | | * rules for this locale. This locale will also be used
for | |
| * standard number formatting. | | * standard number formatting. | |
| * @param rules defines the behavior of the <code>PluralFormat</code> | | * @param rules defines the behavior of the <code>PluralFormat</code> | |
| * object. | | * object. | |
| * @param pattern the pattern for this <code>PluralFormat</code>. | | * @param pattern the pattern for this <code>PluralFormat</code>. | |
| * errors are returned to status if the pattern is inval
id. | | * errors are returned to status if the pattern is inval
id. | |
| * @param status output param set to success/failure code on exit, whi
ch | | * @param status output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(const Locale& locale, | | PluralFormat(const Locale& locale, | |
| const PluralRules& rules, | | const PluralRules& rules, | |
| const UnicodeString& pattern, | | const UnicodeString& pattern, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * copy constructor. | | * copy constructor. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(const PluralFormat& other); | | PluralFormat(const PluralFormat& other); | |
| | | | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual ~PluralFormat(); | | virtual ~PluralFormat(); | |
| | | | |
| /** | | /** | |
| * Sets the pattern used by this plural format. | | * Sets the pattern used by this plural format. | |
| * The method parses the pattern and creates a map of format strings | | * The method parses the pattern and creates a map of format strings | |
| * for the plural rules. | | * for the plural rules. | |
| * Patterns and their interpretation are specified in the class descrip
tion. | | * Patterns and their interpretation are specified in the class descrip
tion. | |
| * | | * | |
| * @param pattern the pattern for this plural format | | * @param pattern the pattern for this plural format | |
| * errors are returned to status if the pattern is inval
id. | | * errors are returned to status if the pattern is inval
id. | |
| * @param status output param set to success/failure code on exit, whi
ch | | * @param status output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| void applyPattern(const UnicodeString& pattern, UErrorCode& status); | | void applyPattern(const UnicodeString& pattern, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Formats a plural message for a given number. | | * Formats a plural message for a given number. | |
| * | | * | |
| * @param number a number for which the plural message should be forma
tted | | * @param number a number for which the plural message should be forma
tted | |
| * for. If no pattern has been applied to this | | * for. If no pattern has been applied to this | |
| * <code>PluralFormat</code> object yet, the formatted n
umber | | * <code>PluralFormat</code> object yet, the formatted n
umber | |
| * will be returned. | | * will be returned. | |
| * @param status output param set to success/failure code on exit, whi
ch | | * @param status output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
| * @return the string containing the formatted plural message. | | * @return the string containing the formatted plural message. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString format(int32_t number, UErrorCode& status) const; | | UnicodeString format(int32_t number, UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
| * Formats a plural message for a given number. | | * Formats a plural message for a given number. | |
| * | | * | |
| * @param number a number for which the plural message should be forma
tted | | * @param number a number for which the plural message should be forma
tted | |
| * for. If no pattern has been applied to this | | * for. If no pattern has been applied to this | |
| * PluralFormat object yet, the formatted number | | * PluralFormat object yet, the formatted number | |
| * will be returned. | | * will be returned. | |
| * @param status output param set to success or failure code on exit,
which | | * @param status output param set to success or failure code on exit,
which | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
| * @return the string containing the formatted plural message. | | * @return the string containing the formatted plural message. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString format(double number, UErrorCode& status) const; | | UnicodeString format(double number, UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
| * Formats a plural message for a given number. | | * Formats a plural message for a given number. | |
| * | | * | |
| * @param number a number for which the plural message should be form
atted | | * @param number a number for which the plural message should be form
atted | |
| * for. If no pattern has been applied to this | | * for. If no pattern has been applied to this | |
| * <code>PluralFormat</code> object yet, the formatted
number | | * <code>PluralFormat</code> object yet, the formatted
number | |
| * will be returned. | | * will be returned. | |
| * @param appendTo output parameter to receive result. | | * @param appendTo output parameter to receive result. | |
| * result is appended to existing contents. | | * result is appended to existing contents. | |
| * @param pos On input: an alignment field, if desired. | | * @param pos On input: an alignment field, if desired. | |
| * On output: the offsets of the alignment field. | | * On output: the offsets of the alignment field. | |
| * @param status output param set to success/failure code on exit, wh
ich | | * @param status output param set to success/failure code on exit, wh
ich | |
| * must not indicate a failure before the function call
. | | * must not indicate a failure before the function call
. | |
| * @return the string containing the formatted plural message. | | * @return the string containing the formatted plural message. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString& format(int32_t number, | | UnicodeString& format(int32_t number, | |
| UnicodeString& appendTo, | | UnicodeString& appendTo, | |
| FieldPosition& pos, | | FieldPosition& pos, | |
| UErrorCode& status) const; | | UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
| * Formats a plural message for a given number. | | * Formats a plural message for a given number. | |
| * | | * | |
| * @param number a number for which the plural message should be form
atted | | * @param number a number for which the plural message should be form
atted | |
| * for. If no pattern has been applied to this | | * for. If no pattern has been applied to this | |
| * <code>PluralFormat</code> object yet, the formatted
number | | * <code>PluralFormat</code> object yet, the formatted
number | |
| * will be returned. | | * will be returned. | |
| * @param appendTo output parameter to receive result. | | * @param appendTo output parameter to receive result. | |
| * result is appended to existing contents. | | * result is appended to existing contents. | |
| * @param pos On input: an alignment field, if desired. | | * @param pos On input: an alignment field, if desired. | |
| * On output: the offsets of the alignment field. | | * On output: the offsets of the alignment field. | |
| * @param status output param set to success/failure code on exit, wh
ich | | * @param status output param set to success/failure code on exit, wh
ich | |
| * must not indicate a failure before the function call
. | | * must not indicate a failure before the function call
. | |
| * @return the string containing the formatted plural message. | | * @return the string containing the formatted plural message. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString& format(double number, | | UnicodeString& format(double number, | |
| UnicodeString& appendTo, | | UnicodeString& appendTo, | |
| FieldPosition& pos, | | FieldPosition& pos, | |
| UErrorCode& status) const; | | UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
| * Sets the locale used by this <code>PluraFormat</code> object. | | * Sets the locale used by this <code>PluraFormat</code> object. | |
| * Note: Calling this method resets this <code>PluraFormat</code> objec
t, | | * Note: Calling this method resets this <code>PluraFormat</code> objec
t, | |
| * i.e., a pattern that was applied previously will be removed, | | * i.e., a pattern that was applied previously will be removed, | |
| * and the NumberFormat is set to the default number format for | | * and the NumberFormat is set to the default number format for | |
| * the locale. The resulting format behaves the same as one | | * the locale. The resulting format behaves the same as one | |
| * constructed from {@link #PluralFormat(const Locale& locale, UErr
orCode& status)}. | | * constructed from {@link #PluralFormat(const Locale& locale, UErr
orCode& status)}. | |
| * @param locale the <code>locale</code> to use to configure the forma
tter. | | * @param locale the <code>locale</code> to use to configure the forma
tter. | |
| * @param status output param set to success/failure code on exit, whi
ch | | * @param status output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| void setLocale(const Locale& locale, UErrorCode& status); | | void setLocale(const Locale& locale, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Sets the number format used by this formatter. You only need to | | * Sets the number format used by this formatter. You only need to | |
| * call this if you want a different number format than the default | | * call this if you want a different number format than the default | |
| * formatter for the locale. | | * formatter for the locale. | |
| * @param format the number format to use. | | * @param format the number format to use. | |
| * @param status output param set to success/failure code on exit, wh
ich | | * @param status output param set to success/failure code on exit, wh
ich | |
| * must not indicate a failure before the function call
. | | * must not indicate a failure before the function call
. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| void setNumberFormat(const NumberFormat* format, UErrorCode& status); | | void setNumberFormat(const NumberFormat* format, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Assignment operator | | * Assignment operator | |
| * | | * | |
| * @param other the PluralFormat object to copy from. | | * @param other the PluralFormat object to copy from. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat& operator=(const PluralFormat& other); | | PluralFormat& operator=(const PluralFormat& other); | |
| | | | |
| /** | | /** | |
| * Return true if another object is semantically equal to this one. | | * Return true if another object is semantically equal to this one. | |
| * | | * | |
| * @param other the PluralFormat object to be compared with. | | * @param other the PluralFormat object to be compared with. | |
| * @return true if other is semantically equal to this. | | * @return true if other is semantically equal to this. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UBool operator==(const Format& other) const; | | virtual UBool operator==(const Format& other) const; | |
| | | | |
| /** | | /** | |
| * Return true if another object is semantically unequal to this one. | | * Return true if another object is semantically unequal to this one. | |
| * | | * | |
| * @param other the PluralFormat object to be compared with. | | * @param other the PluralFormat object to be compared with. | |
| * @return true if other is semantically unequal to this. | | * @return true if other is semantically unequal to this. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UBool operator!=(const Format& other) const; | | virtual UBool operator!=(const Format& other) const; | |
| | | | |
| /** | | /** | |
| * Clones this Format object polymorphically. The caller owns the | | * Clones this Format object polymorphically. The caller owns the | |
| * result and should delete it when done. | | * result and should delete it when done. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual Format* clone(void) const; | | virtual Format* clone(void) const; | |
| | | | |
| /** | | /** | |
| * Redeclared Format method. | | * Redeclared Format method. | |
| * | | * | |
| * @param obj The object to be formatted into a string. | | * @param obj The object to be formatted into a string. | |
| * @param appendTo output parameter to receive result. | | * @param appendTo output parameter to receive result. | |
| * Result is appended to existing contents. | | * Result is appended to existing contents. | |
| * @param pos On input: an alignment field, if desired. | | * @param pos On input: an alignment field, if desired. | |
| * On output: the offsets of the alignment field. | | * On output: the offsets of the alignment field. | |
| * @param status output param filled with success/failure status. | | * @param status output param filled with success/failure status. | |
| * @return Reference to 'appendTo' parameter. | | * @return Reference to 'appendTo' parameter. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString& format(const Formattable& obj, | | UnicodeString& format(const Formattable& obj, | |
| UnicodeString& appendTo, | | UnicodeString& appendTo, | |
| FieldPosition& pos, | | FieldPosition& pos, | |
| UErrorCode& status) const; | | UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
| * Returns the pattern from applyPattern() or constructor(). | | * Returns the pattern from applyPattern() or constructor(). | |
| * | | * | |
| * @param appendTo output parameter to receive result. | | * @param appendTo output parameter to receive result. | |
| * Result is appended to existing contents. | | * Result is appended to existing contents. | |
| * @return the UnicodeString with inserted pattern. | | * @return the UnicodeString with inserted pattern. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString& toPattern(UnicodeString& appendTo); | | UnicodeString& toPattern(UnicodeString& appendTo); | |
| | | | |
| /** | | /** | |
| * This method is not yet supported by <code>PluralFormat</code>. | | * This method is not yet supported by <code>PluralFormat</code>. | |
| * <P> | | * <P> | |
| * Before calling, set parse_pos.index to the offset you want to start | | * Before calling, set parse_pos.index to the offset you want to start | |
| * parsing at in the source. After calling, parse_pos.index is the end o
f | | * parsing at in the source. After calling, parse_pos.index is the end o
f | |
| * the text you parsed. If error occurs, index is unchanged. | | * the text you parsed. If error occurs, index is unchanged. | |
| * <P> | | * <P> | |
| | | | |
| skipping to change at line 485 | | skipping to change at line 485 | |
| * See Format::parseObject() for more. | | * See Format::parseObject() for more. | |
| * | | * | |
| * @param source The string to be parsed into an object. | | * @param source The string to be parsed into an object. | |
| * @param result Formattable to be set to the parse result. | | * @param result Formattable to be set to the parse result. | |
| * If parse fails, return contents are undefined. | | * If parse fails, return contents are undefined. | |
| * @param parse_pos The position to start parsing at. Upon return | | * @param parse_pos The position to start parsing at. Upon return | |
| * this param is set to the position after the | | * this param is set to the position after the | |
| * last character successfully parsed. If the | | * last character successfully parsed. If the | |
| * source is not parsed successfully, this param | | * source is not parsed successfully, this param | |
| * will remain unchanged. | | * will remain unchanged. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual void parseObject(const UnicodeString& source, | | virtual void parseObject(const UnicodeString& source, | |
| Formattable& result, | | Formattable& result, | |
| ParsePosition& parse_pos) const; | | ParsePosition& parse_pos) const; | |
| | | | |
| /** | | /** | |
| * ICU "poor man's RTTI", returns a UClassID for this class. | | * ICU "poor man's RTTI", returns a UClassID for this class. | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| * | | * | |
| */ | | */ | |
| static UClassID U_EXPORT2 getStaticClassID(void); | | static UClassID U_EXPORT2 getStaticClassID(void); | |
| | | | |
| /** | | /** | |
| * ICU "poor man's RTTI", returns a UClassID for the actual class. | | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UClassID getDynamicClassID() const; | | virtual UClassID getDynamicClassID() const; | |
| | | | |
| private: | | private: | |
| typedef enum fmtToken { | | typedef enum fmtToken { | |
| none, | | none, | |
| tLetter, | | tLetter, | |
| tNumber, | | tNumber, | |
| tSpace, | | tSpace, | |
| tNumberSign, | | tNumberSign, | |
| | | | |
End of changes. 28 change blocks. |
| 28 lines changed or deleted | | 28 lines changed or added | |
|
| plurrule.h | | plurrule.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 2008, International Business Machines Corporation and | | * Copyright (C) 2008-2009, International Business Machines Corporation and | |
| * others. All Rights Reserved. | | * others. All Rights Reserved. | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
| * | | * | |
| * File PLURRULE.H | | * File PLURRULE.H | |
| * | | * | |
| * Modification History:* | | * Modification History:* | |
| * Date Name Description | | * Date Name Description | |
| * | | * | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
| | | | |
| skipping to change at line 112 | | skipping to change at line 112 | |
| * </pre> | | * </pre> | |
| */ | | */ | |
| class U_I18N_API PluralRules : public UObject { | | class U_I18N_API PluralRules : public UObject { | |
| public: | | public: | |
| | | | |
| /** | | /** | |
| * Constructor. | | * Constructor. | |
| * @param status Output param set to success/failure code on exit, whi
ch | | * @param status Output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralRules(UErrorCode& status); | | PluralRules(UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Copy constructor. | | * Copy constructor. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralRules(const PluralRules& other); | | PluralRules(const PluralRules& other); | |
| | | | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual ~PluralRules(); | | virtual ~PluralRules(); | |
| | | | |
| /** | | /** | |
| * Clone | | * Clone | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralRules* clone() const; | | PluralRules* clone() const; | |
| | | | |
| /** | | /** | |
| * Assignment operator. | | * Assignment operator. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralRules& operator=(const PluralRules&); | | PluralRules& operator=(const PluralRules&); | |
| | | | |
| /** | | /** | |
| * Creates a PluralRules from a description if it is parsable, otherwis
e | | * Creates a PluralRules from a description if it is parsable, otherwis
e | |
| * returns null. | | * returns null. | |
| * | | * | |
| * @param description rule description | | * @param description rule description | |
| * @param status Output param set to success/failure code on exit,
which | | * @param status Output param set to success/failure code on exit,
which | |
| * must not indicate a failure before the function c
all. | | * must not indicate a failure before the function c
all. | |
| * @return new PluralRules pointer. NULL if there is an erro
r. | | * @return new PluralRules pointer. NULL if there is an erro
r. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| static PluralRules* U_EXPORT2 createRules(const UnicodeString& descript
ion, | | static PluralRules* U_EXPORT2 createRules(const UnicodeString& descript
ion, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * The default rules that accept any number. | | * The default rules that accept any number. | |
| * | | * | |
| * @param status Output param set to success/failure code on exit, whi
ch | | * @param status Output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
| * @return new PluralRules pointer. NULL if there is an error. | | * @return new PluralRules pointer. NULL if there is an error. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| static PluralRules* U_EXPORT2 createDefaultRules(UErrorCode& status); | | static PluralRules* U_EXPORT2 createDefaultRules(UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Provides access to the predefined <code>PluralRules</code> for a giv
en | | * Provides access to the predefined <code>PluralRules</code> for a giv
en | |
| * locale. | | * locale. | |
| * | | * | |
| * @param locale The locale for which a <code>PluralRules</code> objec
t is | | * @param locale The locale for which a <code>PluralRules</code> objec
t is | |
| * returned. | | * returned. | |
| * @param status Output param set to success/failure code on exit, whi
ch | | * @param status Output param set to success/failure code on exit, whi
ch | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
| * @return The predefined <code>PluralRules</code> object pointe
r for | | * @return The predefined <code>PluralRules</code> object pointe
r for | |
| * this locale. If there's no predefined rules for this
locale, | | * this locale. If there's no predefined rules for this
locale, | |
| * the rules for the closest parent in the locale hierar
chy | | * the rules for the closest parent in the locale hierar
chy | |
| * that has one will be returned. The final fallback a
lways | | * that has one will be returned. The final fallback a
lways | |
| * returns the default 'other' rules. | | * returns the default 'other' rules. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| static PluralRules* U_EXPORT2 forLocale(const Locale& locale, UErrorCod
e& status); | | static PluralRules* U_EXPORT2 forLocale(const Locale& locale, UErrorCod
e& status); | |
| | | | |
| /** | | /** | |
| * Given a number, returns the keyword of the first rule that applies t
o | | * Given a number, returns the keyword of the first rule that applies t
o | |
| * the number. This function can be used with isKeyword* functions to | | * the number. This function can be used with isKeyword* functions to | |
| * determine the keyword for default plural rules. | | * determine the keyword for default plural rules. | |
| * | | * | |
| * @param number The number for which the rule has to be determined. | | * @param number The number for which the rule has to be determined. | |
| * @return The keyword of the selected rule. | | * @return The keyword of the selected rule. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString select(int32_t number) const; | | UnicodeString select(int32_t number) const; | |
| | | | |
| /** | | /** | |
| * Given a number, returns the keyword of the first rule that applies t
o | | * Given a number, returns the keyword of the first rule that applies t
o | |
| * the number. This function can be used with isKeyword* functions to | | * the number. This function can be used with isKeyword* functions to | |
| * determine the keyword for default plural rules. | | * determine the keyword for default plural rules. | |
| * | | * | |
| * @param number The number for which the rule has to be determined. | | * @param number The number for which the rule has to be determined. | |
| * @return The keyword of the selected rule. | | * @return The keyword of the selected rule. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString select(double number) const; | | UnicodeString select(double number) const; | |
| | | | |
| /** | | /** | |
| * Returns a list of all rule keywords used in this <code>PluralRules</
code> | | * Returns a list of all rule keywords used in this <code>PluralRules</
code> | |
| * object. The rule 'other' is always present by default. | | * object. The rule 'other' is always present by default. | |
| * | | * | |
| * @param status Output param set to success/failure code on exit, whic
h | | * @param status Output param set to success/failure code on exit, whic
h | |
| * must not indicate a failure before the function call. | | * must not indicate a failure before the function call. | |
| * @return StringEnumeration with the keywords. | | * @return StringEnumeration with the keywords. | |
| * The caller must delete the object. | | * The caller must delete the object. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| StringEnumeration* getKeywords(UErrorCode& status) const; | | StringEnumeration* getKeywords(UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
| * Returns TRUE if the given keyword is defined in this | | * Returns TRUE if the given keyword is defined in this | |
| * <code>PluralRules</code> object. | | * <code>PluralRules</code> object. | |
| * | | * | |
| * @param keyword the input keyword. | | * @param keyword the input keyword. | |
| * @return TRUE if the input keyword is defined. | | * @return TRUE if the input keyword is defined. | |
| * Otherwise, return FALSE. | | * Otherwise, return FALSE. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UBool isKeyword(const UnicodeString& keyword) const; | | UBool isKeyword(const UnicodeString& keyword) const; | |
| | | | |
| /** | | /** | |
| * Returns keyword for default plural form. | | * Returns keyword for default plural form. | |
| * | | * | |
| * @return keyword for default plural form. | | * @return keyword for default plural form. | |
| * @internal 4.0 | | * @internal 4.0 | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UnicodeString getKeywordOther() const; | | UnicodeString getKeywordOther() const; | |
| | | | |
| /** | | /** | |
| * Compares the equality of two PluralRules objects. | | * Compares the equality of two PluralRules objects. | |
| * | | * | |
| * @param other The other PluralRules object to be compared with. | | * @param other The other PluralRules object to be compared with. | |
| * @return True if the given PluralRules is the same as this | | * @return True if the given PluralRules is the same as this | |
| * PluralRules; false otherwise. | | * PluralRules; false otherwise. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UBool operator==(const PluralRules& other) const; | | virtual UBool operator==(const PluralRules& other) const; | |
| | | | |
| /** | | /** | |
| * Compares the inequality of two PluralRules objects. | | * Compares the inequality of two PluralRules objects. | |
| * | | * | |
| * @param other The PluralRules object to be compared with. | | * @param other The PluralRules object to be compared with. | |
| * @return True if the given PluralRules is not the same as this | | * @return True if the given PluralRules is not the same as this | |
| * PluralRules; false otherwise. | | * PluralRules; false otherwise. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UBool operator!=(const PluralRules& other) const {return !operator==(o
ther);} | | UBool operator!=(const PluralRules& other) const {return !operator==(o
ther);} | |
| | | | |
| /** | | /** | |
| * ICU "poor man's RTTI", returns a UClassID for this class. | | * ICU "poor man's RTTI", returns a UClassID for this class. | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| * | | * | |
| */ | | */ | |
| static UClassID U_EXPORT2 getStaticClassID(void); | | static UClassID U_EXPORT2 getStaticClassID(void); | |
| | | | |
| /** | | /** | |
| * ICU "poor man's RTTI", returns a UClassID for the actual class. | | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UClassID getDynamicClassID() const; | | virtual UClassID getDynamicClassID() const; | |
| | | | |
| private: | | private: | |
| Hashtable *fLocaleStringsHash; | | Hashtable *fLocaleStringsHash; | |
| UnicodeString mLocaleName; | | UnicodeString mLocaleName; | |
| RuleChain *mRules; | | RuleChain *mRules; | |
| RuleParser *mParser; | | RuleParser *mParser; | |
| | | | |
| PluralRules(); // default constructor not implemented | | PluralRules(); // default constructor not implemented | |
| | | | |
End of changes. 18 change blocks. |
| 18 lines changed or deleted | | 18 lines changed or added | |
|
| regex.h | | regex.h | |
| /* | | /* | |
| ********************************************************************** | | ********************************************************************** | |
|
| * Copyright (C) 2002-2008, International Business Machines | | * Copyright (C) 2002-2009, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| ********************************************************************** | | ********************************************************************** | |
| * file name: regex.h | | * file name: regex.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 2002oct22 | | * created on: 2002oct22 | |
| * created by: Andy Heninger | | * created by: Andy Heninger | |
| * | | * | |
| * ICU Regular Expressions, API for C++ | | * ICU Regular Expressions, API for C++ | |
| | | | |
| skipping to change at line 738 | | skipping to change at line 738 | |
| * Depending on the transparency and anchoring being used (see useTrans
parentBounds | | * Depending on the transparency and anchoring being used (see useTrans
parentBounds | |
| * and useAnchoringBounds), certain constructs such as anchors may beha
ve differently | | * and useAnchoringBounds), certain constructs such as anchors may beha
ve differently | |
| * at or around the boundaries of the region | | * at or around the boundaries of the region | |
| * | | * | |
| * The function will fail if start is greater than limit, or if either
index | | * The function will fail if start is greater than limit, or if either
index | |
| * is less than zero or greater than the length of the string being ma
tched. | | * is less than zero or greater than the length of the string being ma
tched. | |
| * | | * | |
| * @param start The index to begin searches at. | | * @param start The index to begin searches at. | |
| * @param limit The index to end searches at (exclusive). | | * @param limit The index to end searches at (exclusive). | |
| * @param status A reference to a UErrorCode to receive any errors. | | * @param status A reference to a UErrorCode to receive any errors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual RegexMatcher ®ion(int32_t start, int32_t limit, UErrorCode
&status); | | virtual RegexMatcher ®ion(int32_t start, int32_t limit, UErrorCode
&status); | |
| | | | |
| /** | | /** | |
| * Reports the start index of this matcher's region. The searches this
matcher | | * Reports the start index of this matcher's region. The searches this
matcher | |
| * conducts are limited to finding matches within regionStart (inclusiv
e) and | | * conducts are limited to finding matches within regionStart (inclusiv
e) and | |
| * regionEnd (exclusive). | | * regionEnd (exclusive). | |
| * | | * | |
| * @return The starting index of this matcher's region. | | * @return The starting index of this matcher's region. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual int32_t regionStart() const; | | virtual int32_t regionStart() const; | |
| | | | |
| /** | | /** | |
| * Reports the end (limit) index (exclusive) of this matcher's region.
The searches | | * Reports the end (limit) index (exclusive) of this matcher's region.
The searches | |
| * this matcher conducts are limited to finding matches within regionS
tart | | * this matcher conducts are limited to finding matches within regionS
tart | |
| * (inclusive) and regionEnd (exclusive). | | * (inclusive) and regionEnd (exclusive). | |
| * | | * | |
| * @return The ending point of this matcher's region. | | * @return The ending point of this matcher's region. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual int32_t regionEnd() const; | | virtual int32_t regionEnd() const; | |
| | | | |
| /** | | /** | |
| * Queries the transparency of region bounds for this matcher. | | * Queries the transparency of region bounds for this matcher. | |
| * See useTransparentBounds for a description of transparent and opaqu
e bounds. | | * See useTransparentBounds for a description of transparent and opaqu
e bounds. | |
| * By default, a matcher uses opaque region boundaries. | | * By default, a matcher uses opaque region boundaries. | |
| * | | * | |
| * @return TRUE if this matcher is using opaque bounds, false if it is
not. | | * @return TRUE if this matcher is using opaque bounds, false if it is
not. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UBool hasTransparentBounds() const; | | virtual UBool hasTransparentBounds() const; | |
| | | | |
| /** | | /** | |
| * Sets the transparency of region bounds for this matcher. | | * Sets the transparency of region bounds for this matcher. | |
| * Invoking this function with an argument of true will set this match
er to use transparent bounds. | | * Invoking this function with an argument of true will set this match
er to use transparent bounds. | |
| * If the boolean argument is false, then opaque bounds will be used. | | * If the boolean argument is false, then opaque bounds will be used. | |
| * | | * | |
| * Using transparent bounds, the boundaries of this matcher's region a
re transparent | | * Using transparent bounds, the boundaries of this matcher's region a
re transparent | |
| * to lookahead, lookbehind, and boundary matching constructs. Those c
onstructs can | | * to lookahead, lookbehind, and boundary matching constructs. Those c
onstructs can | |
| * see text beyond the boundaries of the region while checking for a m
atch. | | * see text beyond the boundaries of the region while checking for a m
atch. | |
| * | | * | |
| * With opaque bounds, no text outside of the matcher's region is visi
ble to lookahead, | | * With opaque bounds, no text outside of the matcher's region is visi
ble to lookahead, | |
| * lookbehind, and boundary matching constructs. | | * lookbehind, and boundary matching constructs. | |
| * | | * | |
| * By default, a matcher uses opaque bounds. | | * By default, a matcher uses opaque bounds. | |
| * | | * | |
| * @param b TRUE for transparent bounds; FALSE for opaque bounds | | * @param b TRUE for transparent bounds; FALSE for opaque bounds | |
| * @return This Matcher; | | * @return This Matcher; | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| **/ | | **/ | |
| virtual RegexMatcher &useTransparentBounds(UBool b); | | virtual RegexMatcher &useTransparentBounds(UBool b); | |
| | | | |
| /** | | /** | |
| * Return true if this matcher is using anchoring bounds. | | * Return true if this matcher is using anchoring bounds. | |
| * By default, matchers use anchoring region boounds. | | * By default, matchers use anchoring region boounds. | |
| * | | * | |
| * @return TRUE if this matcher is using anchoring bounds. | | * @return TRUE if this matcher is using anchoring bounds. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UBool hasAnchoringBounds() const; | | virtual UBool hasAnchoringBounds() const; | |
| | | | |
| /** | | /** | |
| * Set whether this matcher is using Anchoring Bounds for its region. | | * Set whether this matcher is using Anchoring Bounds for its region. | |
| * With anchoring bounds, pattern anchors such as ^ and $ will match a
t the start | | * With anchoring bounds, pattern anchors such as ^ and $ will match a
t the start | |
| * and end of the region. Without Anchoring Bounds, anchors will only
match at | | * and end of the region. Without Anchoring Bounds, anchors will only
match at | |
| * the positions they would in the complete text. | | * the positions they would in the complete text. | |
| * | | * | |
| * Anchoring Bounds are the default for regions. | | * Anchoring Bounds are the default for regions. | |
| * | | * | |
| * @param b TRUE if to enable anchoring bounds; FALSE to disable them. | | * @param b TRUE if to enable anchoring bounds; FALSE to disable them. | |
| * @return This Matcher | | * @return This Matcher | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual RegexMatcher &useAnchoringBounds(UBool b); | | virtual RegexMatcher &useAnchoringBounds(UBool b); | |
| | | | |
| /** | | /** | |
| * Return TRUE if the most recent matching operation touched the | | * Return TRUE if the most recent matching operation touched the | |
| * end of the text being processed. In this case, additional input t
ext could | | * end of the text being processed. In this case, additional input t
ext could | |
| * change the results of that match. | | * change the results of that match. | |
| * | | * | |
| * hitEnd() is defined for both successful and unsuccessful matches. | | * hitEnd() is defined for both successful and unsuccessful matches. | |
| * In either case hitEnd() will return TRUE if if the end of the text
was | | * In either case hitEnd() will return TRUE if if the end of the text
was | |
| * reached at any point during the matching process. | | * reached at any point during the matching process. | |
| * | | * | |
| * @return TRUE if the most recent match hit the end of input | | * @return TRUE if the most recent match hit the end of input | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UBool hitEnd() const; | | virtual UBool hitEnd() const; | |
| | | | |
| /** | | /** | |
| * Return TRUE the most recent match succeeded and additional input co
uld cause | | * Return TRUE the most recent match succeeded and additional input co
uld cause | |
| * it to fail. If this method returns false and a match was found, the
n more input | | * it to fail. If this method returns false and a match was found, the
n more input | |
| * might change the match but the match won't be lost. If a match was
not found, | | * might change the match but the match won't be lost. If a match was
not found, | |
| * then requireEnd has no meaning. | | * then requireEnd has no meaning. | |
| * | | * | |
| * @return TRUE if more input could cause the most recent match to no
longer match. | | * @return TRUE if more input could cause the most recent match to no
longer match. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual UBool requireEnd() const; | | virtual UBool requireEnd() const; | |
| | | | |
| /** | | /** | |
| * Returns the pattern that is interpreted by this matcher. | | * Returns the pattern that is interpreted by this matcher. | |
| * @return the RegexPattern for this RegexMatcher | | * @return the RegexPattern for this RegexMatcher | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| virtual const RegexPattern &pattern() const; | | virtual const RegexPattern &pattern() const; | |
| | | | |
| | | | |
| skipping to change at line 977 | | skipping to change at line 977 | |
| * The units of the limit are steps of the match engine. | | * The units of the limit are steps of the match engine. | |
| * Correspondence with actual processor time will depend on the speed | | * Correspondence with actual processor time will depend on the speed | |
| * of the processor and the details of the specific pattern, but will | | * of the processor and the details of the specific pattern, but will | |
| * typically be on the order of milliseconds. | | * typically be on the order of milliseconds. | |
| * <p> | | * <p> | |
| * By default, the matching time is not limited. | | * By default, the matching time is not limited. | |
| * <p> | | * <p> | |
| * | | * | |
| * @param limit The limit value, or 0 for no limit. | | * @param limit The limit value, or 0 for no limit. | |
| * @param status A reference to a UErrorCode to receive any err
ors. | | * @param status A reference to a UErrorCode to receive any err
ors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual void setTimeLimit(int32_t limit, UErrorCode &status); | | virtual void setTimeLimit(int32_t limit, UErrorCode &status); | |
| | | | |
| /** | | /** | |
| * Get the time limit, if any, for match operations made with this Match
er. | | * Get the time limit, if any, for match operations made with this Match
er. | |
| * | | * | |
| * @return the maximum allowed time for a match, in units of processin
g steps. | | * @return the maximum allowed time for a match, in units of processin
g steps. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual int32_t getTimeLimit() const; | | virtual int32_t getTimeLimit() const; | |
| | | | |
| /** | | /** | |
| * Set the amount of heap storage avaliable for use by the match backtr
acking stack. | | * Set the amount of heap storage avaliable for use by the match backtr
acking stack. | |
| * The matcher is also reset, discarding any results from previous matc
hes. | | * The matcher is also reset, discarding any results from previous matc
hes. | |
| * <p> | | * <p> | |
| * ICU uses a backtracking regular expression engine, with the backtrac
k stack | | * ICU uses a backtracking regular expression engine, with the backtrac
k stack | |
| * maintained on the heap. This function sets the limit to the amount
of memory | | * maintained on the heap. This function sets the limit to the amount
of memory | |
| * that can be used for this purpose. A backtracking stack overflow w
ill | | * that can be used for this purpose. A backtracking stack overflow w
ill | |
| | | | |
| skipping to change at line 1008 | | skipping to change at line 1008 | |
| * A limit is desirable because a malicious or poorly designed pattern
can use | | * A limit is desirable because a malicious or poorly designed pattern
can use | |
| * excessive memory, potentially crashing the process. A limit is enab
led | | * excessive memory, potentially crashing the process. A limit is enab
led | |
| * by default. | | * by default. | |
| * <p> | | * <p> | |
| * @param limit The maximum size, in bytes, of the matching backtrack
stack. | | * @param limit The maximum size, in bytes, of the matching backtrack
stack. | |
| * A value of zero means no limit. | | * A value of zero means no limit. | |
| * The limit must be greater or equal to zero. | | * The limit must be greater or equal to zero. | |
| * | | * | |
| * @param status A reference to a UErrorCode to receive any errors. | | * @param status A reference to a UErrorCode to receive any errors. | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual void setStackLimit(int32_t limit, UErrorCode &status); | | virtual void setStackLimit(int32_t limit, UErrorCode &status); | |
| | | | |
| /** | | /** | |
| * Get the size of the heap storage available for use by the back track
ing stack. | | * Get the size of the heap storage available for use by the back track
ing stack. | |
| * | | * | |
| * @return the maximum backtracking stack size, in bytes, or zero if t
he | | * @return the maximum backtracking stack size, in bytes, or zero if t
he | |
| * stack size is unlimited. | | * stack size is unlimited. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual int32_t getStackLimit() const; | | virtual int32_t getStackLimit() const; | |
| | | | |
| /** | | /** | |
| * Set a callback function for use with this Matcher. | | * Set a callback function for use with this Matcher. | |
| * During matching operations the function will be called periodically, | | * During matching operations the function will be called periodically, | |
| * giving the application the opportunity to terminate a long-running | | * giving the application the opportunity to terminate a long-running | |
| * match. | | * match. | |
| * | | * | |
| * @param callback A pointer to the user-supplied callback funct
ion. | | * @param callback A pointer to the user-supplied callback funct
ion. | |
| * @param context User context pointer. The value supplied at
the | | * @param context User context pointer. The value supplied at
the | |
| * time the callback function is set will be sav
ed | | * time the callback function is set will be sav
ed | |
| * and passed to the callback each time that it
is called. | | * and passed to the callback each time that it
is called. | |
| * @param status A reference to a UErrorCode to receive any er
rors. | | * @param status A reference to a UErrorCode to receive any er
rors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual void setMatchCallback(URegexMatchCallback *callback, | | virtual void setMatchCallback(URegexMatchCallback *callback, | |
| const void *context, | | const void *context, | |
| UErrorCode &status); | | UErrorCode &status); | |
| | | | |
| /** | | /** | |
| * Get the callback function for this URegularExpression. | | * Get the callback function for this URegularExpression. | |
| * | | * | |
| * @param callback Out paramater, receives a pointer to the user
-supplied | | * @param callback Out paramater, receives a pointer to the user
-supplied | |
| * callback function. | | * callback function. | |
| * @param context Out parameter, receives the user context poin
ter that | | * @param context Out parameter, receives the user context poin
ter that | |
| * was set when uregex_setMatchCallback() was ca
lled. | | * was set when uregex_setMatchCallback() was ca
lled. | |
| * @param status A reference to a UErrorCode to receive any er
rors. | | * @param status A reference to a UErrorCode to receive any er
rors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| virtual void getMatchCallback(URegexMatchCallback *&callback, | | virtual void getMatchCallback(URegexMatchCallback *&callback, | |
| const void *&context, | | const void *&context, | |
| UErrorCode &status); | | UErrorCode &status); | |
| | | | |
| /** | | /** | |
| * setTrace Debug function, enable/disable tracing of the matching
engine. | | * setTrace Debug function, enable/disable tracing of the matching
engine. | |
| * For internal ICU development use only. DO NO USE!!!! | | * For internal ICU development use only. DO NO USE!!!! | |
| * @internal | | * @internal | |
| */ | | */ | |
| | | | |
End of changes. 16 change blocks. |
| 16 lines changed or deleted | | 16 lines changed or added | |
|
| simpletz.h | | simpletz.h | |
| /* | | /* | |
| **************************************************************************
****** | | **************************************************************************
****** | |
|
| * Copyright (C) 1997-2008, International Business Machines
* | | * Copyright (C) 1997-2009, International Business Machines
* | |
| * Corporation and others. All Rights Reserved.
* | | * Corporation and others. All Rights Reserved.
* | |
| **************************************************************************
****** | | **************************************************************************
****** | |
| * | | * | |
| * File SIMPLETZ.H | | * File SIMPLETZ.H | |
| * | | * | |
| * Modification History: | | * Modification History: | |
| * | | * | |
| * Date Name Description | | * Date Name Description | |
| * 04/21/97 aliu Overhauled header. | | * 04/21/97 aliu Overhauled header. | |
| * 08/10/98 stephen JDK 1.2 sync | | * 08/10/98 stephen JDK 1.2 sync | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| class TimeZoneTransition; | | class TimeZoneTransition; | |
| class AnnualTimeZoneRule; | | class AnnualTimeZoneRule; | |
| | | | |
| /** | | /** | |
| * <code>SimpleTimeZone</code> is a concrete subclass of <code>TimeZone</co
de> | | * <code>SimpleTimeZone</code> is a concrete subclass of <code>TimeZone</co
de> | |
| * that represents a time zone for use with a Gregorian calendar. This | | * that represents a time zone for use with a Gregorian calendar. This | |
| * class does not handle historical changes. | | * class does not handle historical changes. | |
| * <P> | | * <P> | |
| * When specifying daylight-savings-time begin and end dates, use a negativ
e value for | | * When specifying daylight-savings-time begin and end dates, use a negativ
e value for | |
| * <code>dayOfWeekInMonth</code> to indicate that <code>SimpleTimeZone</cod
e> should | | * <code>dayOfWeekInMonth</code> to indicate that <code>SimpleTimeZone</cod
e> should | |
|
| * count from the end of the month backwards. For example, in the U.S., Day | | * count from the end of the month backwards. For example, if Daylight Savi | |
| light Savings | | ngs | |
| * Time ends at the last (dayOfWeekInMonth = -1) Sunday in October, at 2 AM | | * Time starts or ends at the last Sunday a month, use <code>dayOfWeekInMon | |
| in standard | | th = -1</code> | |
| * time. | | * along with <code>dayOfWeek = UCAL_SUNDAY</code> to specify the rule. | |
| * | | * | |
| * @see Calendar | | * @see Calendar | |
| * @see GregorianCalendar | | * @see GregorianCalendar | |
| * @see TimeZone | | * @see TimeZone | |
| * @author D. Goldsmith, Mark Davis, Chen-Lieh Huang, Alan Liu | | * @author D. Goldsmith, Mark Davis, Chen-Lieh Huang, Alan Liu | |
| */ | | */ | |
| class U_I18N_API SimpleTimeZone: public BasicTimeZone { | | class U_I18N_API SimpleTimeZone: public BasicTimeZone { | |
| public: | | public: | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 271 | | skipping to change at line 271 | |
| * observing its specified daylight savings time rules. The time zone
is considered | | * observing its specified daylight savings time rules. The time zone
is considered | |
| * not to observe daylight savings time prior to that year; SimpleTimeZ
one doesn't | | * not to observe daylight savings time prior to that year; SimpleTimeZ
one doesn't | |
| * support historical daylight-savings-time rules. | | * support historical daylight-savings-time rules. | |
| * @param year the daylight savings starting year. | | * @param year the daylight savings starting year. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| void setStartYear(int32_t year); | | void setStartYear(int32_t year); | |
| | | | |
| /** | | /** | |
| * Sets the daylight savings starting rule. For example, in the U.S., D
aylight Savings | | * Sets the daylight savings starting rule. For example, in the U.S., D
aylight Savings | |
|
| * Time starts at the first Sunday in April, at 2 AM in standard time. | | * Time starts at the second Sunday in March, at 2 AM in standard time. | |
| * Therefore, you can set the start rule by calling: | | * Therefore, you can set the start rule by calling: | |
|
| * setStartRule(TimeFields.APRIL, 1, TimeFields.SUNDAY, 2*60*60*1000); | | * setStartRule(UCAL_MARCH, 2, UCAL_SUNDAY, 2*60*60*1000); | |
| * The dayOfWeekInMonth and dayOfWeek parameters together specify how t
o calculate | | * The dayOfWeekInMonth and dayOfWeek parameters together specify how t
o calculate | |
| * the exact starting date. Their exact meaning depend on their respec
tive signs, | | * the exact starting date. Their exact meaning depend on their respec
tive signs, | |
| * allowing various types of rules to be constructed, as follows: | | * allowing various types of rules to be constructed, as follows: | |
| * <ul> | | * <ul> | |
| * <li>If both dayOfWeekInMonth and dayOfWeek are positive, they spec
ify the | | * <li>If both dayOfWeekInMonth and dayOfWeek are positive, they spec
ify the | |
| * day of week in the month (e.g., (2, WEDNESDAY) is the second W
ednesday | | * day of week in the month (e.g., (2, WEDNESDAY) is the second W
ednesday | |
| * of the month).</li> | | * of the month).</li> | |
| * <li>If dayOfWeek is positive and dayOfWeekInMonth is negative, the
y specify | | * <li>If dayOfWeek is positive and dayOfWeekInMonth is negative, the
y specify | |
| * the day of week in the month counting backward from the end of
the month. | | * the day of week in the month counting backward from the end of
the month. | |
| * (e.g., (-1, MONDAY) is the last Monday in the month)</li> | | * (e.g., (-1, MONDAY) is the last Monday in the month)</li> | |
| | | | |
| skipping to change at line 315 | | skipping to change at line 315 | |
| * the member description for an example. | | * the member description for an example. | |
| * @param time the daylight savings starting time. Please see the membe
r | | * @param time the daylight savings starting time. Please see the membe
r | |
| * description for an example. | | * description for an example. | |
| * @param status An UErrorCode | | * @param status An UErrorCode | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| void setStartRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayO
fWeek, | | void setStartRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayO
fWeek, | |
| int32_t time, UErrorCode& status); | | int32_t time, UErrorCode& status); | |
| /** | | /** | |
| * Sets the daylight savings starting rule. For example, in the U.S., D
aylight Savings | | * Sets the daylight savings starting rule. For example, in the U.S., D
aylight Savings | |
|
| * Time starts at the first Sunday in April, at 2 AM in standard time. | | * Time starts at the second Sunday in March, at 2 AM in standard time. | |
| * Therefore, you can set the start rule by calling: | | * Therefore, you can set the start rule by calling: | |
|
| * setStartRule(TimeFields.APRIL, 1, TimeFields.SUNDAY, 2*60*60*1000); | | * setStartRule(UCAL_MARCH, 2, UCAL_SUNDAY, 2*60*60*1000); | |
| * The dayOfWeekInMonth and dayOfWeek parameters together specify how t
o calculate | | * The dayOfWeekInMonth and dayOfWeek parameters together specify how t
o calculate | |
| * the exact starting date. Their exact meaning depend on their respec
tive signs, | | * the exact starting date. Their exact meaning depend on their respec
tive signs, | |
| * allowing various types of rules to be constructed, as follows: | | * allowing various types of rules to be constructed, as follows: | |
| * <ul> | | * <ul> | |
| * <li>If both dayOfWeekInMonth and dayOfWeek are positive, they spec
ify the | | * <li>If both dayOfWeekInMonth and dayOfWeek are positive, they spec
ify the | |
| * day of week in the month (e.g., (2, WEDNESDAY) is the second W
ednesday | | * day of week in the month (e.g., (2, WEDNESDAY) is the second W
ednesday | |
| * of the month).</li> | | * of the month).</li> | |
| * <li>If dayOfWeek is positive and dayOfWeekInMonth is negative, the
y specify | | * <li>If dayOfWeek is positive and dayOfWeekInMonth is negative, the
y specify | |
| * the day of week in the month counting backward from the end of
the month. | | * the day of week in the month counting backward from the end of
the month. | |
| * (e.g., (-1, MONDAY) is the last Monday in the month)</li> | | * (e.g., (-1, MONDAY) is the last Monday in the month)</li> | |
| | | | |
| skipping to change at line 429 | | skipping to change at line 429 | |
| * @param after If true, this rule selects the first dayOfWeek
on | | * @param after If true, this rule selects the first dayOfWeek
on | |
| * or after dayOfMonth. If false, this rule selec
ts | | * or after dayOfMonth. If false, this rule selec
ts | |
| * the last dayOfWeek on or before dayOfMonth. | | * the last dayOfWeek on or before dayOfMonth. | |
| * @param status An UErrorCode | | * @param status An UErrorCode | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| void setStartRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, | | void setStartRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek, | |
| int32_t time, TimeMode mode, UBool after, UErrorCode&
status); | | int32_t time, TimeMode mode, UBool after, UErrorCode&
status); | |
| | | | |
| /** | | /** | |
|
| * Sets the daylight savings ending rule. For example, in the U.S., Day
light | | * Sets the daylight savings ending rule. For example, if Daylight | |
| * Savings Time ends at the last (-1) Sunday in October, at 2 AM in sta
ndard time. | | * Savings Time ends at the last (-1) Sunday in October, at 2 AM in sta
ndard time. | |
| * Therefore, you can set the end rule by calling: | | * Therefore, you can set the end rule by calling: | |
| * <pre> | | * <pre> | |
|
| * . setEndRule(TimeFields.OCTOBER, -1, TimeFields.SUNDAY, 2*60*60*10
00); | | * setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2*60*60*1000); | |
| * </pre> | | * </pre> | |
| * Various other types of rules can be specified by manipulating the da
yOfWeek | | * Various other types of rules can be specified by manipulating the da
yOfWeek | |
| * and dayOfWeekInMonth parameters. For complete details, see the docu
mentation | | * and dayOfWeekInMonth parameters. For complete details, see the docu
mentation | |
| * for setStartRule(). | | * for setStartRule(). | |
| * | | * | |
| * @param month the daylight savings ending month. Month is 0-based. | | * @param month the daylight savings ending month. Month is 0-based. | |
| * eg, 0 for January. | | * eg, 0 for January. | |
| * @param dayOfWeekInMonth the daylight savings ending | | * @param dayOfWeekInMonth the daylight savings ending | |
| * day-of-week-in-month. See setStartRule() for a complete explanation. | | * day-of-week-in-month. See setStartRule() for a complete explanation. | |
| * @param dayOfWeek the daylight savings ending day-of-week. See setSta
rtRule() | | * @param dayOfWeek the daylight savings ending day-of-week. See setSta
rtRule() | |
| * for a complete explanation. | | * for a complete explanation. | |
| * @param time the daylight savings ending time. Please see the member | | * @param time the daylight savings ending time. Please see the member | |
| * description for an example. | | * description for an example. | |
| * @param status An UErrorCode | | * @param status An UErrorCode | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| void setEndRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfW
eek, | | void setEndRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfW
eek, | |
| int32_t time, UErrorCode& status); | | int32_t time, UErrorCode& status); | |
| | | | |
| /** | | /** | |
|
| * Sets the daylight savings ending rule. For example, in the U.S., Day
light | | * Sets the daylight savings ending rule. For example, if Daylight | |
| * Savings Time ends at the last (-1) Sunday in October, at 2 AM in sta
ndard time. | | * Savings Time ends at the last (-1) Sunday in October, at 2 AM in sta
ndard time. | |
| * Therefore, you can set the end rule by calling: | | * Therefore, you can set the end rule by calling: | |
| * <pre> | | * <pre> | |
|
| * . setEndRule(TimeFields.OCTOBER, -1, TimeFields.SUNDAY, 2*60*60*10
00); | | * setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2*60*60*1000); | |
| * </pre> | | * </pre> | |
| * Various other types of rules can be specified by manipulating the da
yOfWeek | | * Various other types of rules can be specified by manipulating the da
yOfWeek | |
| * and dayOfWeekInMonth parameters. For complete details, see the docu
mentation | | * and dayOfWeekInMonth parameters. For complete details, see the docu
mentation | |
| * for setStartRule(). | | * for setStartRule(). | |
| * | | * | |
| * @param month the daylight savings ending month. Month is 0-based. | | * @param month the daylight savings ending month. Month is 0-based. | |
| * eg, 0 for January. | | * eg, 0 for January. | |
| * @param dayOfWeekInMonth the daylight savings ending | | * @param dayOfWeekInMonth the daylight savings ending | |
| * day-of-week-in-month. See setStartRule() for a complete explanation. | | * day-of-week-in-month. See setStartRule() for a complete explanation. | |
| * @param dayOfWeek the daylight savings ending day-of-week. See setSta
rtRule() | | * @param dayOfWeek the daylight savings ending day-of-week. See setSta
rtRule() | |
| | | | |
End of changes. 10 change blocks. |
| 14 lines changed or deleted | | 14 lines changed or added | |
|
| smpdtfmt.h | | smpdtfmt.h | |
| | | | |
| skipping to change at line 241 | | skipping to change at line 241 | |
| * [Note:] Not all locales support SimpleDateFormat; for full generalit
y, | | * [Note:] Not all locales support SimpleDateFormat; for full generalit
y, | |
| * use the factory methods in the DateFormat class. | | * use the factory methods in the DateFormat class. | |
| * @param pattern the pattern for the format. | | * @param pattern the pattern for the format. | |
| * @param status Output param set to success/failure code. | | * @param status Output param set to success/failure code. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| SimpleDateFormat(const UnicodeString& pattern, | | SimpleDateFormat(const UnicodeString& pattern, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
|
| | | * Construct a SimpleDateFormat using the given pattern, numbering syst | |
| | | em override, and the default locale. | |
| | | * The locale is used to obtain the symbols used in formatting (e.g., t | |
| | | he | |
| | | * names of the months), but not to provide the pattern. | |
| | | * <P> | |
| | | * A numbering system override is a string containing either the name o | |
| | | f a known numbering system, | |
| | | * or a set of field and numbering system pairs that specify which fiel | |
| | | ds are to be formattied with | |
| | | * the alternate numbering system. For example, to specify that all nu | |
| | | meric fields in the specified | |
| | | * date or time pattern are to be rendered using Thai digits, simply sp | |
| | | ecify the numbering system override | |
| | | * as "thai". To specify that just the year portion of the date be for | |
| | | matted using Hebrew numbering, | |
| | | * use the override string "y=hebrew". Numbering system overrides can | |
| | | be combined using a semi-colon | |
| | | * character in the override string, such as "d=decimal;M=arabic;y=hebr | |
| | | ew", etc. | |
| | | * | |
| | | * <P> | |
| | | * [Note:] Not all locales support SimpleDateFormat; for full generalit | |
| | | y, | |
| | | * use the factory methods in the DateFormat class. | |
| | | * @param pattern the pattern for the format. | |
| | | * @param override the override string. | |
| | | * @param status Output param set to success/failure code. | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | SimpleDateFormat(const UnicodeString& pattern, | |
| | | const UnicodeString& override, | |
| | | UErrorCode& status); | |
| | | | |
| | | /** | |
| * Construct a SimpleDateFormat using the given pattern and locale. | | * Construct a SimpleDateFormat using the given pattern and locale. | |
| * The locale is used to obtain the symbols used in formatting (e.g., t
he | | * The locale is used to obtain the symbols used in formatting (e.g., t
he | |
| * names of the months), but not to provide the pattern. | | * names of the months), but not to provide the pattern. | |
| * <P> | | * <P> | |
| * [Note:] Not all locales support SimpleDateFormat; for full generalit
y, | | * [Note:] Not all locales support SimpleDateFormat; for full generalit
y, | |
| * use the factory methods in the DateFormat class. | | * use the factory methods in the DateFormat class. | |
| * @param pattern the pattern for the format. | | * @param pattern the pattern for the format. | |
| * @param locale the given locale. | | * @param locale the given locale. | |
| * @param status Output param set to success/failure code. | | * @param status Output param set to success/failure code. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| SimpleDateFormat(const UnicodeString& pattern, | | SimpleDateFormat(const UnicodeString& pattern, | |
| const Locale& locale, | | const Locale& locale, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
|
| | | * Construct a SimpleDateFormat using the given pattern, numbering syst | |
| | | em override, and locale. | |
| | | * The locale is used to obtain the symbols used in formatting (e.g., t | |
| | | he | |
| | | * names of the months), but not to provide the pattern. | |
| | | * <P> | |
| | | * A numbering system override is a string containing either the name o | |
| | | f a known numbering system, | |
| | | * or a set of field and numbering system pairs that specify which fiel | |
| | | ds are to be formattied with | |
| | | * the alternate numbering system. For example, to specify that all nu | |
| | | meric fields in the specified | |
| | | * date or time pattern are to be rendered using Thai digits, simply sp | |
| | | ecify the numbering system override | |
| | | * as "thai". To specify that just the year portion of the date be for | |
| | | matted using Hebrew numbering, | |
| | | * use the override string "y=hebrew". Numbering system overrides can | |
| | | be combined using a semi-colon | |
| | | * character in the override string, such as "d=decimal;M=arabic;y=hebr | |
| | | ew", etc. | |
| | | * <P> | |
| | | * [Note:] Not all locales support SimpleDateFormat; for full generalit | |
| | | y, | |
| | | * use the factory methods in the DateFormat class. | |
| | | * @param pattern the pattern for the format. | |
| | | * @param override the numbering system override. | |
| | | * @param locale the given locale. | |
| | | * @param status Output param set to success/failure code. | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | SimpleDateFormat(const UnicodeString& pattern, | |
| | | const UnicodeString& override, | |
| | | const Locale& locale, | |
| | | UErrorCode& status); | |
| | | | |
| | | /** | |
| * Construct a SimpleDateFormat using the given pattern and locale-spec
ific | | * Construct a SimpleDateFormat using the given pattern and locale-spec
ific | |
| * symbol data. The formatter takes ownership of the DateFormatSymbols
object; | | * symbol data. The formatter takes ownership of the DateFormatSymbols
object; | |
| * the caller is no longer responsible for deleting it. | | * the caller is no longer responsible for deleting it. | |
| * @param pattern the given pattern for the format. | | * @param pattern the given pattern for the format. | |
| * @param formatDataToAdopt the symbols to be adopted. | | * @param formatDataToAdopt the symbols to be adopted. | |
| * @param status Output param set to success/faulure code. | | * @param status Output param set to success/faulure code. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| SimpleDateFormat(const UnicodeString& pattern, | | SimpleDateFormat(const UnicodeString& pattern, | |
| DateFormatSymbols* formatDataToAdopt, | | DateFormatSymbols* formatDataToAdopt, | |
| | | | |
| skipping to change at line 899 | | skipping to change at line 950 | |
| void initNumberFormatters(const Locale &locale,UErrorCode &status); | | void initNumberFormatters(const Locale &locale,UErrorCode &status); | |
| | | | |
| /** | | /** | |
| * Get the numbering system to be used for a particular field. | | * Get the numbering system to be used for a particular field. | |
| */ | | */ | |
| NumberFormat * getNumberFormat(UDateFormatField index) const; | | NumberFormat * getNumberFormat(UDateFormatField index) const; | |
| | | | |
| /** | | /** | |
| * Parse the given override string and set up structures for number for
mats | | * Parse the given override string and set up structures for number for
mats | |
| */ | | */ | |
|
| void processOverrideString(const Locale &locale, UnicodeString &str, in
t8_t type, UErrorCode &status); | | void processOverrideString(const Locale &locale, const UnicodeString &s
tr, int8_t type, UErrorCode &status); | |
| | | | |
| /** | | /** | |
| * Used to map pattern characters to Calendar field identifiers. | | * Used to map pattern characters to Calendar field identifiers. | |
| */ | | */ | |
| static const UCalendarDateFields fgPatternIndexToCalendarField[]; | | static const UCalendarDateFields fgPatternIndexToCalendarField[]; | |
| | | | |
| /** | | /** | |
| * Map index into pattern character string to DateFormat field number | | * Map index into pattern character string to DateFormat field number | |
| */ | | */ | |
| static const UDateFormatField fgPatternIndexToDateFormatField[]; | | static const UDateFormatField fgPatternIndexToDateFormatField[]; | |
| | | | |
| skipping to change at line 978 | | skipping to change at line 1029 | |
| | | | |
| typedef struct NSOverride { | | typedef struct NSOverride { | |
| NumberFormat *nf; | | NumberFormat *nf; | |
| int32_t hash; | | int32_t hash; | |
| NSOverride *next; | | NSOverride *next; | |
| } NSOverride; | | } NSOverride; | |
| | | | |
| /* | | /* | |
| * MessageFormat instances used for localized GMT format | | * MessageFormat instances used for localized GMT format | |
| */ | | */ | |
|
| | | enum { | |
| | | kGMTNegativeHMS = 0, | |
| | | kGMTNegativeHM, | |
| | | kGMTPositiveHMS, | |
| | | kGMTPositiveHM, | |
| | | | |
| | | kNumGMTFormatters | |
| | | }; | |
| | | enum { | |
| | | kGMTNegativeHMSMinLenIdx = 0, | |
| | | kGMTPositiveHMSMinLenIdx, | |
| | | | |
| | | kNumGMTFormatMinLengths | |
| | | }; | |
| | | | |
| MessageFormat **fGMTFormatters; | | MessageFormat **fGMTFormatters; | |
|
| | | // If a GMT hour format has a second field, we need to make sure | |
| | | // the length of input localized GMT string must match the expected | |
| | | // length. Otherwise, sub DateForamt handling offset format may | |
| | | // unexpectedly success parsing input GMT string without second field. | |
| | | // See #6880 about this issue. | |
| | | // TODO: SimpleDateFormat should provide an option to invalidate | |
| | | // | |
| | | int32_t fGMTFormatHmsMinLen[kNumGMTFormatMinLengths]; | |
| | | | |
| NumberFormat **fNumberFormatters; | | NumberFormat **fNumberFormatters; | |
| | | | |
| NSOverride *fOverrideList; | | NSOverride *fOverrideList; | |
| | | | |
| UBool fHaveDefaultCentury; | | UBool fHaveDefaultCentury; | |
| }; | | }; | |
| | | | |
| inline UDate | | inline UDate | |
| SimpleDateFormat::get2DigitYearStart(UErrorCode& /*status*/) const | | SimpleDateFormat::get2DigitYearStart(UErrorCode& /*status*/) const | |
| | | | |
End of changes. 5 change blocks. |
| 1 lines changed or deleted | | 95 lines changed or added | |
|
| timezone.h | | timezone.h | |
| /************************************************************************* | | /************************************************************************* | |
|
| * Copyright (c) 1997-2008, International Business Machines Corporation | | * Copyright (c) 1997-2009, International Business Machines Corporation | |
| * and others. All Rights Reserved. | | * and others. All Rights Reserved. | |
| ************************************************************************** | | ************************************************************************** | |
| * | | * | |
| * File TIMEZONE.H | | * File TIMEZONE.H | |
| * | | * | |
| * Modification History: | | * Modification History: | |
| * | | * | |
| * Date Name Description | | * Date Name Description | |
| * 04/21/97 aliu Overhauled header. | | * 04/21/97 aliu Overhauled header. | |
| * 07/09/97 helena Changed createInstance to createDefault. | | * 07/09/97 helena Changed createInstance to createDefault. | |
| | | | |
| skipping to change at line 60 | | skipping to change at line 60 | |
| * savings. | | * savings. | |
| * | | * | |
| * <p> | | * <p> | |
| * Typically, you get a <code>TimeZone</code> using <code>createDefault</co
de> | | * Typically, you get a <code>TimeZone</code> using <code>createDefault</co
de> | |
| * which creates a <code>TimeZone</code> based on the time zone where the p
rogram | | * which creates a <code>TimeZone</code> based on the time zone where the p
rogram | |
| * is running. For example, for a program running in Japan, <code>createDef
ault</code> | | * is running. For example, for a program running in Japan, <code>createDef
ault</code> | |
| * creates a <code>TimeZone</code> object based on Japanese Standard Time. | | * creates a <code>TimeZone</code> object based on Japanese Standard Time. | |
| * | | * | |
| * <p> | | * <p> | |
| * You can also get a <code>TimeZone</code> using <code>createTimeZone</cod
e> along | | * You can also get a <code>TimeZone</code> using <code>createTimeZone</cod
e> along | |
|
| * with a time zone ID. For instance, the time zone ID for the Pacific | | * with a time zone ID. For instance, the time zone ID for the US Pacific | |
| * Standard Time zone is "PST". So, you can get a PST <code>TimeZone</code> | | * Time zone is "America/Los_Angeles". So, you can get a Pacific Time <code | |
| object | | >TimeZone</code> object | |
| * with: | | * with: | |
| * \htmlonly<blockquote>\endhtmlonly | | * \htmlonly<blockquote>\endhtmlonly | |
| * <pre> | | * <pre> | |
|
| * TimeZone *tz = TimeZone::createTimeZone("PST"); | | * TimeZone *tz = TimeZone::createTimeZone("America/Los_Angeles"); | |
| * </pre> | | * </pre> | |
| * \htmlonly</blockquote>\endhtmlonly | | * \htmlonly</blockquote>\endhtmlonly | |
| * You can use <code>getAvailableIDs</code> method to iterate through | | * You can use <code>getAvailableIDs</code> method to iterate through | |
| * all the supported time zone IDs. You can then choose a | | * all the supported time zone IDs. You can then choose a | |
| * supported ID to get a <code>TimeZone</code>. | | * supported ID to get a <code>TimeZone</code>. | |
| * If the time zone you want is not represented by one of the | | * If the time zone you want is not represented by one of the | |
| * supported IDs, then you can create a custom time zone ID with | | * supported IDs, then you can create a custom time zone ID with | |
| * the following syntax: | | * the following syntax: | |
| * | | * | |
| * \htmlonly<blockquote>\endhtmlonly | | * \htmlonly<blockquote>\endhtmlonly | |
| | | | |
| skipping to change at line 106 | | skipping to change at line 106 | |
| * <li>An ID. This is a text string that uniquely identifies the time z
one.</li> | | * <li>An ID. This is a text string that uniquely identifies the time z
one.</li> | |
| * </ul> | | * </ul> | |
| * | | * | |
| * (Only the ID is actually implemented in TimeZone; subclasses of TimeZone
may handle | | * (Only the ID is actually implemented in TimeZone; subclasses of TimeZone
may handle | |
| * daylight savings time and GMT offset in different ways. Currently we on
ly have one | | * daylight savings time and GMT offset in different ways. Currently we on
ly have one | |
| * TimeZone subclass: SimpleTimeZone.) | | * TimeZone subclass: SimpleTimeZone.) | |
| * <P> | | * <P> | |
| * The TimeZone class contains a static list containing a TimeZone object f
or every | | * The TimeZone class contains a static list containing a TimeZone object f
or every | |
| * combination of GMT offset and daylight-savings time rules currently in u
se in the | | * combination of GMT offset and daylight-savings time rules currently in u
se in the | |
| * world, each with a unique ID. Each ID consists of a region (usually a c
ontinent or | | * world, each with a unique ID. Each ID consists of a region (usually a c
ontinent or | |
|
| * ocean) and a city in that region, separated by a slash, (for example, Pa | | * ocean) and a city in that region, separated by a slash, (for example, US | |
| cific | | Pacific | |
| * Standard Time is "America/Los_Angeles.") Because older versions of this | | * Time is "America/Los_Angeles.") Because older versions of this class us | |
| class used | | ed | |
| * three- or four-letter abbreviations instead, there is also a table that
maps the older | | * three- or four-letter abbreviations instead, there is also a table that
maps the older | |
|
| * abbreviations to the newer ones (for example, "PST" maps to "America/Los
Angeles"). | | * abbreviations to the newer ones (for example, "PST" maps to "America/Los
_Angeles"). | |
| * Anywhere the API requires an ID, you can use either form. | | * Anywhere the API requires an ID, you can use either form. | |
| * <P> | | * <P> | |
| * To create a new TimeZone, you call the factory function TimeZone::create
TimeZone() | | * To create a new TimeZone, you call the factory function TimeZone::create
TimeZone() | |
| * and pass it a time zone ID. You can use the createEnumeration() functio
n to | | * and pass it a time zone ID. You can use the createEnumeration() functio
n to | |
| * obtain a list of all the time zone IDs recognized by createTimeZone(). | | * obtain a list of all the time zone IDs recognized by createTimeZone(). | |
| * <P> | | * <P> | |
| * You can also use TimeZone::createDefault() to create a TimeZone. This f
unction uses | | * You can also use TimeZone::createDefault() to create a TimeZone. This f
unction uses | |
| * platform-specific APIs to produce a TimeZone for the time zone correspon
ding to | | * platform-specific APIs to produce a TimeZone for the time zone correspon
ding to | |
| * the client's computer's physical location. For example, if you're in Ja
pan (assuming | | * the client's computer's physical location. For example, if you're in Ja
pan (assuming | |
| * your machine is set up correctly), TimeZone::createDefault() will return
a TimeZone | | * your machine is set up correctly), TimeZone::createDefault() will return
a TimeZone | |
| | | | |
| skipping to change at line 139 | | skipping to change at line 139 | |
| /** | | /** | |
| * The GMT time zone has a raw offset of zero and does not use daylight | | * The GMT time zone has a raw offset of zero and does not use daylight | |
| * savings time. This is a commonly used time zone. | | * savings time. This is a commonly used time zone. | |
| * @return the GMT time zone. | | * @return the GMT time zone. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| static const TimeZone* U_EXPORT2 getGMT(void); | | static const TimeZone* U_EXPORT2 getGMT(void); | |
| | | | |
| /** | | /** | |
| * Creates a <code>TimeZone</code> for the given ID. | | * Creates a <code>TimeZone</code> for the given ID. | |
|
| * @param ID the ID for a <code>TimeZone</code>, either an abbreviation | | * @param ID the ID for a <code>TimeZone</code>, such as "America/Los_A | |
| such as | | ngeles", | |
| * "PST", a full name such as "America/Los_Angeles", or a custom ID | | * or a custom ID such as "GMT-8:00". | |
| * such as "GMT-8:00". | | | |
| * @return the specified <code>TimeZone</code>, or the GMT zone if the
given ID | | * @return the specified <code>TimeZone</code>, or the GMT zone if the
given ID | |
| * cannot be understood. Return result guaranteed to be non-null. If
you | | * cannot be understood. Return result guaranteed to be non-null. If
you | |
| * require that the specific zone asked for be returned, check the ID o
f the | | * require that the specific zone asked for be returned, check the ID o
f the | |
| * return result. | | * return result. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| static TimeZone* U_EXPORT2 createTimeZone(const UnicodeString& ID); | | static TimeZone* U_EXPORT2 createTimeZone(const UnicodeString& ID); | |
| | | | |
| /** | | /** | |
| * Returns an enumeration over all recognized time zone IDs. (i.e., | | * Returns an enumeration over all recognized time zone IDs. (i.e., | |
| | | | |
| skipping to change at line 210 | | skipping to change at line 209 | |
| * <P> | | * <P> | |
| * The caller owns the list that is returned, but does not own the stri
ngs contained | | * The caller owns the list that is returned, but does not own the stri
ngs contained | |
| * in that list. Delete the array with uprv_free(), but DON'T delete t
he elements in the array. | | * in that list. Delete the array with uprv_free(), but DON'T delete t
he elements in the array. | |
| * | | * | |
| * <p>NOTE: uprv_free() is declared in the private header source/common
/cmemory.h. | | * <p>NOTE: uprv_free() is declared in the private header source/common
/cmemory.h. | |
| * | | * | |
| * @param rawOffset An offset from GMT in milliseconds. | | * @param rawOffset An offset from GMT in milliseconds. | |
| * @param numIDs Receives the number of items in the array that is
returned. | | * @param numIDs Receives the number of items in the array that is
returned. | |
| * @return An array of UnicodeString pointers, where each Uni
codeString is | | * @return An array of UnicodeString pointers, where each Uni
codeString is | |
| * a time zone ID for a time zone with the given GMT
offset. If | | * a time zone ID for a time zone with the given GMT
offset. If | |
|
| * there is no timezone that matches the GMT offset | | * there is no time zone that matches the GMT offset | |
| * specified, NULL is returned. | | * specified, NULL is returned. | |
| * @obsolete ICU 2.8. Use createEnumeration(int32_t) instead since thi
s API will be removed in that release. | | * @obsolete ICU 2.8. Use createEnumeration(int32_t) instead since thi
s API will be removed in that release. | |
| */ | | */ | |
| static const UnicodeString** createAvailableIDs(int32_t rawOffset, int3
2_t& numIDs); | | static const UnicodeString** createAvailableIDs(int32_t rawOffset, int3
2_t& numIDs); | |
| | | | |
| /** | | /** | |
| * Returns a list of time zone IDs associated with the given | | * Returns a list of time zone IDs associated with the given | |
| * country. Some zones are affiliated with no country (e.g., | | * country. Some zones are affiliated with no country (e.g., | |
| * "UTC"); these may also be retrieved, as a group. | | * "UTC"); these may also be retrieved, as a group. | |
| * | | * | |
| | | | |
| skipping to change at line 233 | | skipping to change at line 232 | |
| * <b>DON'T</b> delete the elements in the array. | | * <b>DON'T</b> delete the elements in the array. | |
| * | | * | |
| * <p>NOTE: uprv_free() is declared in the private header source/common
/cmemory.h. | | * <p>NOTE: uprv_free() is declared in the private header source/common
/cmemory.h. | |
| * | | * | |
| * @param country The ISO 3166 two-letter country code, or NULL to | | * @param country The ISO 3166 two-letter country code, or NULL to | |
| * retrieve zones not affiliated with any country. | | * retrieve zones not affiliated with any country. | |
| * @param numIDs Receives the number of items in the array that is | | * @param numIDs Receives the number of items in the array that is | |
| * returned. | | * returned. | |
| * @return An array of UnicodeString pointers, where each | | * @return An array of UnicodeString pointers, where each | |
| * UnicodeString is a time zone ID for a time zone with the given | | * UnicodeString is a time zone ID for a time zone with the given | |
|
| * country. If there is no timezone that matches the country | | * country. If there is no time zone that matches the country | |
| * specified, NULL is returned. | | * specified, NULL is returned. | |
| * @obsolete ICU 2.8. Use createEnumeration(const char*) instead since
this API will be removed in that release. | | * @obsolete ICU 2.8. Use createEnumeration(const char*) instead since
this API will be removed in that release. | |
| */ | | */ | |
| static const UnicodeString** createAvailableIDs(const char* country, | | static const UnicodeString** createAvailableIDs(const char* country, | |
| int32_t& numIDs); | | int32_t& numIDs); | |
| | | | |
| /** | | /** | |
| * Returns a list of all time zone IDs supported by the TimeZone class
(i.e., all | | * Returns a list of all time zone IDs supported by the TimeZone class
(i.e., all | |
| * IDs that it's legal to pass to createTimeZone()). The caller owns t
he list that | | * IDs that it's legal to pass to createTimeZone()). The caller owns t
he list that | |
| * is returned, but does not own the strings contained in that list. D
elete the array with uprv_free(), | | * is returned, but does not own the strings contained in that list. D
elete the array with uprv_free(), | |
| | | | |
| skipping to change at line 339 | | skipping to change at line 338 | |
| * Returns the timezone data version currently used by ICU. | | * Returns the timezone data version currently used by ICU. | |
| * @param status Output param to filled in with a success or an error. | | * @param status Output param to filled in with a success or an error. | |
| * @return the version string, such as "2007f" | | * @return the version string, such as "2007f" | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| static const char* U_EXPORT2 getTZDataVersion(UErrorCode& status); | | static const char* U_EXPORT2 getTZDataVersion(UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Returns the canonical system timezone ID or the normalized | | * Returns the canonical system timezone ID or the normalized | |
| * custom time zone ID for the given time zone ID. | | * custom time zone ID for the given time zone ID. | |
|
| * @param id The input timezone ID to be canonicalized. | | * @param id The input time zone ID to be canonicalized. | |
| * @param canonicalID Receives the canonical system timezone ID | | * @param canonicalID Receives the canonical system time zone ID | |
| * or the custom timezone ID in normalized format. | | * or the custom time zone ID in normalized format | |
| * @param status Recevies the status. When the given timezone I | | . | |
| D | | * @param status Recevies the status. When the given time zone | |
| | | ID | |
| * is neither a known system time zone ID nor a | | * is neither a known system time zone ID nor a | |
|
| * valid custom timezone ID, U_ILLEGAL_ARGUMENT_ER
ROR | | * valid custom time zone ID, U_ILLEGAL_ARGUMENT_E
RROR | |
| * is set. | | * is set. | |
| * @return A reference to the result. | | * @return A reference to the result. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| static UnicodeString& U_EXPORT2 getCanonicalID(const UnicodeString& id, | | static UnicodeString& U_EXPORT2 getCanonicalID(const UnicodeString& id, | |
| UnicodeString& canonicalID, UErrorCode& status); | | UnicodeString& canonicalID, UErrorCode& status); | |
| | | | |
| /** | | /** | |
|
| * Returns the canonical system timezone ID or the normalized | | * Returns the canonical system time zone ID or the normalized | |
| * custom time zone ID for the given time zone ID. | | * custom time zone ID for the given time zone ID. | |
|
| * @param id The input timezone ID to be canonicalized. | | * @param id The input time zone ID to be canonicalized. | |
| * @param canonicalID Receives the canonical system timezone ID | | * @param canonicalID Receives the canonical system time zone ID | |
| * or the custom timezone ID in normalized format. | | * or the custom time zone ID in normalized format | |
| | | . | |
| * @param isSystemID Receives if the given ID is a known system | | * @param isSystemID Receives if the given ID is a known system | |
|
| * timezone ID. | | * time zone ID. | |
| * @param status Recevies the status. When the given timezone I | | * @param status Recevies the status. When the given time zone | |
| D | | ID | |
| * is neither a known system time zone ID nor a | | * is neither a known system time zone ID nor a | |
|
| * valid custom timezone ID, U_ILLEGAL_ARGUMENT_ER
ROR | | * valid custom time zone ID, U_ILLEGAL_ARGUMENT_E
RROR | |
| * is set. | | * is set. | |
| * @return A reference to the result. | | * @return A reference to the result. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| static UnicodeString& U_EXPORT2 getCanonicalID(const UnicodeString& id, | | static UnicodeString& U_EXPORT2 getCanonicalID(const UnicodeString& id, | |
| UnicodeString& canonicalID, UBool& isSystemID, UErrorCode& status); | | UnicodeString& canonicalID, UBool& isSystemID, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Returns true if the two TimeZones are equal. (The TimeZone version
only compares | | * Returns true if the two TimeZones are equal. (The TimeZone version
only compares | |
| * IDs, but subclasses are expected to also compare the fields they add
.) | | * IDs, but subclasses are expected to also compare the fields they add
.) | |
| * | | * | |
| * @param that The TimeZone object to be compared with. | | * @param that The TimeZone object to be compared with. | |
| * @return True if the given TimeZone is equal to this TimeZone; f
alse | | * @return True if the given TimeZone is equal to this TimeZone; f
alse | |
| | | | |
| skipping to change at line 506 | | skipping to change at line 505 | |
| /** | | /** | |
| * Sets the TimeZone's ID to the specified value. This doesn't affect
any other | | * Sets the TimeZone's ID to the specified value. This doesn't affect
any other | |
| * fields (for example, if you say< | | * fields (for example, if you say< | |
| * blockquote><pre> | | * blockquote><pre> | |
| * . TimeZone* foo = TimeZone::createTimeZone("America/New_York"); | | * . TimeZone* foo = TimeZone::createTimeZone("America/New_York"); | |
| * . foo.setID("America/Los_Angeles"); | | * . foo.setID("America/Los_Angeles"); | |
| * </pre>\htmlonly</blockquote>\endhtmlonly | | * </pre>\htmlonly</blockquote>\endhtmlonly | |
| * the time zone's GMT offset and daylight-savings rules don't change t
o those for | | * the time zone's GMT offset and daylight-savings rules don't change t
o those for | |
| * Los Angeles. They're still those for New York. Only the ID has cha
nged.) | | * Los Angeles. They're still those for New York. Only the ID has cha
nged.) | |
| * | | * | |
|
| * @param ID The new timezone ID. | | * @param ID The new time zone ID. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| void setID(const UnicodeString& ID); | | void setID(const UnicodeString& ID); | |
| | | | |
| /** | | /** | |
| * Enum for use with getDisplayName | | * Enum for use with getDisplayName | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| enum EDisplayType { | | enum EDisplayType { | |
| /** | | /** | |
| | | | |
| skipping to change at line 675 | | skipping to change at line 674 | |
| | | | |
| protected: | | protected: | |
| | | | |
| /** | | /** | |
| * Default constructor. ID is initialized to the empty string. | | * Default constructor. ID is initialized to the empty string. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| TimeZone(); | | TimeZone(); | |
| | | | |
| /** | | /** | |
|
| * Construct a timezone with a given ID. | | * Construct a TimeZone with a given ID. | |
| * @param id a system time zone ID | | * @param id a system time zone ID | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| TimeZone(const UnicodeString &id); | | TimeZone(const UnicodeString &id); | |
| | | | |
| /** | | /** | |
| * Copy constructor. | | * Copy constructor. | |
| * @param source the object to be copied. | | * @param source the object to be copied. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| | | | |
| skipping to change at line 749 | | skipping to change at line 748 | |
| * GMT[+-]hh. | | * GMT[+-]hh. | |
| * @param normalized Receives the normalized custom ID | | * @param normalized Receives the normalized custom ID | |
| * @param status Receives the status. When the input ID string is inva
lid, | | * @param status Receives the status. When the input ID string is inva
lid, | |
| * U_ILLEGAL_ARGUMENT_ERROR is set. | | * U_ILLEGAL_ARGUMENT_ERROR is set. | |
| * @return The normalized custom id string. | | * @return The normalized custom id string. | |
| */ | | */ | |
| static UnicodeString& getCustomID(const UnicodeString& id, UnicodeStrin
g& normalized, | | static UnicodeString& getCustomID(const UnicodeString& id, UnicodeStrin
g& normalized, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
| /** | | /** | |
|
| * Returns the normalized custome timezone ID for the given offset fiel
ds. | | * Returns the normalized custome time zone ID for the given offset fie
lds. | |
| * @param hour offset hours | | * @param hour offset hours | |
| * @param min offset minutes | | * @param min offset minutes | |
| * @param sec offset seconds | | * @param sec offset seconds | |
| * @param netative sign of the offset, TRUE for negative offset. | | * @param netative sign of the offset, TRUE for negative offset. | |
| * @param id Receves the format result (normalized custom ID) | | * @param id Receves the format result (normalized custom ID) | |
| * @return The reference to id | | * @return The reference to id | |
| */ | | */ | |
| static UnicodeString& formatCustomID(int32_t hour, int32_t min, int32_t
sec, | | static UnicodeString& formatCustomID(int32_t hour, int32_t min, int32_t
sec, | |
| UBool negative, UnicodeString& id); | | UBool negative, UnicodeString& id); | |
| | | | |
| | | | |
| skipping to change at line 773 | | skipping to change at line 772 | |
| * that, uses the platform-specific default time zone. Failing that, u
ses GMT. | | * that, uses the platform-specific default time zone. Failing that, u
ses GMT. | |
| */ | | */ | |
| static void initDefault(void); | | static void initDefault(void); | |
| | | | |
| // See source file for documentation | | // See source file for documentation | |
| /** | | /** | |
| * Lookup the given name in our system zone table. If found, | | * Lookup the given name in our system zone table. If found, | |
| * instantiate a new zone of that name and return it. If not | | * instantiate a new zone of that name and return it. If not | |
| * found, return 0. | | * found, return 0. | |
| * @param name tthe given name of a system time zone. | | * @param name tthe given name of a system time zone. | |
|
| * @return the timezone indicated by the 'name'. | | * @return the TimeZone indicated by the 'name'. | |
| */ | | */ | |
| static TimeZone* createSystemTimeZone(const UnicodeString& name)
; | | static TimeZone* createSystemTimeZone(const UnicodeString& name)
; | |
| | | | |
| UnicodeString fID; // this time zone's ID | | UnicodeString fID; // this time zone's ID | |
| }; | | }; | |
| | | | |
| // ------------------------------------- | | // ------------------------------------- | |
| | | | |
| inline UnicodeString& | | inline UnicodeString& | |
| TimeZone::getID(UnicodeString& ID) const | | TimeZone::getID(UnicodeString& ID) const | |
| | | | |
End of changes. 20 change blocks. |
| 36 lines changed or deleted | | 37 lines changed or added | |
|
| ucasemap.h | | ucasemap.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
|
| * Copyright (C) 2005-2008, International Business Machines | | * Copyright (C) 2005-2009, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| * | | * | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * file name: ucasemap.h | | * file name: ucasemap.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * tab size: 8 (not used) | | * tab size: 8 (not used) | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 2005may06 | | * created on: 2005may06 | |
| * created by: Markus W. Scherer | | * created by: Markus W. Scherer | |
| | | | |
| skipping to change at line 125 | | skipping to change at line 125 | |
| * @param options Options bit set, see ucasemap_open(). | | * @param options Options bit set, see ucasemap_open(). | |
| * @param pErrorCode Must be a valid pointer to an error code value, | | * @param pErrorCode Must be a valid pointer to an error code value, | |
| * which must not indicate a failure before the function
call. | | * which must not indicate a failure before the function
call. | |
| * | | * | |
| * @see ucasemap_open | | * @see ucasemap_open | |
| * @stable ICU 3.4 | | * @stable ICU 3.4 | |
| */ | | */ | |
| U_STABLE void U_EXPORT2 | | U_STABLE void U_EXPORT2 | |
| ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode
); | | ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode
); | |
| | | | |
|
| #ifndef U_HIDE_DRAFT_API | | | |
| | | | |
| /** | | /** | |
| * Do not lowercase non-initial parts of words when titlecasing. | | * Do not lowercase non-initial parts of words when titlecasing. | |
| * Option bit for titlecasing APIs that take an options bit set. | | * Option bit for titlecasing APIs that take an options bit set. | |
| * | | * | |
| * By default, titlecasing will titlecase the first cased character | | * By default, titlecasing will titlecase the first cased character | |
| * of a word and lowercase all other characters. | | * of a word and lowercase all other characters. | |
| * With this option, the other characters will not be modified. | | * With this option, the other characters will not be modified. | |
| * | | * | |
| * @see ucasemap_setOptions | | * @see ucasemap_setOptions | |
| * @see ucasemap_toTitle | | * @see ucasemap_toTitle | |
| | | | |
| skipping to change at line 168 | | skipping to change at line 166 | |
| * | | * | |
| * @see ucasemap_setOptions | | * @see ucasemap_setOptions | |
| * @see ucasemap_toTitle | | * @see ucasemap_toTitle | |
| * @see ucasemap_utf8ToTitle | | * @see ucasemap_utf8ToTitle | |
| * @see UnicodeString::toTitle | | * @see UnicodeString::toTitle | |
| * @see U_TITLECASE_NO_LOWERCASE | | * @see U_TITLECASE_NO_LOWERCASE | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| #define U_TITLECASE_NO_BREAK_ADJUSTMENT 0x200 | | #define U_TITLECASE_NO_BREAK_ADJUSTMENT 0x200 | |
| | | | |
|
| #endif | | | |
| | | | |
| #if !UCONFIG_NO_BREAK_ITERATION | | #if !UCONFIG_NO_BREAK_ITERATION | |
| | | | |
| /** | | /** | |
| * Get the break iterator that is used for titlecasing. | | * Get the break iterator that is used for titlecasing. | |
| * Do not modify the returned break iterator. | | * Do not modify the returned break iterator. | |
| * @param csm UCaseMap service object. | | * @param csm UCaseMap service object. | |
| * @return titlecasing break iterator | | * @return titlecasing break iterator | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| U_DRAFT const UBreakIterator * U_EXPORT2 | | U_DRAFT const UBreakIterator * U_EXPORT2 | |
| | | | |
| skipping to change at line 216 | | skipping to change at line 212 | |
| * Titlecase a UTF-16 string. This function is almost a duplicate of u_strT
oTitle(), | | * Titlecase a UTF-16 string. This function is almost a duplicate of u_strT
oTitle(), | |
| * except that it takes ucasemap_setOptions() into account and has performa
nce | | * except that it takes ucasemap_setOptions() into account and has performa
nce | |
| * advantages from being able to use a UCaseMap object for multiple case ma
pping | | * advantages from being able to use a UCaseMap object for multiple case ma
pping | |
| * operations, saving setup time. | | * operations, saving setup time. | |
| * | | * | |
| * Casing is locale-dependent and context-sensitive. | | * Casing is locale-dependent and context-sensitive. | |
| * Titlecasing uses a break iterator to find the first characters of words | | * Titlecasing uses a break iterator to find the first characters of words | |
| * that are to be titlecased. It titlecases those characters and lowercases | | * that are to be titlecased. It titlecases those characters and lowercases | |
| * all others. (This can be modified with ucasemap_setOptions().) | | * all others. (This can be modified with ucasemap_setOptions().) | |
| * | | * | |
|
| | | * Note: This function takes a non-const UCaseMap pointer because it will | |
| | | * open a default break iterator if no break iterator was set yet, | |
| | | * and effectively call ucasemap_setBreakIterator(); | |
| | | * also because the break iterator is stateful and will be modified during | |
| | | * the iteration. | |
| | | * | |
| * The titlecase break iterator can be provided to customize for arbitrary | | * The titlecase break iterator can be provided to customize for arbitrary | |
| * styles, using rules and dictionaries beyond the standard iterators. | | * styles, using rules and dictionaries beyond the standard iterators. | |
|
| * It may be more efficient to always provide an iterator to avoid | | | |
| * opening and closing one for each string. | | | |
| * The standard titlecase iterator for the root locale implements the | | * The standard titlecase iterator for the root locale implements the | |
| * algorithm of Unicode TR 21. | | * algorithm of Unicode TR 21. | |
| * | | * | |
|
| * This function uses only the setText(), first() and next() methods of the | | * This function uses only the setUText(), first(), next() and close() meth
ods of the | |
| * provided break iterator. | | * provided break iterator. | |
| * | | * | |
| * The result may be longer or shorter than the original. | | * The result may be longer or shorter than the original. | |
| * The source string and the destination buffer must not overlap. | | * The source string and the destination buffer must not overlap. | |
| * | | * | |
|
| * @param csm UCaseMap service object. | | * @param csm UCaseMap service object. This pointer is non-const! | |
| | | * See the note above for details. | |
| * @param dest A buffer for the result string. The result will be NUL-
terminated if | | * @param dest A buffer for the result string. The result will be NUL-
terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * The contents is undefined in case of failure. | | * The contents is undefined in case of failure. | |
| * @param destCapacity The size of the buffer (number of bytes). If it is 0
, then | | * @param destCapacity The size of the buffer (number of bytes). If it is 0
, then | |
| * dest may be NULL and the function will only return the
length of the result | | * dest may be NULL and the function will only return the
length of the result | |
| * without writing any of the result string. | | * without writing any of the result string. | |
| * @param src The original string. | | * @param src The original string. | |
| * @param srcLength The length of the original string. If -1, then src must
be NUL-terminated. | | * @param srcLength The length of the original string. If -1, then src must
be NUL-terminated. | |
| * @param pErrorCode Must be a valid pointer to an error code value, | | * @param pErrorCode Must be a valid pointer to an error code value, | |
| * which must not indicate a failure before the function c
all. | | * which must not indicate a failure before the function c
all. | |
| | | | |
| skipping to change at line 321 | | skipping to change at line 322 | |
| | | | |
| #if !UCONFIG_NO_BREAK_ITERATION | | #if !UCONFIG_NO_BREAK_ITERATION | |
| | | | |
| /** | | /** | |
| * Titlecase a UTF-8 string. | | * Titlecase a UTF-8 string. | |
| * Casing is locale-dependent and context-sensitive. | | * Casing is locale-dependent and context-sensitive. | |
| * Titlecasing uses a break iterator to find the first characters of words | | * Titlecasing uses a break iterator to find the first characters of words | |
| * that are to be titlecased. It titlecases those characters and lowercases | | * that are to be titlecased. It titlecases those characters and lowercases | |
| * all others. (This can be modified with ucasemap_setOptions().) | | * all others. (This can be modified with ucasemap_setOptions().) | |
| * | | * | |
|
| | | * Note: This function takes a non-const UCaseMap pointer because it will | |
| | | * open a default break iterator if no break iterator was set yet, | |
| | | * and effectively call ucasemap_setBreakIterator(); | |
| | | * also because the break iterator is stateful and will be modified during | |
| | | * the iteration. | |
| | | * | |
| * The titlecase break iterator can be provided to customize for arbitrary | | * The titlecase break iterator can be provided to customize for arbitrary | |
| * styles, using rules and dictionaries beyond the standard iterators. | | * styles, using rules and dictionaries beyond the standard iterators. | |
|
| * It may be more efficient to always provide an iterator to avoid | | | |
| * opening and closing one for each string. | | | |
| * The standard titlecase iterator for the root locale implements the | | * The standard titlecase iterator for the root locale implements the | |
| * algorithm of Unicode TR 21. | | * algorithm of Unicode TR 21. | |
| * | | * | |
|
| * This function uses only the setText(), first() and next() methods of the | | * This function uses only the setUText(), first(), next() and close() meth
ods of the | |
| * provided break iterator. | | * provided break iterator. | |
| * | | * | |
| * The result may be longer or shorter than the original. | | * The result may be longer or shorter than the original. | |
| * The source string and the destination buffer must not overlap. | | * The source string and the destination buffer must not overlap. | |
| * | | * | |
|
| * @param csm UCaseMap service object. | | * @param csm UCaseMap service object. This pointer is non-const! | |
| | | * See the note above for details. | |
| * @param dest A buffer for the result string. The result will be NUL-
terminated if | | * @param dest A buffer for the result string. The result will be NUL-
terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * The contents is undefined in case of failure. | | * The contents is undefined in case of failure. | |
| * @param destCapacity The size of the buffer (number of bytes). If it is 0
, then | | * @param destCapacity The size of the buffer (number of bytes). If it is 0
, then | |
| * dest may be NULL and the function will only return the
length of the result | | * dest may be NULL and the function will only return the
length of the result | |
| * without writing any of the result string. | | * without writing any of the result string. | |
| * @param src The original string. | | * @param src The original string. | |
| * @param srcLength The length of the original string. If -1, then src must
be NUL-terminated. | | * @param srcLength The length of the original string. If -1, then src must
be NUL-terminated. | |
| * @param pErrorCode Must be a valid pointer to an error code value, | | * @param pErrorCode Must be a valid pointer to an error code value, | |
| * which must not indicate a failure before the function c
all. | | * which must not indicate a failure before the function c
all. | |
| | | | |
End of changes. 11 change blocks. |
| 13 lines changed or deleted | | 19 lines changed or added | |
|
| ucnv.h | | ucnv.h | |
| /* | | /* | |
| ********************************************************************** | | ********************************************************************** | |
|
| * Copyright (C) 1999-2008, International Business Machines | | * Copyright (C) 1999-2009, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| ********************************************************************** | | ********************************************************************** | |
| * ucnv.h: | | * ucnv.h: | |
| * External APIs for the ICU's codeset conversion library | | * External APIs for the ICU's codeset conversion library | |
| * Bertrand A. Damiba | | * Bertrand A. Damiba | |
| * | | * | |
| * Modification History: | | * Modification History: | |
| * | | * | |
| * Date Name Description | | * Date Name Description | |
| * 04/04/99 helena Fixed internal header inclusion. | | * 04/04/99 helena Fixed internal header inclusion. | |
| | | | |
| skipping to change at line 873 | | skipping to change at line 873 | |
| UErrorCode* err); | | UErrorCode* err); | |
| | | | |
| /** | | /** | |
| * Selectors for Unicode sets that can be returned by ucnv_getUnicodeSet(). | | * Selectors for Unicode sets that can be returned by ucnv_getUnicodeSet(). | |
| * @see ucnv_getUnicodeSet | | * @see ucnv_getUnicodeSet | |
| * @stable ICU 2.6 | | * @stable ICU 2.6 | |
| */ | | */ | |
| typedef enum UConverterUnicodeSet { | | typedef enum UConverterUnicodeSet { | |
| /** Select the set of roundtrippable Unicode code points. @stable ICU 2
.6 */ | | /** Select the set of roundtrippable Unicode code points. @stable ICU 2
.6 */ | |
| UCNV_ROUNDTRIP_SET, | | UCNV_ROUNDTRIP_SET, | |
|
| /** Select the set of Unicode code points with roundtrip or fallback ma
ppings. @draft ICU 4.0 */ | | /** Select the set of Unicode code points with roundtrip or fallback ma
ppings. @stable ICU 4.0 */ | |
| UCNV_ROUNDTRIP_AND_FALLBACK_SET, | | UCNV_ROUNDTRIP_AND_FALLBACK_SET, | |
| /** Number of UConverterUnicodeSet selectors. @stable ICU 2.6 */ | | /** Number of UConverterUnicodeSet selectors. @stable ICU 2.6 */ | |
| UCNV_SET_COUNT | | UCNV_SET_COUNT | |
| } UConverterUnicodeSet; | | } UConverterUnicodeSet; | |
| | | | |
| /** | | /** | |
| * Returns the set of Unicode code points that can be converted by an ICU c
onverter. | | * Returns the set of Unicode code points that can be converted by an ICU c
onverter. | |
| * | | * | |
| * Returns one of several kinds of set: | | * Returns one of several kinds of set: | |
| * | | * | |
| | | | |
| skipping to change at line 1365 | | skipping to change at line 1365 | |
| * | | * | |
| * utf8Cnv=myGetCachedUTF8Converter(pErrorCode); | | * utf8Cnv=myGetCachedUTF8Converter(pErrorCode); | |
| * if(U_FAILURE(*pErrorCode)) { | | * if(U_FAILURE(*pErrorCode)) { | |
| * return 0; | | * return 0; | |
| * } | | * } | |
| * | | * | |
| * if(length<0) { | | * if(length<0) { | |
| * length=strlen(s); | | * length=strlen(s); | |
| * } | | * } | |
| * target=u8; | | * target=u8; | |
|
| * ucnv_convertEx(cnv, utf8Cnv, | | * ucnv_convertEx(utf8Cnv, cnv, | |
| * &target, u8+capacity, | | * &target, u8+capacity, | |
| * &s, s+length, | | * &s, s+length, | |
| * NULL, NULL, NULL, NULL, | | * NULL, NULL, NULL, NULL, | |
| * TRUE, TRUE, | | * TRUE, TRUE, | |
| * pErrorCode); | | * pErrorCode); | |
| * | | * | |
| * myReleaseCachedUTF8Converter(utf8Cnv); | | * myReleaseCachedUTF8Converter(utf8Cnv); | |
| * | | * | |
| * // return the output string length, but without preflighting | | * // return the output string length, but without preflighting | |
| * return (int32_t)(target-u8); | | * return (int32_t)(target-u8); | |
| | | | |
| skipping to change at line 1789 | | skipping to change at line 1789 | |
| */ | | */ | |
| U_STABLE const char * U_EXPORT2 | | U_STABLE const char * U_EXPORT2 | |
| ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *
pErrorCode); | | ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *
pErrorCode); | |
| | | | |
| /** | | /** | |
| * Returns the current default converter name. If you want to open | | * Returns the current default converter name. If you want to open | |
| * a default converter, you do not need to use this function. | | * a default converter, you do not need to use this function. | |
| * It is faster if you pass a NULL argument to ucnv_open the | | * It is faster if you pass a NULL argument to ucnv_open the | |
| * default converter. | | * default converter. | |
| * | | * | |
|
| | | * If U_CHARSET_IS_UTF8 is defined to 1 in utypes.h then this function | |
| | | * always returns "UTF-8". | |
| | | * | |
| * @return returns the current default converter name. | | * @return returns the current default converter name. | |
| * Storage owned by the library | | * Storage owned by the library | |
| * @see ucnv_setDefaultName | | * @see ucnv_setDefaultName | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE const char * U_EXPORT2 | | U_STABLE const char * U_EXPORT2 | |
| ucnv_getDefaultName(void); | | ucnv_getDefaultName(void); | |
| | | | |
| /** | | /** | |
| * This function is not thread safe. DO NOT call this function when ANY ICU | | * This function is not thread safe. DO NOT call this function when ANY ICU | |
| * function is being used from more than one thread! This function sets the | | * function is being used from more than one thread! This function sets the | |
| * current default converter name. If this function needs to be called, it | | * current default converter name. If this function needs to be called, it | |
| * should be called during application initialization. Most of the time, th
e | | * should be called during application initialization. Most of the time, th
e | |
| * results from ucnv_getDefaultName() or ucnv_open with a NULL string argum
ent | | * results from ucnv_getDefaultName() or ucnv_open with a NULL string argum
ent | |
| * is sufficient for your application. | | * is sufficient for your application. | |
|
| | | * | |
| | | * If U_CHARSET_IS_UTF8 is defined to 1 in utypes.h then this function | |
| | | * does nothing. | |
| | | * | |
| * @param name the converter name to be the default (must be known by ICU). | | * @param name the converter name to be the default (must be known by ICU). | |
| * @see ucnv_getDefaultName | | * @see ucnv_getDefaultName | |
| * @system | | * @system | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE void U_EXPORT2 | | U_STABLE void U_EXPORT2 | |
| ucnv_setDefaultName(const char *name); | | ucnv_setDefaultName(const char *name); | |
| | | | |
| /** | | /** | |
| * Fixes the backslash character mismapping. For example, in SJIS, the bac
kslash | | * Fixes the backslash character mismapping. For example, in SJIS, the bac
kslash | |
| | | | |
End of changes. 5 change blocks. |
| 3 lines changed or deleted | | 10 lines changed or added | |
|
| udat.h | | udat.h | |
| | | | |
| skipping to change at line 201 | | skipping to change at line 201 | |
| * important, such as MMM, MMMM, and MMMMM; EEE and EEEE, | | * important, such as MMM, MMMM, and MMMMM; EEE and EEEE, | |
| * and the field's pattern letter length is honored. | | * and the field's pattern letter length is honored. | |
| * | | * | |
| * For the digit calendar fields, such as M or MM, d or dd, yy or yyyy, | | * For the digit calendar fields, such as M or MM, d or dd, yy or yyyy, | |
| * the field pattern length is ignored and the best match, which is defi
ned | | * the field pattern length is ignored and the best match, which is defi
ned | |
| * in date time patterns, will be returned without honor the field patte
rn | | * in date time patterns, will be returned without honor the field patte
rn | |
| * letter length in skeleton. | | * letter length in skeleton. | |
| * </li> | | * </li> | |
| * </ol> | | * </ol> | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| | | | |
| #define UDAT_MINUTE_SECOND "ms" | | #define UDAT_MINUTE_SECOND "ms" | |
| #define UDAT_HOUR24_MINUTE "Hm" | | #define UDAT_HOUR24_MINUTE "Hm" | |
| #define UDAT_HOUR24_MINUTE_SECOND "Hms" | | #define UDAT_HOUR24_MINUTE_SECOND "Hms" | |
| #define UDAT_HOUR_MINUTE_SECOND "hms" | | #define UDAT_HOUR_MINUTE_SECOND "hms" | |
| #define UDAT_STANDALONE_MONTH "LLLL" | | #define UDAT_STANDALONE_MONTH "LLLL" | |
| #define UDAT_ABBR_STANDALONE_MONTH "LLL" | | #define UDAT_ABBR_STANDALONE_MONTH "LLL" | |
| #define UDAT_YEAR_QUARTER "yQQQ" | | #define UDAT_YEAR_QUARTER "yQQQ" | |
| #define UDAT_YEAR_ABBR_QUARTER "yQ" | | #define UDAT_YEAR_ABBR_QUARTER "yQ" | |
| | | | |
| skipping to change at line 692 | | skipping to change at line 692 | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE void U_EXPORT2 | | U_STABLE void U_EXPORT2 | |
| udat_setNumberFormat( UDateFormat* fmt, | | udat_setNumberFormat( UDateFormat* fmt, | |
| const UNumberFormat* numberFormatToSet); | | const UNumberFormat* numberFormatToSet); | |
| | | | |
| /** | | /** | |
| * Get a locale for which date/time formatting patterns are available. | | * Get a locale for which date/time formatting patterns are available. | |
| * A UDateFormat in a locale returned by this function will perform the corr
ect | | * A UDateFormat in a locale returned by this function will perform the corr
ect | |
| * formatting and parsing for the locale. | | * formatting and parsing for the locale. | |
|
| * @param index The index of the desired locale. | | * @param localeIndex The index of the desired locale. | |
| * @return A locale for which date/time formatting patterns are available, o
r 0 if none. | | * @return A locale for which date/time formatting patterns are available, o
r 0 if none. | |
| * @see udat_countAvailable | | * @see udat_countAvailable | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE const char* U_EXPORT2 | | U_STABLE const char* U_EXPORT2 | |
|
| udat_getAvailable(int32_t index); | | udat_getAvailable(int32_t localeIndex); | |
| | | | |
| /** | | /** | |
| * Determine how many locales have date/time formatting patterns available. | | * Determine how many locales have date/time formatting patterns available. | |
| * This function is most useful as determining the loop ending condition for | | * This function is most useful as determining the loop ending condition for | |
| * calls to {@link #udat_getAvailable }. | | * calls to {@link #udat_getAvailable }. | |
| * @return The number of locales for which date/time formatting patterns are
available. | | * @return The number of locales for which date/time formatting patterns are
available. | |
| * @see udat_getAvailable | | * @see udat_getAvailable | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| | | | |
| skipping to change at line 832 | | skipping to change at line 832 | |
| */ | | */ | |
| typedef struct UDateFormatSymbols UDateFormatSymbols; | | typedef struct UDateFormatSymbols UDateFormatSymbols; | |
| | | | |
| /** | | /** | |
| * Get the symbols associated with an UDateFormat. | | * Get the symbols associated with an UDateFormat. | |
| * The symbols are what a UDateFormat uses to represent locale-specific data
, | | * The symbols are what a UDateFormat uses to represent locale-specific data
, | |
| * for example month or day names. | | * for example month or day names. | |
| * @param fmt The formatter to query. | | * @param fmt The formatter to query. | |
| * @param type The type of symbols to get. One of UDAT_ERAS, UDAT_MONTHS, U
DAT_SHORT_MONTHS, | | * @param type The type of symbols to get. One of UDAT_ERAS, UDAT_MONTHS, U
DAT_SHORT_MONTHS, | |
| * UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS | | * UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS | |
|
| * @param index The desired symbol of type type. | | * @param symbolIndex The desired symbol of type type. | |
| * @param result A pointer to a buffer to receive the pattern. | | * @param result A pointer to a buffer to receive the pattern. | |
| * @param resultLength The maximum size of result. | | * @param resultLength The maximum size of result. | |
| * @param status A pointer to an UErrorCode to receive any errors | | * @param status A pointer to an UErrorCode to receive any errors | |
| * @return The total buffer size needed; if greater than resultLength, the o
utput was truncated. | | * @return The total buffer size needed; if greater than resultLength, the o
utput was truncated. | |
| * @see udat_countSymbols | | * @see udat_countSymbols | |
| * @see udat_setSymbols | | * @see udat_setSymbols | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| udat_getSymbols(const UDateFormat *fmt, | | udat_getSymbols(const UDateFormat *fmt, | |
| UDateFormatSymbolType type, | | UDateFormatSymbolType type, | |
|
| int32_t index, | | int32_t symbolIndex, | |
| UChar *result, | | UChar *result, | |
| int32_t resultLength, | | int32_t resultLength, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Count the number of particular symbols for an UDateFormat. | | * Count the number of particular symbols for an UDateFormat. | |
| * This function is most useful as for detemining the loop termination condi
tion | | * This function is most useful as for detemining the loop termination condi
tion | |
| * for calls to {@link #udat_getSymbols }. | | * for calls to {@link #udat_getSymbols }. | |
| * @param fmt The formatter to query. | | * @param fmt The formatter to query. | |
| * @param type The type of symbols to count. One of UDAT_ERAS, UDAT_MONTHS,
UDAT_SHORT_MONTHS, | | * @param type The type of symbols to count. One of UDAT_ERAS, UDAT_MONTHS,
UDAT_SHORT_MONTHS, | |
| | | | |
| skipping to change at line 872 | | skipping to change at line 872 | |
| udat_countSymbols( const UDateFormat *fmt, | | udat_countSymbols( const UDateFormat *fmt, | |
| UDateFormatSymbolType type); | | UDateFormatSymbolType type); | |
| | | | |
| /** | | /** | |
| * Set the symbols associated with an UDateFormat. | | * Set the symbols associated with an UDateFormat. | |
| * The symbols are what a UDateFormat uses to represent locale-specific data
, | | * The symbols are what a UDateFormat uses to represent locale-specific data
, | |
| * for example month or day names. | | * for example month or day names. | |
| * @param format The formatter to set | | * @param format The formatter to set | |
| * @param type The type of symbols to set. One of UDAT_ERAS, UDAT_MONTHS, U
DAT_SHORT_MONTHS, | | * @param type The type of symbols to set. One of UDAT_ERAS, UDAT_MONTHS, U
DAT_SHORT_MONTHS, | |
| * UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS | | * UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS | |
|
| * @param index The index of the symbol to set of type type. | | * @param symbolIndex The index of the symbol to set of type type. | |
| * @param value The new value | | * @param value The new value | |
| * @param valueLength The length of value, or -1 if null-terminated | | * @param valueLength The length of value, or -1 if null-terminated | |
| * @param status A pointer to an UErrorCode to receive any errors | | * @param status A pointer to an UErrorCode to receive any errors | |
| * @see udat_getSymbols | | * @see udat_getSymbols | |
| * @see udat_countSymbols | | * @see udat_countSymbols | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE void U_EXPORT2 | | U_STABLE void U_EXPORT2 | |
| udat_setSymbols( UDateFormat *format, | | udat_setSymbols( UDateFormat *format, | |
| UDateFormatSymbolType type, | | UDateFormatSymbolType type, | |
|
| int32_t index, | | int32_t symbolIndex, | |
| UChar *value, | | UChar *value, | |
| int32_t valueLength, | | int32_t valueLength, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Get the locale for this date format object. | | * Get the locale for this date format object. | |
| * You can choose between valid and actual locale. | | * You can choose between valid and actual locale. | |
| * @param fmt The formatter to get the locale from | | * @param fmt The formatter to get the locale from | |
| * @param type type of the locale we're looking for (valid or actual) | | * @param type type of the locale we're looking for (valid or actual) | |
| * @param status error code for the operation | | * @param status error code for the operation | |
| * @return the locale name | | * @return the locale name | |
| * @stable ICU 2.8 | | * @stable ICU 2.8 | |
| */ | | */ | |
| U_STABLE const char* U_EXPORT2 | | U_STABLE const char* U_EXPORT2 | |
| udat_getLocaleByType(const UDateFormat *fmt, | | udat_getLocaleByType(const UDateFormat *fmt, | |
| ULocDataLocaleType type, | | ULocDataLocaleType type, | |
| UErrorCode* status); | | UErrorCode* status); | |
| | | | |
|
| | | /** | |
| | | * Extract the date pattern from a UDateFormat set for relative date formatt | |
| | | ing. | |
| | | * The pattern will follow the pattern syntax rules. | |
| | | * @param fmt The formatter to query. | |
| | | * @param result A pointer to a buffer to receive the pattern. | |
| | | * @param resultLength The maximum size of result. | |
| | | * @param status A pointer to a UErrorCode to receive any errors | |
| | | * @return The total buffer size needed; if greater than resultLength, the o | |
| | | utput was truncated. | |
| | | * @see udat_applyPatternRelative | |
| | | * @internal ICU 4.2 technology preview | |
| | | */ | |
| | | U_INTERNAL int32_t U_EXPORT2 | |
| | | udat_toPatternRelativeDate(const UDateFormat *fmt, | |
| | | UChar *result, | |
| | | int32_t resultLength, | |
| | | UErrorCode *status); | |
| | | | |
| | | /** | |
| | | * Extract the time pattern from a UDateFormat set for relative date formatt | |
| | | ing. | |
| | | * The pattern will follow the pattern syntax rules. | |
| | | * @param fmt The formatter to query. | |
| | | * @param result A pointer to a buffer to receive the pattern. | |
| | | * @param resultLength The maximum size of result. | |
| | | * @param status A pointer to a UErrorCode to receive any errors | |
| | | * @return The total buffer size needed; if greater than resultLength, the o | |
| | | utput was truncated. | |
| | | * @see udat_applyPatternRelative | |
| | | * @internal ICU 4.2 technology preview | |
| | | */ | |
| | | U_INTERNAL int32_t U_EXPORT2 | |
| | | udat_toPatternRelativeTime(const UDateFormat *fmt, | |
| | | UChar *result, | |
| | | int32_t resultLength, | |
| | | UErrorCode *status); | |
| | | | |
| | | /** | |
| | | * Set the date & time patterns used by a UDateFormat set for relative date | |
| | | formatting. | |
| | | * The patterns should follow the pattern syntax rules. | |
| | | * @param format The formatter to set. | |
| | | * @param datePattern The new date pattern | |
| | | * @param datePatternLength The length of datePattern, or -1 if null-termina | |
| | | ted. | |
| | | * @param timePattern The new time pattern | |
| | | * @param timePatternLength The length of timePattern, or -1 if null-termina | |
| | | ted. | |
| | | * @param status A pointer to a UErrorCode to receive any errors | |
| | | * @see udat_toPatternRelativeDate, udat_toPatternRelativeTime | |
| | | * @internal ICU 4.2 technology preview | |
| | | */ | |
| | | U_INTERNAL void U_EXPORT2 | |
| | | udat_applyPatternRelative(UDateFormat *format, | |
| | | const UChar *datePattern, | |
| | | int32_t datePatternLength, | |
| | | const UChar *timePattern, | |
| | | int32_t timePatternLength, | |
| | | UErrorCode *status); | |
| | | | |
| #endif /* #if !UCONFIG_NO_FORMATTING */ | | #endif /* #if !UCONFIG_NO_FORMATTING */ | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 8 change blocks. |
| 7 lines changed or deleted | | 68 lines changed or added | |
|
| udraft.h | | udraft.h | |
| | | | |
| skipping to change at line 27 | | skipping to change at line 27 | |
| * THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW WHA
T | | * THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW WHA
T | |
| * YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN! | | * YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN! | |
| */ | | */ | |
| | | | |
| #ifndef UDRAFT_H | | #ifndef UDRAFT_H | |
| #define UDRAFT_H | | #define UDRAFT_H | |
| | | | |
| #ifdef U_HIDE_DRAFT_API | | #ifdef U_HIDE_DRAFT_API | |
| | | | |
| # if U_DISABLE_RENAMING | | # if U_DISABLE_RENAMING | |
|
| # define afkLanguageCode afkLanguageCode_DRAFT_API_DO_NOT_USE | | # define u_compareVersions u_compareVersions_DRAFT_API_DO_NOT_USE | |
| # define armiScriptCode armiScriptCode_DRAFT_API_DO_NOT_USE | | # define u_strFromUTF32WithSub u_strFromUTF32WithSub_DRAFT_API_DO_NO | |
| # define u_fclose u_fclose_DRAFT_API_DO_NOT_USE | | T_USE | |
| # define u_feof u_feof_DRAFT_API_DO_NOT_USE | | # define u_strToUTF32WithSub u_strToUTF32WithSub_DRAFT_API_DO_NOT_US | |
| # define u_fflush u_fflush_DRAFT_API_DO_NOT_USE | | E | |
| # define u_fgetConverter u_fgetConverter_DRAFT_API_DO_NOT_USE | | # define u_versionFromUString u_versionFromUString_DRAFT_API_DO_NOT_ | |
| # define u_fgetc u_fgetc_DRAFT_API_DO_NOT_USE | | USE | |
| # define u_fgetcodepage u_fgetcodepage_DRAFT_API_DO_NOT_USE | | # define ucal_getKeywordValuesForLocale ucal_getKeywordValuesForLoca | |
| # define u_fgetcx u_fgetcx_DRAFT_API_DO_NOT_USE | | le_DRAFT_API_DO_NOT_USE | |
| # define u_fgetfile u_fgetfile_DRAFT_API_DO_NOT_USE | | | |
| # define u_fgetlocale u_fgetlocale_DRAFT_API_DO_NOT_USE | | | |
| # define u_fgets u_fgets_DRAFT_API_DO_NOT_USE | | | |
| # define u_file_read u_file_read_DRAFT_API_DO_NOT_USE | | | |
| # define u_file_write u_file_write_DRAFT_API_DO_NOT_USE | | | |
| # define u_finit u_finit_DRAFT_API_DO_NOT_USE | | | |
| # define u_fopen u_fopen_DRAFT_API_DO_NOT_USE | | | |
| # define u_fprintf u_fprintf_DRAFT_API_DO_NOT_USE | | | |
| # define u_fprintf_u u_fprintf_u_DRAFT_API_DO_NOT_USE | | | |
| # define u_fputc u_fputc_DRAFT_API_DO_NOT_USE | | | |
| # define u_fputs u_fputs_DRAFT_API_DO_NOT_USE | | | |
| # define u_frewind u_frewind_DRAFT_API_DO_NOT_USE | | | |
| # define u_fscanf u_fscanf_DRAFT_API_DO_NOT_USE | | | |
| # define u_fscanf_u u_fscanf_u_DRAFT_API_DO_NOT_USE | | | |
| # define u_fsetcodepage u_fsetcodepage_DRAFT_API_DO_NOT_USE | | | |
| # define u_fsetlocale u_fsetlocale_DRAFT_API_DO_NOT_USE | | | |
| # define u_fsettransliterator u_fsettransliterator_DRAFT_API_DO_NOT_ | | | |
| USE | | | |
| # define u_fstropen u_fstropen_DRAFT_API_DO_NOT_USE | | | |
| # define u_fungetc u_fungetc_DRAFT_API_DO_NOT_USE | | | |
| # define u_snprintf u_snprintf_DRAFT_API_DO_NOT_USE | | | |
| # define u_snprintf_u u_snprintf_u_DRAFT_API_DO_NOT_USE | | | |
| # define u_sprintf u_sprintf_DRAFT_API_DO_NOT_USE | | | |
| # define u_sprintf_u u_sprintf_u_DRAFT_API_DO_NOT_USE | | | |
| # define u_sscanf u_sscanf_DRAFT_API_DO_NOT_USE | | | |
| # define u_sscanf_u u_sscanf_u_DRAFT_API_DO_NOT_USE | | | |
| # define u_vfprintf u_vfprintf_DRAFT_API_DO_NOT_USE | | | |
| # define u_vfprintf_u u_vfprintf_u_DRAFT_API_DO_NOT_USE | | | |
| # define u_vfscanf u_vfscanf_DRAFT_API_DO_NOT_USE | | | |
| # define u_vfscanf_u u_vfscanf_u_DRAFT_API_DO_NOT_USE | | | |
| # define u_vsnprintf u_vsnprintf_DRAFT_API_DO_NOT_USE | | | |
| # define u_vsnprintf_u u_vsnprintf_u_DRAFT_API_DO_NOT_USE | | | |
| # define u_vsprintf u_vsprintf_DRAFT_API_DO_NOT_USE | | | |
| # define u_vsprintf_u u_vsprintf_u_DRAFT_API_DO_NOT_USE | | | |
| # define u_vsscanf u_vsscanf_DRAFT_API_DO_NOT_USE | | | |
| # define u_vsscanf_u u_vsscanf_u_DRAFT_API_DO_NOT_USE | | | |
| # define ucal_clone ucal_clone_DRAFT_API_DO_NOT_USE | | | |
| # define ucal_getCanonicalTimeZoneID ucal_getCanonicalTimeZoneID_DRA | | | |
| FT_API_DO_NOT_USE | | | |
| # define ucal_getType ucal_getType_DRAFT_API_DO_NOT_USE | | # define ucal_getType ucal_getType_DRAFT_API_DO_NOT_USE | |
| # define ucnvsel_close ucnvsel_close_DRAFT_API_DO_NOT_USE | | # define ucnvsel_close ucnvsel_close_DRAFT_API_DO_NOT_USE | |
| # define ucnvsel_open ucnvsel_open_DRAFT_API_DO_NOT_USE | | # define ucnvsel_open ucnvsel_open_DRAFT_API_DO_NOT_USE | |
| # define ucnvsel_openFromSerialized ucnvsel_openFromSerialized_DRAFT
_API_DO_NOT_USE | | # define ucnvsel_openFromSerialized ucnvsel_openFromSerialized_DRAFT
_API_DO_NOT_USE | |
| # define ucnvsel_selectForString ucnvsel_selectForString_DRAFT_API_D
O_NOT_USE | | # define ucnvsel_selectForString ucnvsel_selectForString_DRAFT_API_D
O_NOT_USE | |
| # define ucnvsel_selectForUTF8 ucnvsel_selectForUTF8_DRAFT_API_DO_NO
T_USE | | # define ucnvsel_selectForUTF8 ucnvsel_selectForUTF8_DRAFT_API_DO_NO
T_USE | |
| # define ucnvsel_serialize ucnvsel_serialize_DRAFT_API_DO_NOT_USE | | # define ucnvsel_serialize ucnvsel_serialize_DRAFT_API_DO_NOT_USE | |
|
| # define ucurr_countCurrencies ucurr_countCurrencies_DRAFT_API_DO_NO | | # define ucol_getKeywordValuesForLocale ucol_getKeywordValuesForLoca | |
| T_USE | | le_DRAFT_API_DO_NOT_USE | |
| # define ucurr_forLocaleAndDate ucurr_forLocaleAndDate_DRAFT_API_DO_ | | # define ucurr_getKeywordValuesForLocale ucurr_getKeywordValuesForLo | |
| NOT_USE | | cale_DRAFT_API_DO_NOT_USE | |
| # define uloc_addLikelySubtags uloc_addLikelySubtags_DRAFT_API_DO_NO | | # define ucurr_getPluralName ucurr_getPluralName_DRAFT_API_DO_NOT_US | |
| T_USE | | E | |
| # define uloc_getCharacterOrientation uloc_getCharacterOrientation_D | | # define uloc_forLanguageTag uloc_forLanguageTag_DRAFT_API_DO_NOT_US | |
| RAFT_API_DO_NOT_USE | | E | |
| # define uloc_getLineOrientation uloc_getLineOrientation_DRAFT_API_D | | # define uloc_toLanguageTag uloc_toLanguageTag_DRAFT_API_DO_NOT_USE | |
| O_NOT_USE | | # define ulocdata_getCLDRVersion ulocdata_getCLDRVersion_DRAFT_API_D | |
| # define uloc_minimizeSubtags uloc_minimizeSubtags_DRAFT_API_DO_NOT_ | | O_NOT_USE | |
| USE | | # define ulocdata_getLocaleDisplayPattern ulocdata_getLocaleDisplayP | |
| # define uregex_getMatchCallback uregex_getMatchCallback_DRAFT_API_D | | attern_DRAFT_API_DO_NOT_USE | |
| O_NOT_USE | | # define ulocdata_getLocaleSeparator ulocdata_getLocaleSeparator_DRA | |
| # define uregex_getStackLimit uregex_getStackLimit_DRAFT_API_DO_NOT_ | | FT_API_DO_NOT_USE | |
| USE | | # define uset_closeOver uset_closeOver_DRAFT_API_DO_NOT_USE | |
| # define uregex_getTimeLimit uregex_getTimeLimit_DRAFT_API_DO_NOT_US | | # define uset_openEmpty uset_openEmpty_DRAFT_API_DO_NOT_USE | |
| E | | # define uset_removeAllStrings uset_removeAllStrings_DRAFT_API_DO_NO | |
| # define uregex_hasAnchoringBounds uregex_hasAnchoringBounds_DRAFT_A | | T_USE | |
| PI_DO_NOT_USE | | # define uspoof_areConfusable uspoof_areConfusable_DRAFT_API_DO_NOT_ | |
| # define uregex_hasTransparentBounds uregex_hasTransparentBounds_DRA | | USE | |
| FT_API_DO_NOT_USE | | # define uspoof_areConfusableUTF8 uspoof_areConfusableUTF8_DRAFT_API | |
| # define uregex_hitEnd uregex_hitEnd_DRAFT_API_DO_NOT_USE | | _DO_NOT_USE | |
| # define uregex_regionEnd uregex_regionEnd_DRAFT_API_DO_NOT_USE | | # define uspoof_check uspoof_check_DRAFT_API_DO_NOT_USE | |
| # define uregex_regionStart uregex_regionStart_DRAFT_API_DO_NOT_USE | | # define uspoof_checkUTF8 uspoof_checkUTF8_DRAFT_API_DO_NOT_USE | |
| # define uregex_requireEnd uregex_requireEnd_DRAFT_API_DO_NOT_USE | | # define uspoof_clone uspoof_clone_DRAFT_API_DO_NOT_USE | |
| # define uregex_setMatchCallback uregex_setMatchCallback_DRAFT_API_D | | # define uspoof_close uspoof_close_DRAFT_API_DO_NOT_USE | |
| O_NOT_USE | | # define uspoof_getAllowedChars uspoof_getAllowedChars_DRAFT_API_DO_ | |
| # define uregex_setRegion uregex_setRegion_DRAFT_API_DO_NOT_USE | | NOT_USE | |
| # define uregex_setStackLimit uregex_setStackLimit_DRAFT_API_DO_NOT_ | | # define uspoof_getAllowedLocales uspoof_getAllowedLocales_DRAFT_API | |
| USE | | _DO_NOT_USE | |
| # define uregex_setTimeLimit uregex_setTimeLimit_DRAFT_API_DO_NOT_US | | # define uspoof_getChecks uspoof_getChecks_DRAFT_API_DO_NOT_USE | |
| E | | # define uspoof_getSkeleton uspoof_getSkeleton_DRAFT_API_DO_NOT_USE | |
| # define uregex_useAnchoringBounds uregex_useAnchoringBounds_DRAFT_A | | # define uspoof_getSkeletonUTF8 uspoof_getSkeletonUTF8_DRAFT_API_DO_ | |
| PI_DO_NOT_USE | | NOT_USE | |
| # define uregex_useTransparentBounds uregex_useTransparentBounds_DRA | | # define uspoof_open uspoof_open_DRAFT_API_DO_NOT_USE | |
| FT_API_DO_NOT_USE | | # define uspoof_openFromSerialized uspoof_openFromSerialized_DRAFT_A | |
| | | PI_DO_NOT_USE | |
| | | # define uspoof_openFromSource uspoof_openFromSource_DRAFT_API_DO_NO | |
| | | T_USE | |
| | | # define uspoof_serialize uspoof_serialize_DRAFT_API_DO_NOT_USE | |
| | | # define uspoof_setAllowedChars uspoof_setAllowedChars_DRAFT_API_DO_ | |
| | | NOT_USE | |
| | | # define uspoof_setAllowedLocales uspoof_setAllowedLocales_DRAFT_API | |
| | | _DO_NOT_USE | |
| | | # define uspoof_setChecks uspoof_setChecks_DRAFT_API_DO_NOT_USE | |
| | | # define usprep_openByType usprep_openByType_DRAFT_API_DO_NOT_USE | |
| # else | | # else | |
|
| # define afkLanguageCode_4_1.2 afkLanguageCode_DRAFT_API_DO_NOT_USE | | # define u_compareVersions_4_2 u_compareVersions_DRAFT_API_DO_NOT_US | |
| # define armiScriptCode_4_1.2 armiScriptCode_DRAFT_API_DO_NOT_USE | | E | |
| # define u_fclose_4_1.2 u_fclose_DRAFT_API_DO_NOT_USE | | # define u_strFromUTF32WithSub_4_2 u_strFromUTF32WithSub_DRAFT_API_D | |
| # define u_feof_4_1.2 u_feof_DRAFT_API_DO_NOT_USE | | O_NOT_USE | |
| # define u_fflush_4_1.2 u_fflush_DRAFT_API_DO_NOT_USE | | # define u_strToUTF32WithSub_4_2 u_strToUTF32WithSub_DRAFT_API_DO_NO | |
| # define u_fgetConverter_4_1.2 u_fgetConverter_DRAFT_API_DO_NOT_USE | | T_USE | |
| # define u_fgetc_4_1.2 u_fgetc_DRAFT_API_DO_NOT_USE | | # define u_versionFromUString_4_2 u_versionFromUString_DRAFT_API_DO_ | |
| # define u_fgetcodepage_4_1.2 u_fgetcodepage_DRAFT_API_DO_NOT_USE | | NOT_USE | |
| # define u_fgetcx_4_1.2 u_fgetcx_DRAFT_API_DO_NOT_USE | | # define ucal_getKeywordValuesForLocale_4_2 ucal_getKeywordValuesFor | |
| # define u_fgetfile_4_1.2 u_fgetfile_DRAFT_API_DO_NOT_USE | | Locale_DRAFT_API_DO_NOT_USE | |
| # define u_fgetlocale_4_1.2 u_fgetlocale_DRAFT_API_DO_NOT_USE | | # define ucal_getType_4_2 ucal_getType_DRAFT_API_DO_NOT_USE | |
| # define u_fgets_4_1.2 u_fgets_DRAFT_API_DO_NOT_USE | | # define ucnvsel_close_4_2 ucnvsel_close_DRAFT_API_DO_NOT_USE | |
| # define u_file_read_4_1.2 u_file_read_DRAFT_API_DO_NOT_USE | | # define ucnvsel_openFromSerialized_4_2 ucnvsel_openFromSerialized_D | |
| # define u_file_write_4_1.2 u_file_write_DRAFT_API_DO_NOT_USE | | RAFT_API_DO_NOT_USE | |
| # define u_finit_4_1.2 u_finit_DRAFT_API_DO_NOT_USE | | # define ucnvsel_open_4_2 ucnvsel_open_DRAFT_API_DO_NOT_USE | |
| # define u_fopen_4_1.2 u_fopen_DRAFT_API_DO_NOT_USE | | # define ucnvsel_selectForString_4_2 ucnvsel_selectForString_DRAFT_A | |
| # define u_fprintf_4_1.2 u_fprintf_DRAFT_API_DO_NOT_USE | | PI_DO_NOT_USE | |
| # define u_fprintf_u_4_1.2 u_fprintf_u_DRAFT_API_DO_NOT_USE | | # define ucnvsel_selectForUTF8_4_2 ucnvsel_selectForUTF8_DRAFT_API_D | |
| # define u_fputc_4_1.2 u_fputc_DRAFT_API_DO_NOT_USE | | O_NOT_USE | |
| # define u_fputs_4_1.2 u_fputs_DRAFT_API_DO_NOT_USE | | # define ucnvsel_serialize_4_2 ucnvsel_serialize_DRAFT_API_DO_NOT_US | |
| # define u_frewind_4_1.2 u_frewind_DRAFT_API_DO_NOT_USE | | E | |
| # define u_fscanf_4_1.2 u_fscanf_DRAFT_API_DO_NOT_USE | | # define ucol_getKeywordValuesForLocale_4_2 ucol_getKeywordValuesFor | |
| # define u_fscanf_u_4_1.2 u_fscanf_u_DRAFT_API_DO_NOT_USE | | Locale_DRAFT_API_DO_NOT_USE | |
| # define u_fsetcodepage_4_1.2 u_fsetcodepage_DRAFT_API_DO_NOT_USE | | # define ucurr_getKeywordValuesForLocale_4_2 ucurr_getKeywordValuesF | |
| # define u_fsetlocale_4_1.2 u_fsetlocale_DRAFT_API_DO_NOT_USE | | orLocale_DRAFT_API_DO_NOT_USE | |
| # define u_fsettransliterator_4_1.2 u_fsettransliterator_DRAFT_API_D | | # define ucurr_getPluralName_4_2 ucurr_getPluralName_DRAFT_API_DO_NO | |
| O_NOT_USE | | T_USE | |
| # define u_fstropen_4_1.2 u_fstropen_DRAFT_API_DO_NOT_USE | | # define uloc_forLanguageTag_4_2 uloc_forLanguageTag_DRAFT_API_DO_NO | |
| # define u_fungetc_4_1.2 u_fungetc_DRAFT_API_DO_NOT_USE | | T_USE | |
| # define u_snprintf_4_1.2 u_snprintf_DRAFT_API_DO_NOT_USE | | # define uloc_toLanguageTag_4_2 uloc_toLanguageTag_DRAFT_API_DO_NOT_ | |
| # define u_snprintf_u_4_1.2 u_snprintf_u_DRAFT_API_DO_NOT_USE | | USE | |
| # define u_sprintf_4_1.2 u_sprintf_DRAFT_API_DO_NOT_USE | | # define ulocdata_getCLDRVersion_4_2 ulocdata_getCLDRVersion_DRAFT_A | |
| # define u_sprintf_u_4_1.2 u_sprintf_u_DRAFT_API_DO_NOT_USE | | PI_DO_NOT_USE | |
| # define u_sscanf_4_1.2 u_sscanf_DRAFT_API_DO_NOT_USE | | # define ulocdata_getLocaleDisplayPattern_4_2 ulocdata_getLocaleDisp | |
| # define u_sscanf_u_4_1.2 u_sscanf_u_DRAFT_API_DO_NOT_USE | | layPattern_DRAFT_API_DO_NOT_USE | |
| # define u_vfprintf_4_1.2 u_vfprintf_DRAFT_API_DO_NOT_USE | | # define ulocdata_getLocaleSeparator_4_2 ulocdata_getLocaleSeparator | |
| # define u_vfprintf_u_4_1.2 u_vfprintf_u_DRAFT_API_DO_NOT_USE | | _DRAFT_API_DO_NOT_USE | |
| # define u_vfscanf_4_1.2 u_vfscanf_DRAFT_API_DO_NOT_USE | | # define uset_closeOver_4_2 uset_closeOver_DRAFT_API_DO_NOT_USE | |
| # define u_vfscanf_u_4_1.2 u_vfscanf_u_DRAFT_API_DO_NOT_USE | | # define uset_openEmpty_4_2 uset_openEmpty_DRAFT_API_DO_NOT_USE | |
| # define u_vsnprintf_4_1.2 u_vsnprintf_DRAFT_API_DO_NOT_USE | | # define uset_removeAllStrings_4_2 uset_removeAllStrings_DRAFT_API_D | |
| # define u_vsnprintf_u_4_1.2 u_vsnprintf_u_DRAFT_API_DO_NOT_USE | | O_NOT_USE | |
| # define u_vsprintf_4_1.2 u_vsprintf_DRAFT_API_DO_NOT_USE | | # define uspoof_areConfusableUTF8_4_2 uspoof_areConfusableUTF8_DRAFT | |
| # define u_vsprintf_u_4_1.2 u_vsprintf_u_DRAFT_API_DO_NOT_USE | | _API_DO_NOT_USE | |
| # define u_vsscanf_4_1.2 u_vsscanf_DRAFT_API_DO_NOT_USE | | # define uspoof_areConfusable_4_2 uspoof_areConfusable_DRAFT_API_DO_ | |
| # define u_vsscanf_u_4_1.2 u_vsscanf_u_DRAFT_API_DO_NOT_USE | | NOT_USE | |
| # define ucal_clone_4_1.2 ucal_clone_DRAFT_API_DO_NOT_USE | | # define uspoof_checkUTF8_4_2 uspoof_checkUTF8_DRAFT_API_DO_NOT_USE | |
| # define ucal_getCanonicalTimeZoneID_4_1.2 ucal_getCanonicalTimeZone | | # define uspoof_check_4_2 uspoof_check_DRAFT_API_DO_NOT_USE | |
| ID_DRAFT_API_DO_NOT_USE | | # define uspoof_clone_4_2 uspoof_clone_DRAFT_API_DO_NOT_USE | |
| # define ucal_getType_4_1.2 ucal_getType_DRAFT_API_DO_NOT_USE | | # define uspoof_close_4_2 uspoof_close_DRAFT_API_DO_NOT_USE | |
| # define ucnvsel_close_4_1.2 ucnvsel_close_DRAFT_API_DO_NOT_USE | | # define uspoof_getAllowedChars_4_2 uspoof_getAllowedChars_DRAFT_API | |
| # define ucnvsel_openFromSerialized_4_1.2 ucnvsel_openFromSerialized | | _DO_NOT_USE | |
| _DRAFT_API_DO_NOT_USE | | # define uspoof_getAllowedLocales_4_2 uspoof_getAllowedLocales_DRAFT | |
| # define ucnvsel_open_4_1.2 ucnvsel_open_DRAFT_API_DO_NOT_USE | | _API_DO_NOT_USE | |
| # define ucnvsel_selectForString_4_1.2 ucnvsel_selectForString_DRAFT | | # define uspoof_getChecks_4_2 uspoof_getChecks_DRAFT_API_DO_NOT_USE | |
| _API_DO_NOT_USE | | # define uspoof_getSkeletonUTF8_4_2 uspoof_getSkeletonUTF8_DRAFT_API | |
| # define ucnvsel_selectForUTF8_4_1.2 ucnvsel_selectForUTF8_DRAFT_API | | _DO_NOT_USE | |
| _DO_NOT_USE | | # define uspoof_getSkeleton_4_2 uspoof_getSkeleton_DRAFT_API_DO_NOT_ | |
| # define ucnvsel_serialize_4_1.2 ucnvsel_serialize_DRAFT_API_DO_NOT_ | | USE | |
| USE | | # define uspoof_openFromSerialized_4_2 uspoof_openFromSerialized_DRA | |
| # define ucurr_countCurrencies_4_1.2 ucurr_countCurrencies_DRAFT_API | | FT_API_DO_NOT_USE | |
| _DO_NOT_USE | | # define uspoof_openFromSource_4_2 uspoof_openFromSource_DRAFT_API_D | |
| # define ucurr_forLocaleAndDate_4_1.2 ucurr_forLocaleAndDate_DRAFT_A | | O_NOT_USE | |
| PI_DO_NOT_USE | | # define uspoof_open_4_2 uspoof_open_DRAFT_API_DO_NOT_USE | |
| # define uloc_addLikelySubtags_4_1.2 uloc_addLikelySubtags_DRAFT_API | | # define uspoof_serialize_4_2 uspoof_serialize_DRAFT_API_DO_NOT_USE | |
| _DO_NOT_USE | | # define uspoof_setAllowedChars_4_2 uspoof_setAllowedChars_DRAFT_API | |
| # define uloc_getCharacterOrientation_4_1.2 uloc_getCharacterOrienta | | _DO_NOT_USE | |
| tion_DRAFT_API_DO_NOT_USE | | # define uspoof_setAllowedLocales_4_2 uspoof_setAllowedLocales_DRAFT | |
| # define uloc_getLineOrientation_4_1.2 uloc_getLineOrientation_DRAFT | | _API_DO_NOT_USE | |
| _API_DO_NOT_USE | | # define uspoof_setChecks_4_2 uspoof_setChecks_DRAFT_API_DO_NOT_USE | |
| # define uloc_minimizeSubtags_4_1.2 uloc_minimizeSubtags_DRAFT_API_D | | # define usprep_openByType_4_2 usprep_openByType_DRAFT_API_DO_NOT_US | |
| O_NOT_USE | | E | |
| # define uregex_getMatchCallback_4_1.2 uregex_getMatchCallback_DRAFT | | | |
| _API_DO_NOT_USE | | | |
| # define uregex_getStackLimit_4_1.2 uregex_getStackLimit_DRAFT_API_D | | | |
| O_NOT_USE | | | |
| # define uregex_getTimeLimit_4_1.2 uregex_getTimeLimit_DRAFT_API_DO_ | | | |
| NOT_USE | | | |
| # define uregex_hasAnchoringBounds_4_1.2 uregex_hasAnchoringBounds_D | | | |
| RAFT_API_DO_NOT_USE | | | |
| # define uregex_hasTransparentBounds_4_1.2 uregex_hasTransparentBoun | | | |
| ds_DRAFT_API_DO_NOT_USE | | | |
| # define uregex_hitEnd_4_1.2 uregex_hitEnd_DRAFT_API_DO_NOT_USE | | | |
| # define uregex_regionEnd_4_1.2 uregex_regionEnd_DRAFT_API_DO_NOT_US | | | |
| E | | | |
| # define uregex_regionStart_4_1.2 uregex_regionStart_DRAFT_API_DO_NO | | | |
| T_USE | | | |
| # define uregex_requireEnd_4_1.2 uregex_requireEnd_DRAFT_API_DO_NOT_ | | | |
| USE | | | |
| # define uregex_setMatchCallback_4_1.2 uregex_setMatchCallback_DRAFT | | | |
| _API_DO_NOT_USE | | | |
| # define uregex_setRegion_4_1.2 uregex_setRegion_DRAFT_API_DO_NOT_US | | | |
| E | | | |
| # define uregex_setStackLimit_4_1.2 uregex_setStackLimit_DRAFT_API_D | | | |
| O_NOT_USE | | | |
| # define uregex_setTimeLimit_4_1.2 uregex_setTimeLimit_DRAFT_API_DO_ | | | |
| NOT_USE | | | |
| # define uregex_useAnchoringBounds_4_1.2 uregex_useAnchoringBounds_D | | | |
| RAFT_API_DO_NOT_USE | | | |
| # define uregex_useTransparentBounds_4_1.2 uregex_useTransparentBoun | | | |
| ds_DRAFT_API_DO_NOT_USE | | | |
| # endif /* U_DISABLE_RENAMING */ | | # endif /* U_DISABLE_RENAMING */ | |
| | | | |
| #endif /* U_HIDE_DRAFT_API */ | | #endif /* U_HIDE_DRAFT_API */ | |
| #endif /* UDRAFT_H */ | | #endif /* UDRAFT_H */ | |
| | | | |
End of changes. 3 change blocks. |
| 185 lines changed or deleted | | 127 lines changed or added | |
|
| uintrnal.h | | uintrnal.h | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| * YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN! | | * YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN! | |
| */ | | */ | |
| | | | |
| #ifndef UINTRNAL_H | | #ifndef UINTRNAL_H | |
| #define UINTRNAL_H | | #define UINTRNAL_H | |
| | | | |
| #ifdef U_HIDE_INTERNAL_API | | #ifdef U_HIDE_INTERNAL_API | |
| | | | |
| # if U_DISABLE_RENAMING | | # if U_DISABLE_RENAMING | |
| # define RegexPatternDump RegexPatternDump_INTERNAL_API_DO_NOT_USE | | # define RegexPatternDump RegexPatternDump_INTERNAL_API_DO_NOT_USE | |
|
| | | # define bms.h bms.h_INTERNAL_API_DO_NOT_USE | |
| | | # define bms_empty bms_empty_INTERNAL_API_DO_NOT_USE | |
| | | # define bms_getData bms_getData_INTERNAL_API_DO_NOT_USE | |
| | | # define bms_open bms_open_INTERNAL_API_DO_NOT_USE | |
| | | # define bms_search bms_search_INTERNAL_API_DO_NOT_USE | |
| | | # define bms_setTargetString bms_setTargetString_INTERNAL_API_DO_NOT | |
| | | _USE | |
| | | # define bmsearch.h bmsearch.h_INTERNAL_API_DO_NOT_USE | |
| | | # define colldata.h colldata.h_INTERNAL_API_DO_NOT_USE | |
| | | # define decimfmtAffixPatternValueComparator decimfmtAffixPatternVal | |
| | | ueComparator_INTERNAL_API_DO_NOT_USE | |
| | | # define decimfmtAffixValueComparator decimfmtAffixValueComparator_I | |
| | | NTERNAL_API_DO_NOT_USE | |
| | | # define dtitvinfHashTableValueComparator dtitvinfHashTableValueComp | |
| | | arator_INTERNAL_API_DO_NOT_USE | |
| # define pl_addFontRun pl_addFontRun_INTERNAL_API_DO_NOT_USE | | # define pl_addFontRun pl_addFontRun_INTERNAL_API_DO_NOT_USE | |
| # define pl_addLocaleRun pl_addLocaleRun_INTERNAL_API_DO_NOT_USE | | # define pl_addLocaleRun pl_addLocaleRun_INTERNAL_API_DO_NOT_USE | |
| # define pl_addValueRun pl_addValueRun_INTERNAL_API_DO_NOT_USE | | # define pl_addValueRun pl_addValueRun_INTERNAL_API_DO_NOT_USE | |
| # define pl_close pl_close_INTERNAL_API_DO_NOT_USE | | # define pl_close pl_close_INTERNAL_API_DO_NOT_USE | |
| # define pl_closeFontRuns pl_closeFontRuns_INTERNAL_API_DO_NOT_USE | | # define pl_closeFontRuns pl_closeFontRuns_INTERNAL_API_DO_NOT_USE | |
| # define pl_closeLine pl_closeLine_INTERNAL_API_DO_NOT_USE | | # define pl_closeLine pl_closeLine_INTERNAL_API_DO_NOT_USE | |
| # define pl_closeLocaleRuns pl_closeLocaleRuns_INTERNAL_API_DO_NOT_U
SE | | # define pl_closeLocaleRuns pl_closeLocaleRuns_INTERNAL_API_DO_NOT_U
SE | |
| # define pl_closeValueRuns pl_closeValueRuns_INTERNAL_API_DO_NOT_USE | | # define pl_closeValueRuns pl_closeValueRuns_INTERNAL_API_DO_NOT_USE | |
| # define pl_countLineRuns pl_countLineRuns_INTERNAL_API_DO_NOT_USE | | # define pl_countLineRuns pl_countLineRuns_INTERNAL_API_DO_NOT_USE | |
| # define pl_create pl_create_INTERNAL_API_DO_NOT_USE | | # define pl_create pl_create_INTERNAL_API_DO_NOT_USE | |
| | | | |
| skipping to change at line 84 | | skipping to change at line 95 | |
| # define pl_openEmptyValueRuns pl_openEmptyValueRuns_INTERNAL_API_DO
_NOT_USE | | # define pl_openEmptyValueRuns pl_openEmptyValueRuns_INTERNAL_API_DO
_NOT_USE | |
| # define pl_openFontRuns pl_openFontRuns_INTERNAL_API_DO_NOT_USE | | # define pl_openFontRuns pl_openFontRuns_INTERNAL_API_DO_NOT_USE | |
| # define pl_openLocaleRuns pl_openLocaleRuns_INTERNAL_API_DO_NOT_USE | | # define pl_openLocaleRuns pl_openLocaleRuns_INTERNAL_API_DO_NOT_USE | |
| # define pl_openValueRuns pl_openValueRuns_INTERNAL_API_DO_NOT_USE | | # define pl_openValueRuns pl_openValueRuns_INTERNAL_API_DO_NOT_USE | |
| # define pl_paragraph pl_paragraph_INTERNAL_API_DO_NOT_USE | | # define pl_paragraph pl_paragraph_INTERNAL_API_DO_NOT_USE | |
| # define pl_reflow pl_reflow_INTERNAL_API_DO_NOT_USE | | # define pl_reflow pl_reflow_INTERNAL_API_DO_NOT_USE | |
| # define pl_resetFontRuns pl_resetFontRuns_INTERNAL_API_DO_NOT_USE | | # define pl_resetFontRuns pl_resetFontRuns_INTERNAL_API_DO_NOT_USE | |
| # define pl_resetLocaleRuns pl_resetLocaleRuns_INTERNAL_API_DO_NOT_U
SE | | # define pl_resetLocaleRuns pl_resetLocaleRuns_INTERNAL_API_DO_NOT_U
SE | |
| # define pl_resetValueRuns pl_resetValueRuns_INTERNAL_API_DO_NOT_USE | | # define pl_resetValueRuns pl_resetValueRuns_INTERNAL_API_DO_NOT_USE | |
| # define pl_visualRun pl_visualRun_INTERNAL_API_DO_NOT_USE | | # define pl_visualRun pl_visualRun_INTERNAL_API_DO_NOT_USE | |
|
| | | # define ucd_close ucd_close_INTERNAL_API_DO_NOT_USE | |
| | | # define ucd_flushCache ucd_flushCache_INTERNAL_API_DO_NOT_USE | |
| | | # define ucd_freeCache ucd_freeCache_INTERNAL_API_DO_NOT_USE | |
| | | # define ucd_getCollator ucd_getCollator_INTERNAL_API_DO_NOT_USE | |
| | | # define ucd_open ucd_open_INTERNAL_API_DO_NOT_USE | |
| # define ucol_equals ucol_equals_INTERNAL_API_DO_NOT_USE | | # define ucol_equals ucol_equals_INTERNAL_API_DO_NOT_USE | |
|
| | | # define ucol_forceHanImplicit ucol_forceHanImplicit_INTERNAL_API_DO
_NOT_USE | |
| # define ucol_forgetUCA ucol_forgetUCA_INTERNAL_API_DO_NOT_USE | | # define ucol_forgetUCA ucol_forgetUCA_INTERNAL_API_DO_NOT_USE | |
| # define ucol_getAttributeOrDefault ucol_getAttributeOrDefault_INTER
NAL_API_DO_NOT_USE | | # define ucol_getAttributeOrDefault ucol_getAttributeOrDefault_INTER
NAL_API_DO_NOT_USE | |
| # define ucol_getUnsafeSet ucol_getUnsafeSet_INTERNAL_API_DO_NOT_USE | | # define ucol_getUnsafeSet ucol_getUnsafeSet_INTERNAL_API_DO_NOT_USE | |
| # define ucol_nextProcessed ucol_nextProcessed_INTERNAL_API_DO_NOT_U
SE | | # define ucol_nextProcessed ucol_nextProcessed_INTERNAL_API_DO_NOT_U
SE | |
| # define ucol_prepareShortStringOpen ucol_prepareShortStringOpen_INT
ERNAL_API_DO_NOT_USE | | # define ucol_prepareShortStringOpen ucol_prepareShortStringOpen_INT
ERNAL_API_DO_NOT_USE | |
| # define ucol_previousProcessed ucol_previousProcessed_INTERNAL_API_
DO_NOT_USE | | # define ucol_previousProcessed ucol_previousProcessed_INTERNAL_API_
DO_NOT_USE | |
|
| | | # define udat_applyPatternRelative udat_applyPatternRelative_INTERNA | |
| | | L_API_DO_NOT_USE | |
| | | # define udat_toPatternRelativeDate udat_toPatternRelativeDate_INTER | |
| | | NAL_API_DO_NOT_USE | |
| | | # define udat_toPatternRelativeTime udat_toPatternRelativeTime_INTER | |
| | | NAL_API_DO_NOT_USE | |
| # define uprv_getDefaultCodepage uprv_getDefaultCodepage_INTERNAL_AP
I_DO_NOT_USE | | # define uprv_getDefaultCodepage uprv_getDefaultCodepage_INTERNAL_AP
I_DO_NOT_USE | |
| # define uprv_getDefaultLocaleID uprv_getDefaultLocaleID_INTERNAL_AP
I_DO_NOT_USE | | # define uprv_getDefaultLocaleID uprv_getDefaultLocaleID_INTERNAL_AP
I_DO_NOT_USE | |
| # define ures_openFillIn ures_openFillIn_INTERNAL_API_DO_NOT_USE | | # define ures_openFillIn ures_openFillIn_INTERNAL_API_DO_NOT_USE | |
| # define usearch_search usearch_search_INTERNAL_API_DO_NOT_USE | | # define usearch_search usearch_search_INTERNAL_API_DO_NOT_USE | |
| # define usearch_searchBackwards usearch_searchBackwards_INTERNAL_AP
I_DO_NOT_USE | | # define usearch_searchBackwards usearch_searchBackwards_INTERNAL_AP
I_DO_NOT_USE | |
| # define utf8_appendCharSafeBody utf8_appendCharSafeBody_INTERNAL_AP
I_DO_NOT_USE | | # define utf8_appendCharSafeBody utf8_appendCharSafeBody_INTERNAL_AP
I_DO_NOT_USE | |
| # define utf8_back1SafeBody utf8_back1SafeBody_INTERNAL_API_DO_NOT_U
SE | | # define utf8_back1SafeBody utf8_back1SafeBody_INTERNAL_API_DO_NOT_U
SE | |
| # define utf8_countTrailBytes utf8_countTrailBytes_INTERNAL_API_DO_N
OT_USE | | # define utf8_countTrailBytes utf8_countTrailBytes_INTERNAL_API_DO_N
OT_USE | |
| # define utf8_nextCharSafeBody utf8_nextCharSafeBody_INTERNAL_API_DO
_NOT_USE | | # define utf8_nextCharSafeBody utf8_nextCharSafeBody_INTERNAL_API_DO
_NOT_USE | |
| # define utf8_prevCharSafeBody utf8_prevCharSafeBody_INTERNAL_API_DO
_NOT_USE | | # define utf8_prevCharSafeBody utf8_prevCharSafeBody_INTERNAL_API_DO
_NOT_USE | |
| # else | | # else | |
|
| # define RegexPatternDump_4_1.2 RegexPatternDump_INTERNAL_API_DO_NOT | | # define RegexPatternDump_4_2 RegexPatternDump_INTERNAL_API_DO_NOT_U | |
| _USE | | SE | |
| # define pl_addFontRun_4_1.2 pl_addFontRun_INTERNAL_API_DO_NOT_USE | | # define bms.h_4_2 bms.h_INTERNAL_API_DO_NOT_USE | |
| # define pl_addLocaleRun_4_1.2 pl_addLocaleRun_INTERNAL_API_DO_NOT_U | | # define bms_empty_4_2 bms_empty_INTERNAL_API_DO_NOT_USE | |
| SE | | # define bms_getData_4_2 bms_getData_INTERNAL_API_DO_NOT_USE | |
| # define pl_addValueRun_4_1.2 pl_addValueRun_INTERNAL_API_DO_NOT_USE | | # define bms_open_4_2 bms_open_INTERNAL_API_DO_NOT_USE | |
| # define pl_closeFontRuns_4_1.2 pl_closeFontRuns_INTERNAL_API_DO_NOT | | # define bms_search_4_2 bms_search_INTERNAL_API_DO_NOT_USE | |
| _USE | | # define bms_setTargetString_4_2 bms_setTargetString_INTERNAL_API_DO | |
| # define pl_closeLine_4_1.2 pl_closeLine_INTERNAL_API_DO_NOT_USE | | _NOT_USE | |
| # define pl_closeLocaleRuns_4_1.2 pl_closeLocaleRuns_INTERNAL_API_DO | | # define bmsearch.h_4_2 bmsearch.h_INTERNAL_API_DO_NOT_USE | |
| _NOT_USE | | # define colldata.h_4_2 colldata.h_INTERNAL_API_DO_NOT_USE | |
| # define pl_closeValueRuns_4_1.2 pl_closeValueRuns_INTERNAL_API_DO_N | | # define decimfmtAffixPatternValueComparator_4_2 decimfmtAffixPatter | |
| OT_USE | | nValueComparator_INTERNAL_API_DO_NOT_USE | |
| # define pl_close_4_1.2 pl_close_INTERNAL_API_DO_NOT_USE | | # define decimfmtAffixValueComparator_4_2 decimfmtAffixValueComparat | |
| # define pl_countLineRuns_4_1.2 pl_countLineRuns_INTERNAL_API_DO_NOT | | or_INTERNAL_API_DO_NOT_USE | |
| _USE | | # define dtitvinfHashTableValueComparator_4_2 dtitvinfHashTableValue | |
| # define pl_create_4_1.2 pl_create_INTERNAL_API_DO_NOT_USE | | Comparator_INTERNAL_API_DO_NOT_USE | |
| # define pl_getAscent_4_1.2 pl_getAscent_INTERNAL_API_DO_NOT_USE | | # define pl_addFontRun_4_2 pl_addFontRun_INTERNAL_API_DO_NOT_USE | |
| # define pl_getDescent_4_1.2 pl_getDescent_INTERNAL_API_DO_NOT_USE | | # define pl_addLocaleRun_4_2 pl_addLocaleRun_INTERNAL_API_DO_NOT_USE | |
| # define pl_getFontRunCount_4_1.2 pl_getFontRunCount_INTERNAL_API_DO | | # define pl_addValueRun_4_2 pl_addValueRun_INTERNAL_API_DO_NOT_USE | |
| _NOT_USE | | # define pl_closeFontRuns_4_2 pl_closeFontRuns_INTERNAL_API_DO_NOT_U | |
| # define pl_getFontRunFont_4_1.2 pl_getFontRunFont_INTERNAL_API_DO_N | | SE | |
| OT_USE | | # define pl_closeLine_4_2 pl_closeLine_INTERNAL_API_DO_NOT_USE | |
| # define pl_getFontRunLastLimit_4_1.2 pl_getFontRunLastLimit_INTERNA | | # define pl_closeLocaleRuns_4_2 pl_closeLocaleRuns_INTERNAL_API_DO_N | |
| L_API_DO_NOT_USE | | OT_USE | |
| # define pl_getFontRunLimit_4_1.2 pl_getFontRunLimit_INTERNAL_API_DO | | # define pl_closeValueRuns_4_2 pl_closeValueRuns_INTERNAL_API_DO_NOT | |
| _NOT_USE | | _USE | |
| # define pl_getLeading_4_1.2 pl_getLeading_INTERNAL_API_DO_NOT_USE | | # define pl_close_4_2 pl_close_INTERNAL_API_DO_NOT_USE | |
| # define pl_getLineAscent_4_1.2 pl_getLineAscent_INTERNAL_API_DO_NOT | | # define pl_countLineRuns_4_2 pl_countLineRuns_INTERNAL_API_DO_NOT_U | |
| _USE | | SE | |
| # define pl_getLineDescent_4_1.2 pl_getLineDescent_INTERNAL_API_DO_N | | # define pl_create_4_2 pl_create_INTERNAL_API_DO_NOT_USE | |
| OT_USE | | # define pl_getAscent_4_2 pl_getAscent_INTERNAL_API_DO_NOT_USE | |
| # define pl_getLineLeading_4_1.2 pl_getLineLeading_INTERNAL_API_DO_N | | # define pl_getDescent_4_2 pl_getDescent_INTERNAL_API_DO_NOT_USE | |
| OT_USE | | # define pl_getFontRunCount_4_2 pl_getFontRunCount_INTERNAL_API_DO_N | |
| # define pl_getLineVisualRun_4_1.2 pl_getLineVisualRun_INTERNAL_API_ | | OT_USE | |
| DO_NOT_USE | | # define pl_getFontRunFont_4_2 pl_getFontRunFont_INTERNAL_API_DO_NOT | |
| # define pl_getLineWidth_4_1.2 pl_getLineWidth_INTERNAL_API_DO_NOT_U | | _USE | |
| SE | | # define pl_getFontRunLastLimit_4_2 pl_getFontRunLastLimit_INTERNAL_ | |
| # define pl_getLocaleRunCount_4_1.2 pl_getLocaleRunCount_INTERNAL_AP | | API_DO_NOT_USE | |
| I_DO_NOT_USE | | # define pl_getFontRunLimit_4_2 pl_getFontRunLimit_INTERNAL_API_DO_N | |
| # define pl_getLocaleRunLastLimit_4_1.2 pl_getLocaleRunLastLimit_INT | | OT_USE | |
| ERNAL_API_DO_NOT_USE | | # define pl_getLeading_4_2 pl_getLeading_INTERNAL_API_DO_NOT_USE | |
| # define pl_getLocaleRunLimit_4_1.2 pl_getLocaleRunLimit_INTERNAL_AP | | # define pl_getLineAscent_4_2 pl_getLineAscent_INTERNAL_API_DO_NOT_U | |
| I_DO_NOT_USE | | SE | |
| # define pl_getLocaleRunLocale_4_1.2 pl_getLocaleRunLocale_INTERNAL_ | | # define pl_getLineDescent_4_2 pl_getLineDescent_INTERNAL_API_DO_NOT | |
| API_DO_NOT_USE | | _USE | |
| # define pl_getParagraphLevel_4_1.2 pl_getParagraphLevel_INTERNAL_AP | | # define pl_getLineLeading_4_2 pl_getLineLeading_INTERNAL_API_DO_NOT | |
| I_DO_NOT_USE | | _USE | |
| # define pl_getTextDirection_4_1.2 pl_getTextDirection_INTERNAL_API_ | | # define pl_getLineVisualRun_4_2 pl_getLineVisualRun_INTERNAL_API_DO | |
| DO_NOT_USE | | _NOT_USE | |
| # define pl_getValueRunCount_4_1.2 pl_getValueRunCount_INTERNAL_API_ | | # define pl_getLineWidth_4_2 pl_getLineWidth_INTERNAL_API_DO_NOT_USE | |
| DO_NOT_USE | | # define pl_getLocaleRunCount_4_2 pl_getLocaleRunCount_INTERNAL_API_ | |
| # define pl_getValueRunLastLimit_4_1.2 pl_getValueRunLastLimit_INTER | | DO_NOT_USE | |
| NAL_API_DO_NOT_USE | | # define pl_getLocaleRunLastLimit_4_2 pl_getLocaleRunLastLimit_INTER | |
| # define pl_getValueRunLimit_4_1.2 pl_getValueRunLimit_INTERNAL_API_ | | NAL_API_DO_NOT_USE | |
| DO_NOT_USE | | # define pl_getLocaleRunLimit_4_2 pl_getLocaleRunLimit_INTERNAL_API_ | |
| # define pl_getValueRunValue_4_1.2 pl_getValueRunValue_INTERNAL_API_ | | DO_NOT_USE | |
| DO_NOT_USE | | # define pl_getLocaleRunLocale_4_2 pl_getLocaleRunLocale_INTERNAL_AP | |
| # define pl_getVisualRunAscent_4_1.2 pl_getVisualRunAscent_INTERNAL_ | | I_DO_NOT_USE | |
| API_DO_NOT_USE | | # define pl_getParagraphLevel_4_2 pl_getParagraphLevel_INTERNAL_API_ | |
| # define pl_getVisualRunDescent_4_1.2 pl_getVisualRunDescent_INTERNA | | DO_NOT_USE | |
| L_API_DO_NOT_USE | | # define pl_getTextDirection_4_2 pl_getTextDirection_INTERNAL_API_DO | |
| # define pl_getVisualRunDirection_4_1.2 pl_getVisualRunDirection_INT | | _NOT_USE | |
| ERNAL_API_DO_NOT_USE | | # define pl_getValueRunCount_4_2 pl_getValueRunCount_INTERNAL_API_DO | |
| # define pl_getVisualRunFont_4_1.2 pl_getVisualRunFont_INTERNAL_API_ | | _NOT_USE | |
| DO_NOT_USE | | # define pl_getValueRunLastLimit_4_2 pl_getValueRunLastLimit_INTERNA | |
| # define pl_getVisualRunGlyphCount_4_1.2 pl_getVisualRunGlyphCount_I | | L_API_DO_NOT_USE | |
| NTERNAL_API_DO_NOT_USE | | # define pl_getValueRunLimit_4_2 pl_getValueRunLimit_INTERNAL_API_DO | |
| # define pl_getVisualRunGlyphToCharMap_4_1.2 pl_getVisualRunGlyphToC | | _NOT_USE | |
| harMap_INTERNAL_API_DO_NOT_USE | | # define pl_getValueRunValue_4_2 pl_getValueRunValue_INTERNAL_API_DO | |
| # define pl_getVisualRunGlyphs_4_1.2 pl_getVisualRunGlyphs_INTERNAL_ | | _NOT_USE | |
| API_DO_NOT_USE | | # define pl_getVisualRunAscent_4_2 pl_getVisualRunAscent_INTERNAL_AP | |
| # define pl_getVisualRunLeading_4_1.2 pl_getVisualRunLeading_INTERNA | | I_DO_NOT_USE | |
| L_API_DO_NOT_USE | | # define pl_getVisualRunDescent_4_2 pl_getVisualRunDescent_INTERNAL_ | |
| # define pl_getVisualRunPositions_4_1.2 pl_getVisualRunPositions_INT | | API_DO_NOT_USE | |
| ERNAL_API_DO_NOT_USE | | # define pl_getVisualRunDirection_4_2 pl_getVisualRunDirection_INTER | |
| # define pl_isComplex_4_1.2 pl_isComplex_INTERNAL_API_DO_NOT_USE | | NAL_API_DO_NOT_USE | |
| # define pl_line_4_1.2 pl_line_INTERNAL_API_DO_NOT_USE | | # define pl_getVisualRunFont_4_2 pl_getVisualRunFont_INTERNAL_API_DO | |
| # define pl_nextLine_4_1.2 pl_nextLine_INTERNAL_API_DO_NOT_USE | | _NOT_USE | |
| # define pl_openEmptyFontRuns_4_1.2 pl_openEmptyFontRuns_INTERNAL_AP | | # define pl_getVisualRunGlyphCount_4_2 pl_getVisualRunGlyphCount_INT | |
| I_DO_NOT_USE | | ERNAL_API_DO_NOT_USE | |
| # define pl_openEmptyLocaleRuns_4_1.2 pl_openEmptyLocaleRuns_INTERNA | | # define pl_getVisualRunGlyphToCharMap_4_2 pl_getVisualRunGlyphToCha | |
| L_API_DO_NOT_USE | | rMap_INTERNAL_API_DO_NOT_USE | |
| # define pl_openEmptyValueRuns_4_1.2 pl_openEmptyValueRuns_INTERNAL_ | | # define pl_getVisualRunGlyphs_4_2 pl_getVisualRunGlyphs_INTERNAL_AP | |
| API_DO_NOT_USE | | I_DO_NOT_USE | |
| # define pl_openFontRuns_4_1.2 pl_openFontRuns_INTERNAL_API_DO_NOT_U | | # define pl_getVisualRunLeading_4_2 pl_getVisualRunLeading_INTERNAL_ | |
| SE | | API_DO_NOT_USE | |
| # define pl_openLocaleRuns_4_1.2 pl_openLocaleRuns_INTERNAL_API_DO_N | | # define pl_getVisualRunPositions_4_2 pl_getVisualRunPositions_INTER | |
| OT_USE | | NAL_API_DO_NOT_USE | |
| # define pl_openValueRuns_4_1.2 pl_openValueRuns_INTERNAL_API_DO_NOT | | # define pl_isComplex_4_2 pl_isComplex_INTERNAL_API_DO_NOT_USE | |
| _USE | | # define pl_line_4_2 pl_line_INTERNAL_API_DO_NOT_USE | |
| # define pl_paragraph_4_1.2 pl_paragraph_INTERNAL_API_DO_NOT_USE | | # define pl_nextLine_4_2 pl_nextLine_INTERNAL_API_DO_NOT_USE | |
| # define pl_reflow_4_1.2 pl_reflow_INTERNAL_API_DO_NOT_USE | | # define pl_openEmptyFontRuns_4_2 pl_openEmptyFontRuns_INTERNAL_API_ | |
| # define pl_resetFontRuns_4_1.2 pl_resetFontRuns_INTERNAL_API_DO_NOT | | DO_NOT_USE | |
| _USE | | # define pl_openEmptyLocaleRuns_4_2 pl_openEmptyLocaleRuns_INTERNAL_ | |
| # define pl_resetLocaleRuns_4_1.2 pl_resetLocaleRuns_INTERNAL_API_DO | | API_DO_NOT_USE | |
| _NOT_USE | | # define pl_openEmptyValueRuns_4_2 pl_openEmptyValueRuns_INTERNAL_AP | |
| # define pl_resetValueRuns_4_1.2 pl_resetValueRuns_INTERNAL_API_DO_N | | I_DO_NOT_USE | |
| OT_USE | | # define pl_openFontRuns_4_2 pl_openFontRuns_INTERNAL_API_DO_NOT_USE | |
| # define pl_visualRun_4_1.2 pl_visualRun_INTERNAL_API_DO_NOT_USE | | # define pl_openLocaleRuns_4_2 pl_openLocaleRuns_INTERNAL_API_DO_NOT | |
| # define ucol_equals_4_1.2 ucol_equals_INTERNAL_API_DO_NOT_USE | | _USE | |
| # define ucol_forgetUCA_4_1.2 ucol_forgetUCA_INTERNAL_API_DO_NOT_USE | | # define pl_openValueRuns_4_2 pl_openValueRuns_INTERNAL_API_DO_NOT_U | |
| # define ucol_getAttributeOrDefault_4_1.2 ucol_getAttributeOrDefault | | SE | |
| _INTERNAL_API_DO_NOT_USE | | # define pl_paragraph_4_2 pl_paragraph_INTERNAL_API_DO_NOT_USE | |
| # define ucol_getUnsafeSet_4_1.2 ucol_getUnsafeSet_INTERNAL_API_DO_N | | # define pl_reflow_4_2 pl_reflow_INTERNAL_API_DO_NOT_USE | |
| OT_USE | | # define pl_resetFontRuns_4_2 pl_resetFontRuns_INTERNAL_API_DO_NOT_U | |
| # define ucol_nextProcessed_4_1.2 ucol_nextProcessed_INTERNAL_API_DO | | SE | |
| _NOT_USE | | # define pl_resetLocaleRuns_4_2 pl_resetLocaleRuns_INTERNAL_API_DO_N | |
| # define ucol_prepareShortStringOpen_4_1.2 ucol_prepareShortStringOp | | OT_USE | |
| en_INTERNAL_API_DO_NOT_USE | | # define pl_resetValueRuns_4_2 pl_resetValueRuns_INTERNAL_API_DO_NOT | |
| # define ucol_previousProcessed_4_1.2 ucol_previousProcessed_INTERNA | | _USE | |
| L_API_DO_NOT_USE | | # define pl_visualRun_4_2 pl_visualRun_INTERNAL_API_DO_NOT_USE | |
| # define uprv_getDefaultCodepage_4_1.2 uprv_getDefaultCodepage_INTER | | # define ucd_close_4_2 ucd_close_INTERNAL_API_DO_NOT_USE | |
| NAL_API_DO_NOT_USE | | # define ucd_flushCache_4_2 ucd_flushCache_INTERNAL_API_DO_NOT_USE | |
| # define uprv_getDefaultLocaleID_4_1.2 uprv_getDefaultLocaleID_INTER | | # define ucd_freeCache_4_2 ucd_freeCache_INTERNAL_API_DO_NOT_USE | |
| NAL_API_DO_NOT_USE | | # define ucd_getCollator_4_2 ucd_getCollator_INTERNAL_API_DO_NOT_USE | |
| # define ures_openFillIn_4_1.2 ures_openFillIn_INTERNAL_API_DO_NOT_U | | # define ucd_open_4_2 ucd_open_INTERNAL_API_DO_NOT_USE | |
| SE | | # define ucol_equals_4_2 ucol_equals_INTERNAL_API_DO_NOT_USE | |
| # define usearch_searchBackwards_4_1.2 usearch_searchBackwards_INTER | | # define ucol_forceHanImplicit_4_2 ucol_forceHanImplicit_INTERNAL_AP | |
| NAL_API_DO_NOT_USE | | I_DO_NOT_USE | |
| # define usearch_search_4_1.2 usearch_search_INTERNAL_API_DO_NOT_USE | | # define ucol_forgetUCA_4_2 ucol_forgetUCA_INTERNAL_API_DO_NOT_USE | |
| # define utf8_appendCharSafeBody_4_1.2 utf8_appendCharSafeBody_INTER | | # define ucol_getAttributeOrDefault_4_2 ucol_getAttributeOrDefault_I | |
| NAL_API_DO_NOT_USE | | NTERNAL_API_DO_NOT_USE | |
| # define utf8_back1SafeBody_4_1.2 utf8_back1SafeBody_INTERNAL_API_DO | | # define ucol_getUnsafeSet_4_2 ucol_getUnsafeSet_INTERNAL_API_DO_NOT | |
| _NOT_USE | | _USE | |
| # define utf8_countTrailBytes_4_1.2 utf8_countTrailBytes_INTERNAL_AP | | # define ucol_nextProcessed_4_2 ucol_nextProcessed_INTERNAL_API_DO_N | |
| I_DO_NOT_USE | | OT_USE | |
| # define utf8_nextCharSafeBody_4_1.2 utf8_nextCharSafeBody_INTERNAL_ | | # define ucol_prepareShortStringOpen_4_2 ucol_prepareShortStringOpen | |
| API_DO_NOT_USE | | _INTERNAL_API_DO_NOT_USE | |
| # define utf8_prevCharSafeBody_4_1.2 utf8_prevCharSafeBody_INTERNAL_ | | # define ucol_previousProcessed_4_2 ucol_previousProcessed_INTERNAL_ | |
| API_DO_NOT_USE | | API_DO_NOT_USE | |
| | | # define udat_applyPatternRelative_4_2 udat_applyPatternRelative_INT | |
| | | ERNAL_API_DO_NOT_USE | |
| | | # define udat_toPatternRelativeDate_4_2 udat_toPatternRelativeDate_I | |
| | | NTERNAL_API_DO_NOT_USE | |
| | | # define udat_toPatternRelativeTime_4_2 udat_toPatternRelativeTime_I | |
| | | NTERNAL_API_DO_NOT_USE | |
| | | # define uprv_getDefaultCodepage_4_2 uprv_getDefaultCodepage_INTERNA | |
| | | L_API_DO_NOT_USE | |
| | | # define uprv_getDefaultLocaleID_4_2 uprv_getDefaultLocaleID_INTERNA | |
| | | L_API_DO_NOT_USE | |
| | | # define ures_openFillIn_4_2 ures_openFillIn_INTERNAL_API_DO_NOT_USE | |
| | | # define usearch_searchBackwards_4_2 usearch_searchBackwards_INTERNA | |
| | | L_API_DO_NOT_USE | |
| | | # define usearch_search_4_2 usearch_search_INTERNAL_API_DO_NOT_USE | |
| | | # define utf8_appendCharSafeBody_4_2 utf8_appendCharSafeBody_INTERNA | |
| | | L_API_DO_NOT_USE | |
| | | # define utf8_back1SafeBody_4_2 utf8_back1SafeBody_INTERNAL_API_DO_N | |
| | | OT_USE | |
| | | # define utf8_countTrailBytes_4_2 utf8_countTrailBytes_INTERNAL_API_ | |
| | | DO_NOT_USE | |
| | | # define utf8_nextCharSafeBody_4_2 utf8_nextCharSafeBody_INTERNAL_AP | |
| | | I_DO_NOT_USE | |
| | | # define utf8_prevCharSafeBody_4_2 utf8_prevCharSafeBody_INTERNAL_AP | |
| | | I_DO_NOT_USE | |
| # endif /* U_DISABLE_RENAMING */ | | # endif /* U_DISABLE_RENAMING */ | |
| | | | |
| #endif /* U_HIDE_INTERNAL_API */ | | #endif /* U_HIDE_INTERNAL_API */ | |
| #endif /* UINTRNAL_H */ | | #endif /* UINTRNAL_H */ | |
| | | | |
End of changes. 5 change blocks. |
| 131 lines changed or deleted | | 182 lines changed or added | |
|
| uloc.h | | uloc.h | |
| | | | |
| skipping to change at line 259 | | skipping to change at line 259 | |
| #define ULOC_LANG_CAPACITY 12 | | #define ULOC_LANG_CAPACITY 12 | |
| | | | |
| /** | | /** | |
| * Useful constant for the maximum size of the country part of a locale ID | | * Useful constant for the maximum size of the country part of a locale ID | |
| * (including the terminating NULL). | | * (including the terminating NULL). | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| #define ULOC_COUNTRY_CAPACITY 4 | | #define ULOC_COUNTRY_CAPACITY 4 | |
| /** | | /** | |
| * Useful constant for the maximum size of the whole locale ID | | * Useful constant for the maximum size of the whole locale ID | |
|
| * (including the terminating NULL). | | * (including the terminating NULL and all keywords). | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
|
| #define ULOC_FULLNAME_CAPACITY 56 | | #define ULOC_FULLNAME_CAPACITY 157 | |
| | | | |
| /** | | /** | |
| * Useful constant for the maximum size of the script part of a locale ID | | * Useful constant for the maximum size of the script part of a locale ID | |
| * (including the terminating NULL). | | * (including the terminating NULL). | |
| * @stable ICU 2.8 | | * @stable ICU 2.8 | |
| */ | | */ | |
| #define ULOC_SCRIPT_CAPACITY 6 | | #define ULOC_SCRIPT_CAPACITY 6 | |
| | | | |
| /** | | /** | |
| * Useful constant for the maximum size of keywords in a locale | | * Useful constant for the maximum size of keywords in a locale | |
| * @stable ICU 2.8 | | * @stable ICU 2.8 | |
| */ | | */ | |
| #define ULOC_KEYWORDS_CAPACITY 50 | | #define ULOC_KEYWORDS_CAPACITY 50 | |
| | | | |
| /** | | /** | |
|
| * Useful constant for the maximum SIZE of keywords in a locale | | * Useful constant for the maximum total size of keywords and their values
in a locale | |
| * @stable ICU 2.8 | | * @stable ICU 2.8 | |
| */ | | */ | |
| #define ULOC_KEYWORD_AND_VALUES_CAPACITY 100 | | #define ULOC_KEYWORD_AND_VALUES_CAPACITY 100 | |
| | | | |
| /** | | /** | |
| * Character separating keywords from the locale string | | * Character separating keywords from the locale string | |
| * different for EBCDIC - TODO | | * different for EBCDIC - TODO | |
| * @stable ICU 2.8 | | * @stable ICU 2.8 | |
| */ | | */ | |
| #define ULOC_KEYWORD_SEPARATOR '@' | | #define ULOC_KEYWORD_SEPARATOR '@' | |
| | | | |
| skipping to change at line 852 | | skipping to change at line 852 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uloc_setKeywordValue(const char* keywordName, | | uloc_setKeywordValue(const char* keywordName, | |
| const char* keywordValue, | | const char* keywordValue, | |
| char* buffer, int32_t bufferCapacity, | | char* buffer, int32_t bufferCapacity, | |
| UErrorCode* status); | | UErrorCode* status); | |
| | | | |
| /** | | /** | |
| * enums for the return value for the character and line orientation | | * enums for the return value for the character and line orientation | |
| * functions. | | * functions. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| ULOC_LAYOUT_LTR = 0, /* left-to-right. */ | | ULOC_LAYOUT_LTR = 0, /* left-to-right. */ | |
| ULOC_LAYOUT_RTL = 1, /* right-to-left. */ | | ULOC_LAYOUT_RTL = 1, /* right-to-left. */ | |
| ULOC_LAYOUT_TTB = 2, /* top-to-bottom. */ | | ULOC_LAYOUT_TTB = 2, /* top-to-bottom. */ | |
| ULOC_LAYOUT_BTT = 3, /* bottom-to-top. */ | | ULOC_LAYOUT_BTT = 3, /* bottom-to-top. */ | |
| ULOC_LAYOUT_UNKNOWN | | ULOC_LAYOUT_UNKNOWN | |
| } ULayoutType; | | } ULayoutType; | |
| | | | |
| /** | | /** | |
| * Get the layout character orientation for the specified locale. | | * Get the layout character orientation for the specified locale. | |
| * | | * | |
| * @param localeId locale name | | * @param localeId locale name | |
| * @param status Error status | | * @param status Error status | |
| * @return an enum indicating the layout orientation for characters. | | * @return an enum indicating the layout orientation for characters. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT ULayoutType U_EXPORT2 | | U_DRAFT ULayoutType U_EXPORT2 | |
| uloc_getCharacterOrientation(const char* localeId, | | uloc_getCharacterOrientation(const char* localeId, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Get the layout line orientation for the specified locale. | | * Get the layout line orientation for the specified locale. | |
| * | | * | |
| * @param localeId locale name | | * @param localeId locale name | |
| * @param status Error status | | * @param status Error status | |
| * @return an enum indicating the layout orientation for lines. | | * @return an enum indicating the layout orientation for lines. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT ULayoutType U_EXPORT2 | | U_DRAFT ULayoutType U_EXPORT2 | |
| uloc_getLineOrientation(const char* localeId, | | uloc_getLineOrientation(const char* localeId, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * enums for the 'outResult' parameter return value | | * enums for the 'outResult' parameter return value | |
| * @see uloc_acceptLanguageFromHTTP | | * @see uloc_acceptLanguageFromHTTP | |
| * @see uloc_acceptLanguage | | * @see uloc_acceptLanguage | |
| * @stable ICU 3.2 | | * @stable ICU 3.2 | |
| | | | |
| skipping to change at line 986 | | skipping to change at line 986 | |
| * | | * | |
| * @param localeID The locale to maximize | | * @param localeID The locale to maximize | |
| * @param maximizedLocaleID The maximized locale | | * @param maximizedLocaleID The maximized locale | |
| * @param maximizedLocaleIDCapacity The capacity of the maximizedLocaleID b
uffer | | * @param maximizedLocaleIDCapacity The capacity of the maximizedLocaleID b
uffer | |
| * @param err Error information if maximizing the locale failed. If the le
ngth | | * @param err Error information if maximizing the locale failed. If the le
ngth | |
| * of the localeID and the null-terminator is greater than the maximum allo
wed size, | | * of the localeID and the null-terminator is greater than the maximum allo
wed size, | |
| * or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT
_ERROR. | | * or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT
_ERROR. | |
| * @return The actual buffer size needed for the maximized locale. If it's | | * @return The actual buffer size needed for the maximized locale. If it's | |
| * greater than maximizedLocaleIDCapacity, the returned ID will be truncate
d. | | * greater than maximizedLocaleIDCapacity, the returned ID will be truncate
d. | |
| * On error, the return value is -1. | | * On error, the return value is -1. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT int32_t U_EXPORT2 | | U_DRAFT int32_t U_EXPORT2 | |
| uloc_addLikelySubtags(const char* localeID, | | uloc_addLikelySubtags(const char* localeID, | |
| char* maximizedLocaleID, | | char* maximizedLocaleID, | |
| int32_t maximizedLocaleIDCapacity, | | int32_t maximizedLocaleIDCapacity, | |
| UErrorCode* err); | | UErrorCode* err); | |
| | | | |
| /** | | /** | |
| * Minimize the subtags for a provided locale ID, per the algorithm describ
ed | | * Minimize the subtags for a provided locale ID, per the algorithm describ
ed | |
| * in the following CLDR technical report: | | * in the following CLDR technical report: | |
| | | | |
| skipping to change at line 1025 | | skipping to change at line 1025 | |
| * | | * | |
| * @param localeID The locale to minimize | | * @param localeID The locale to minimize | |
| * @param minimizedLocaleID The minimized locale | | * @param minimizedLocaleID The minimized locale | |
| * @param minimizedLocaleIDCapacity The capacity of the minimizedLocaleID b
uffer | | * @param minimizedLocaleIDCapacity The capacity of the minimizedLocaleID b
uffer | |
| * @param err Error information if minimizing the locale failed. If the le
ngth | | * @param err Error information if minimizing the locale failed. If the le
ngth | |
| * of the localeID and the null-terminator is greater than the maximum allo
wed size, | | * of the localeID and the null-terminator is greater than the maximum allo
wed size, | |
| * or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT
_ERROR. | | * or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT
_ERROR. | |
| * @return The actual buffer size needed for the minimized locale. If it's | | * @return The actual buffer size needed for the minimized locale. If it's | |
| * greater than minimizedLocaleIDCapacity, the returned ID will be truncate
d. | | * greater than minimizedLocaleIDCapacity, the returned ID will be truncate
d. | |
| * On error, the return value is -1. | | * On error, the return value is -1. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT int32_t U_EXPORT2 | | U_DRAFT int32_t U_EXPORT2 | |
| uloc_minimizeSubtags(const char* localeID, | | uloc_minimizeSubtags(const char* localeID, | |
| char* minimizedLocaleID, | | char* minimizedLocaleID, | |
| int32_t minimizedLocaleIDCapacity, | | int32_t minimizedLocaleIDCapacity, | |
| UErrorCode* err); | | UErrorCode* err); | |
| | | | |
|
| | | /** | |
| | | * Returns a locale ID for the specified BCP47 language tag string. | |
| | | * If the specified language tag contains any ill-formed subtags, | |
| | | * the first such subtag and all following subtags are ignored. | |
| | | * <p> | |
| | | * This implements the 'Language-Tag' production of BCP47, and so | |
| | | * supports grandfathered (regular and irregular) as well as private | |
| | | * use language tags. Private use tags are represented as 'x-whatever', | |
| | | * and grandfathered tags are converted to their canonical replacements | |
| | | * where they exist. Note that a few grandfathered tags have no modern | |
| | | * replacement, these will be converted using the fallback described in | |
| | | * the first paragraph, so some information might be lost. | |
| | | * @param langtag the input BCP47 language tag. | |
| | | * @param localeID the output buffer receiving a locale ID for the | |
| | | * specified BCP47 language tag. | |
| | | * @param localeIDCapacity the size of the locale ID output buffer. | |
| | | * @param parsedLength if not NULL, succsessfully parsed length | |
| | | * for the input language tag is set. | |
| | | * @param err error information if receiving the locald ID | |
| | | * failed. | |
| | | * @return the length of the locale ID. | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | U_DRAFT int32_t U_EXPORT2 | |
| | | uloc_forLanguageTag(const char* langtag, | |
| | | char* localeID, | |
| | | int32_t localeIDCapacity, | |
| | | int32_t* parsedLength, | |
| | | UErrorCode* err); | |
| | | | |
| | | /** | |
| | | * Returns a well-formed language tag for this locale ID. | |
| | | * <p> | |
| | | * <b>Note</b>: When <code>strict</code> is FALSE, any locale | |
| | | * fields which do not satisfy the BCP47 syntax requirement will | |
| | | * be omitted from the result. When <code>strict</code> is | |
| | | * TRUE, this function sets U_ILLEGAL_ARGUMENT_ERROR to the | |
| | | * <code>err</code> if any locale fields do not satisfy the | |
| | | * BCP47 syntax requirement. | |
| | | * @param localeID the input lcoale ID | |
| | | * @param langtag the output buffer receiving BCP47 language | |
| | | * tag for the locale ID. | |
| | | * @param langtagCapacity the size of the BCP47 language tag | |
| | | * output buffer. | |
| | | * @param strict boolean value indicating if the function returns | |
| | | * an error for an ill-formed input locale ID. | |
| | | * @param err error information if receiving the language | |
| | | * tag failed. | |
| | | * @return The length of the BCP47 language tag. | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | U_DRAFT int32_t U_EXPORT2 | |
| | | uloc_toLanguageTag(const char* localeID, | |
| | | char* langtag, | |
| | | int32_t langtagCapacity, | |
| | | UBool strict, | |
| | | UErrorCode* err); | |
| | | | |
| #endif /*_ULOC*/ | | #endif /*_ULOC*/ | |
| | | | |
End of changes. 9 change blocks. |
| 8 lines changed or deleted | | 66 lines changed or added | |
|
| uniset.h | | uniset.h | |
| /* | | /* | |
| *************************************************************************** | | *************************************************************************** | |
|
| * Copyright (C) 1999-2008, International Business Machines Corporation | | * Copyright (C) 1999-2009, International Business Machines Corporation | |
| * and others. All Rights Reserved. | | * and others. All Rights Reserved. | |
| *************************************************************************** | | *************************************************************************** | |
| * Date Name Description | | * Date Name Description | |
| * 10/20/99 alan Creation. | | * 10/20/99 alan Creation. | |
| *************************************************************************** | | *************************************************************************** | |
| */ | | */ | |
| | | | |
| #ifndef UNICODESET_H | | #ifndef UNICODESET_H | |
| #define UNICODESET_H | | #define UNICODESET_H | |
| | | | |
| | | | |
| skipping to change at line 308 | | skipping to change at line 308 | |
| }; | | }; | |
| uint8_t fFlags; // Bit flag (see constants above) | | uint8_t fFlags; // Bit flag (see constants above) | |
| public: | | public: | |
| /** | | /** | |
| * Determine if this object contains a valid set. | | * Determine if this object contains a valid set. | |
| * A bogus set has no value. It is different from an empty set. | | * A bogus set has no value. It is different from an empty set. | |
| * It can be used to indicate that no set value is available. | | * It can be used to indicate that no set value is available. | |
| * | | * | |
| * @return TRUE if the set is valid, FALSE otherwise | | * @return TRUE if the set is valid, FALSE otherwise | |
| * @see setToBogus() | | * @see setToBogus() | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| inline UBool isBogus(void) const; | | inline UBool isBogus(void) const; | |
| | | | |
| /** | | /** | |
| * Make this UnicodeSet object invalid. | | * Make this UnicodeSet object invalid. | |
| * The string will test TRUE with isBogus(). | | * The string will test TRUE with isBogus(). | |
| * | | * | |
| * A bogus set has no value. It is different from an empty set. | | * A bogus set has no value. It is different from an empty set. | |
| * It can be used to indicate that no set value is available. | | * It can be used to indicate that no set value is available. | |
| * | | * | |
| * This utility function is used throughout the UnicodeSet | | * This utility function is used throughout the UnicodeSet | |
| * implementation to indicate that a UnicodeSet operation failed, | | * implementation to indicate that a UnicodeSet operation failed, | |
| * and may be used in other functions, | | * and may be used in other functions, | |
| * especially but not exclusively when such functions do not | | * especially but not exclusively when such functions do not | |
| * take a UErrorCode for simplicity. | | * take a UErrorCode for simplicity. | |
| * | | * | |
| * @see isBogus() | | * @see isBogus() | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| void setToBogus(); | | void setToBogus(); | |
| | | | |
| public: | | public: | |
| | | | |
| enum { | | enum { | |
| /** | | /** | |
| * Minimum value that can be stored in a UnicodeSet. | | * Minimum value that can be stored in a UnicodeSet. | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| | | | |
| skipping to change at line 473 | | skipping to change at line 473 | |
| | | | |
| /** | | /** | |
| * Returns the hash code value for this set. | | * Returns the hash code value for this set. | |
| * | | * | |
| * @return the hash code value for this set. | | * @return the hash code value for this set. | |
| * @see Object#hashCode() | | * @see Object#hashCode() | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| virtual int32_t hashCode(void) const; | | virtual int32_t hashCode(void) const; | |
| | | | |
|
| | | /** | |
| | | * Get a UnicodeSet pointer from a USet | |
| | | * | |
| | | * @param uset a USet (the ICU plain C type for UnicodeSet) | |
| | | * @return the corresponding UnicodeSet pointer. | |
| | | * | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | inline static UnicodeSet *fromUSet(USet *uset); | |
| | | | |
| | | /** | |
| | | * Get a UnicodeSet pointer from a const USet | |
| | | * | |
| | | * @param uset a const USet (the ICU plain C type for UnicodeSet) | |
| | | * @return the corresponding UnicodeSet pointer. | |
| | | * | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | inline static const UnicodeSet *fromUSet(const USet *uset); | |
| | | | |
| | | /** | |
| | | * Produce a USet * pointer for this UnicodeSet. | |
| | | * USet is the plain C type for UnicodeSet | |
| | | * | |
| | | * @return a USet pointer for this UnicodeSet | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | inline USet *toUSet(); | |
| | | | |
| | | /** | |
| | | * Produce a const USet * pointer for this UnicodeSet. | |
| | | * USet is the plain C type for UnicodeSet | |
| | | * | |
| | | * @return a const USet pointer for this UnicodeSet | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | inline const USet * toUSet() const; | |
| | | | |
| //---------------------------------------------------------------- | | //---------------------------------------------------------------- | |
| // Freezable API | | // Freezable API | |
| //---------------------------------------------------------------- | | //---------------------------------------------------------------- | |
| | | | |
| /** | | /** | |
| * Determines whether the set has been frozen (made immutable) or not. | | * Determines whether the set has been frozen (made immutable) or not. | |
| * See the ICU4J Freezable interface for details. | | * See the ICU4J Freezable interface for details. | |
| * @return TRUE/FALSE for whether the set has been frozen | | * @return TRUE/FALSE for whether the set has been frozen | |
| * @see freeze | | * @see freeze | |
| * @see cloneAsThawed | | * @see cloneAsThawed | |
| | | | |
| skipping to change at line 1002 | | skipping to change at line 1040 | |
| * @param s the source string | | * @param s the source string | |
| * @return this object, for chaining | | * @return this object, for chaining | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| UnicodeSet& add(const UnicodeString& s); | | UnicodeSet& add(const UnicodeString& s); | |
| | | | |
| private: | | private: | |
| /** | | /** | |
| * @return a code point IF the string consists of a single one. | | * @return a code point IF the string consists of a single one. | |
| * otherwise returns -1. | | * otherwise returns -1. | |
|
| * @param string to test | | * @param s string to test | |
| */ | | */ | |
| static int32_t getSingleCP(const UnicodeString& s); | | static int32_t getSingleCP(const UnicodeString& s); | |
| | | | |
| void _add(const UnicodeString& s); | | void _add(const UnicodeString& s); | |
| | | | |
| public: | | public: | |
| /** | | /** | |
| * Adds each of the characters in this string to the set. Thus "ch" =>
{"c", "h"} | | * Adds each of the characters in this string to the set. Thus "ch" =>
{"c", "h"} | |
| * If this set already any particular character, it has no effect on th
at character. | | * If this set already any particular character, it has no effect on th
at character. | |
| * A frozen set will not be modified. | | * A frozen set will not be modified. | |
| | | | |
| skipping to change at line 1254 | | skipping to change at line 1292 | |
| * (Here foldCase(x) refers to the operation u_strFoldCase, and a | | * (Here foldCase(x) refers to the operation u_strFoldCase, and a | |
| * == b denotes that the contents are the same, not pointer | | * == b denotes that the contents are the same, not pointer | |
| * comparison.) | | * comparison.) | |
| * | | * | |
| * A frozen set will not be modified. | | * A frozen set will not be modified. | |
| * | | * | |
| * @param attribute bitmask for attributes to close over. | | * @param attribute bitmask for attributes to close over. | |
| * Currently only the USET_CASE bit is supported. Any undefined bits | | * Currently only the USET_CASE bit is supported. Any undefined bits | |
| * are ignored. | | * are ignored. | |
| * @return a reference to this set. | | * @return a reference to this set. | |
|
| * @internal | | * @draft ICU 4.2 | |
| */ | | */ | |
| UnicodeSet& closeOver(int32_t attribute); | | UnicodeSet& closeOver(int32_t attribute); | |
| | | | |
| /** | | /** | |
| * Remove all strings from this set. | | * Remove all strings from this set. | |
| * | | * | |
| * @return a reference to this set. | | * @return a reference to this set. | |
|
| * @internal | | * @draft ICU 4.2 | |
| */ | | */ | |
| virtual UnicodeSet &removeAllStrings(); | | virtual UnicodeSet &removeAllStrings(); | |
| | | | |
| /** | | /** | |
| * Iteration method that returns the number of ranges contained in | | * Iteration method that returns the number of ranges contained in | |
| * this set. | | * this set. | |
| * @see #getRangeStart | | * @see #getRangeStart | |
| * @see #getRangeEnd | | * @see #getRangeEnd | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| | | | |
| skipping to change at line 1562 | | skipping to change at line 1600 | |
| } | | } | |
| | | | |
| inline UBool UnicodeSet::containsSome(const UnicodeString& s) const { | | inline UBool UnicodeSet::containsSome(const UnicodeString& s) const { | |
| return !containsNone(s); | | return !containsNone(s); | |
| } | | } | |
| | | | |
| inline UBool UnicodeSet::isBogus() const { | | inline UBool UnicodeSet::isBogus() const { | |
| return (UBool)(fFlags & kIsBogus); | | return (UBool)(fFlags & kIsBogus); | |
| } | | } | |
| | | | |
|
| | | inline UnicodeSet *UnicodeSet::fromUSet(USet *uset) { | |
| | | return reinterpret_cast<UnicodeSet *>(uset); | |
| | | } | |
| | | | |
| | | inline const UnicodeSet *UnicodeSet::fromUSet(const USet *uset) { | |
| | | return reinterpret_cast<const UnicodeSet *>(uset); | |
| | | } | |
| | | | |
| | | inline USet *UnicodeSet::toUSet() { | |
| | | return reinterpret_cast<USet *>(this); | |
| | | } | |
| | | | |
| | | inline const USet *UnicodeSet::toUSet() const { | |
| | | return reinterpret_cast<const USet *>(this); | |
| | | } | |
| | | | |
| U_NAMESPACE_END | | U_NAMESPACE_END | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 8 change blocks. |
| 6 lines changed or deleted | | 60 lines changed or added | |
|
| unistr.h | | unistr.h | |
| /* | | /* | |
| ********************************************************************** | | ********************************************************************** | |
|
| * Copyright (C) 1998-2008, International Business Machines | | * Copyright (C) 1998-2009, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| ********************************************************************** | | ********************************************************************** | |
| * | | * | |
| * File unistr.h | | * File unistr.h | |
| * | | * | |
| * Modification History: | | * Modification History: | |
| * | | * | |
| * Date Name Description | | * Date Name Description | |
| * 09/25/98 stephen Creation. | | * 09/25/98 stephen Creation. | |
| * 11/11/98 stephen Changed per 11/9 code review. | | * 11/11/98 stephen Changed per 11/9 code review. | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| */ | | */ | |
| | | | |
| #ifndef UNISTR_H | | #ifndef UNISTR_H | |
| #define UNISTR_H | | #define UNISTR_H | |
| | | | |
| /** | | /** | |
| * \file | | * \file | |
| * \brief C++ API: Unicode String | | * \brief C++ API: Unicode String | |
| */ | | */ | |
| | | | |
|
| | | #include "unicode/utypes.h" | |
| #include "unicode/rep.h" | | #include "unicode/rep.h" | |
|
| | | #include "unicode/std_string.h" | |
| | | #include "unicode/stringpiece.h" | |
| | | #include "unicode/bytestream.h" | |
| | | | |
| struct UConverter; // unicode/ucnv.h | | struct UConverter; // unicode/ucnv.h | |
| class StringThreadTest; | | class StringThreadTest; | |
| | | | |
| #ifndef U_COMPARE_CODE_POINT_ORDER | | #ifndef U_COMPARE_CODE_POINT_ORDER | |
| /* see also ustring.h and unorm.h */ | | /* see also ustring.h and unorm.h */ | |
| /** | | /** | |
| * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: | | * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: | |
| * Compare strings in code point order instead of code unit order. | | * Compare strings in code point order instead of code unit order. | |
| * @stable ICU 2.2 | | * @stable ICU 2.2 | |
| | | | |
| skipping to change at line 1445 | | skipping to change at line 1449 | |
| * @param inv Signature-distinguishing paramater, use US_INV. | | * @param inv Signature-distinguishing paramater, use US_INV. | |
| * @return the output string length, not including the terminating NUL | | * @return the output string length, not including the terminating NUL | |
| * @stable ICU 3.2 | | * @stable ICU 3.2 | |
| */ | | */ | |
| int32_t extract(int32_t start, | | int32_t extract(int32_t start, | |
| int32_t startLength, | | int32_t startLength, | |
| char *target, | | char *target, | |
| int32_t targetCapacity, | | int32_t targetCapacity, | |
| enum EInvariant inv) const; | | enum EInvariant inv) const; | |
| | | | |
|
| | | #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION | |
| | | | |
| | | /** | |
| | | * Copy the characters in the range | |
| | | * [<tt>start</TT>, <tt>start + length</TT>) into an array of characters | |
| | | * in the platform's default codepage. | |
| | | * This function does not write any more than <code>targetLength</code> | |
| | | * characters but returns the length of the entire output string | |
| | | * so that one can allocate a larger buffer and call the function again | |
| | | * if necessary. | |
| | | * The output string is NUL-terminated if possible. | |
| | | * | |
| | | * @param start offset of first character which will be copied | |
| | | * @param startLength the number of characters to extract | |
| | | * @param target the target buffer for extraction | |
| | | * @param targetLength the length of the target buffer | |
| | | * If <TT>target</TT> is NULL, then the number of bytes required for | |
| | | * <TT>target</TT> is returned. | |
| | | * @return the output string length, not including the terminating NUL | |
| | | * @stable ICU 2.0 | |
| | | */ | |
| | | int32_t extract(int32_t start, | |
| | | int32_t startLength, | |
| | | char *target, | |
| | | uint32_t targetLength) const; | |
| | | | |
| | | #endif | |
| | | | |
| #if !UCONFIG_NO_CONVERSION | | #if !UCONFIG_NO_CONVERSION | |
| | | | |
| /** | | /** | |
| * Copy the characters in the range | | * Copy the characters in the range | |
| * [<tt>start</TT>, <tt>start + length</TT>) into an array of characters | | * [<tt>start</TT>, <tt>start + length</TT>) into an array of characters | |
| * in a specified codepage. | | * in a specified codepage. | |
| * The output string is NUL-terminated. | | * The output string is NUL-terminated. | |
| * | | * | |
| * Recommendation: For invariant-character strings use | | * Recommendation: For invariant-character strings use | |
| * extract(int32_t start, int32_t length, char *target, int32_t targetCap
acity, enum EInvariant inv) const | | * extract(int32_t start, int32_t length, char *target, int32_t targetCap
acity, enum EInvariant inv) const | |
| | | | |
| skipping to change at line 1510 | | skipping to change at line 1542 | |
| * subset ("invariant characters") of the platform encoding. See utypes.h
. | | * subset ("invariant characters") of the platform encoding. See utypes.h
. | |
| * If <TT>target</TT> is NULL, then the number of bytes required for | | * If <TT>target</TT> is NULL, then the number of bytes required for | |
| * <TT>target</TT> is returned. | | * <TT>target</TT> is returned. | |
| * @return the output string length, not including the terminating NUL | | * @return the output string length, not including the terminating NUL | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| int32_t extract(int32_t start, | | int32_t extract(int32_t start, | |
| int32_t startLength, | | int32_t startLength, | |
| char *target, | | char *target, | |
| uint32_t targetLength, | | uint32_t targetLength, | |
|
| const char *codepage = 0) const; | | const char *codepage) const; | |
| | | | |
| /** | | /** | |
| * Convert the UnicodeString into a codepage string using an existing UCo
nverter. | | * Convert the UnicodeString into a codepage string using an existing UCo
nverter. | |
| * The output string is NUL-terminated if possible. | | * The output string is NUL-terminated if possible. | |
| * | | * | |
| * This function avoids the overhead of opening and closing a converter i
f | | * This function avoids the overhead of opening and closing a converter i
f | |
| * multiple strings are extracted. | | * multiple strings are extracted. | |
| * | | * | |
| * @param dest destination string buffer, can be NULL if destCapacity==0 | | * @param dest destination string buffer, can be NULL if destCapacity==0 | |
| * @param destCapacity the number of chars available at dest | | * @param destCapacity the number of chars available at dest | |
| | | | |
| skipping to change at line 1535 | | skipping to change at line 1567 | |
| * if the length is greater than destCapacity, then the string wi
ll not fit | | * if the length is greater than destCapacity, then the string wi
ll not fit | |
| * and a buffer of the indicated length would need to be passed i
n | | * and a buffer of the indicated length would need to be passed i
n | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| int32_t extract(char *dest, int32_t destCapacity, | | int32_t extract(char *dest, int32_t destCapacity, | |
| UConverter *cnv, | | UConverter *cnv, | |
| UErrorCode &errorCode) const; | | UErrorCode &errorCode) const; | |
| | | | |
| #endif | | #endif | |
| | | | |
|
| | | /** | |
| | | * Convert the UnicodeString to UTF-8 and write the result | |
| | | * to a ByteSink. This is called by toUTF8String(). | |
| | | * Unpaired surrogates are replaced with U+FFFD. | |
| | | * Calls u_strToUTF8WithSub(). | |
| | | * | |
| | | * @param sink A ByteSink to which the UTF-8 version of the string is wri | |
| | | tten. | |
| | | * @draft ICU 4.2 | |
| | | * @see toUTF8String | |
| | | */ | |
| | | void toUTF8(ByteSink &sink) const; | |
| | | | |
| | | #if U_HAVE_STD_STRING | |
| | | | |
| | | /** | |
| | | * Convert the UnicodeString to UTF-8 and append the result | |
| | | * to a standard string. | |
| | | * Unpaired surrogates are replaced with U+FFFD. | |
| | | * Calls toUTF8(). | |
| | | * | |
| | | * @param A standard string (or a compatible object) | |
| | | * to which the UTF-8 version of the string is appended. | |
| | | * @return The string object. | |
| | | * @draft ICU 4.2 | |
| | | * @see toUTF8 | |
| | | */ | |
| | | template<typename StringClass> | |
| | | StringClass &toUTF8String(StringClass &result) const { | |
| | | StringByteSink<StringClass> sbs(&result); | |
| | | toUTF8(sbs); | |
| | | return result; | |
| | | } | |
| | | | |
| | | #endif | |
| | | | |
| | | /** | |
| | | * Convert the UnicodeString to UTF-32. | |
| | | * Unpaired surrogates are replaced with U+FFFD. | |
| | | * Calls u_strToUTF32WithSub(). | |
| | | * | |
| | | * @param utf32 destination string buffer, can be NULL if capacity==0 | |
| | | * @param capacity the number of UChar32s available at utf32 | |
| | | * @param errorCode Standard ICU error code. Its input value must | |
| | | * pass the U_SUCCESS() test, or else the function retur | |
| | | ns | |
| | | * immediately. Check for U_FAILURE() on output or use w | |
| | | ith | |
| | | * function chaining. (See User Guide for details.) | |
| | | * @return The length of the UTF-32 string. | |
| | | * @see fromUTF32 | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | int32_t toUTF32(UChar32 *utf32, int32_t capacity, UErrorCode &errorCode) | |
| | | const; | |
| | | | |
| /* Length operations */ | | /* Length operations */ | |
| | | | |
| /** | | /** | |
| * Return the length of the UnicodeString object. | | * Return the length of the UnicodeString object. | |
| * The length is the number of UChar code units are in the UnicodeString. | | * The length is the number of UChar code units are in the UnicodeString. | |
| * If you want the number of code points, please use countChar32(). | | * If you want the number of code points, please use countChar32(). | |
| * @return the length of the UnicodeString object | | * @return the length of the UnicodeString object | |
| * @see countChar32 | | * @see countChar32 | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| | | | |
| skipping to change at line 2749 | | skipping to change at line 2833 | |
| * The extract(UChar *dst) function detects whether the dst pointer is th
e same | | * The extract(UChar *dst) function detects whether the dst pointer is th
e same | |
| * as the string buffer itself and will in this case not copy the content
s. | | * as the string buffer itself and will in this case not copy the content
s. | |
| * | | * | |
| * @param buffer The characters to alias for the UnicodeString. | | * @param buffer The characters to alias for the UnicodeString. | |
| * @param buffLength The number of Unicode characters in <code>buffer</co
de> to alias. | | * @param buffLength The number of Unicode characters in <code>buffer</co
de> to alias. | |
| * @param buffCapacity The size of <code>buffer</code> in UChars. | | * @param buffCapacity The size of <code>buffer</code> in UChars. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| UnicodeString(UChar *buffer, int32_t buffLength, int32_t buffCapacity); | | UnicodeString(UChar *buffer, int32_t buffLength, int32_t buffCapacity); | |
| | | | |
|
| | | #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION | |
| | | | |
| | | /** | |
| | | * char* constructor. | |
| | | * @param codepageData an array of bytes, null-terminated, | |
| | | * in the platform's default codepage. | |
| | | * @stable ICU 2.0 | |
| | | */ | |
| | | UnicodeString(const char *codepageData); | |
| | | | |
| | | /** | |
| | | * char* constructor. | |
| | | * @param codepageData an array of bytes in the platform's default codepa | |
| | | ge. | |
| | | * @param dataLength The number of bytes in <TT>codepageData</TT>. | |
| | | * @stable ICU 2.0 | |
| | | */ | |
| | | UnicodeString(const char *codepageData, int32_t dataLength); | |
| | | | |
| | | #endif | |
| | | | |
| #if !UCONFIG_NO_CONVERSION | | #if !UCONFIG_NO_CONVERSION | |
| | | | |
| /** | | /** | |
| * char* constructor. | | * char* constructor. | |
| * @param codepageData an array of bytes, null-terminated | | * @param codepageData an array of bytes, null-terminated | |
| * @param codepage the encoding of <TT>codepageData</TT>. The special | | * @param codepage the encoding of <TT>codepageData</TT>. The special | |
| * value 0 for <TT>codepage</TT> indicates that the text is in the | | * value 0 for <TT>codepage</TT> indicates that the text is in the | |
| * platform's default codepage. | | * platform's default codepage. | |
| * | | * | |
| * If <code>codepage</code> is an empty string (<code>""</code>), | | * If <code>codepage</code> is an empty string (<code>""</code>), | |
| * then a simple conversion is performed on the codepage-invariant | | * then a simple conversion is performed on the codepage-invariant | |
| * subset ("invariant characters") of the platform encoding. See utypes.h
. | | * subset ("invariant characters") of the platform encoding. See utypes.h
. | |
| * Recommendation: For invariant-character strings use the constructor | | * Recommendation: For invariant-character strings use the constructor | |
| * UnicodeString(const char *src, int32_t length, enum EInvariant inv) | | * UnicodeString(const char *src, int32_t length, enum EInvariant inv) | |
| * because it avoids object code dependencies of UnicodeString on | | * because it avoids object code dependencies of UnicodeString on | |
| * the conversion code. | | * the conversion code. | |
| * | | * | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
|
| UnicodeString(const char *codepageData, | | UnicodeString(const char *codepageData, const char *codepage); | |
| const char *codepage = 0); | | | |
| | | | |
| /** | | /** | |
| * char* constructor. | | * char* constructor. | |
| * @param codepageData an array of bytes. | | * @param codepageData an array of bytes. | |
| * @param dataLength The number of bytes in <TT>codepageData</TT>. | | * @param dataLength The number of bytes in <TT>codepageData</TT>. | |
| * @param codepage the encoding of <TT>codepageData</TT>. The special | | * @param codepage the encoding of <TT>codepageData</TT>. The special | |
| * value 0 for <TT>codepage</TT> indicates that the text is in the | | * value 0 for <TT>codepage</TT> indicates that the text is in the | |
| * platform's default codepage. | | * platform's default codepage. | |
| * If <code>codepage</code> is an empty string (<code>""</code>), | | * If <code>codepage</code> is an empty string (<code>""</code>), | |
| * then a simple conversion is performed on the codepage-invariant | | * then a simple conversion is performed on the codepage-invariant | |
| * subset ("invariant characters") of the platform encoding. See utypes.h
. | | * subset ("invariant characters") of the platform encoding. See utypes.h
. | |
| * Recommendation: For invariant-character strings use the constructor | | * Recommendation: For invariant-character strings use the constructor | |
| * UnicodeString(const char *src, int32_t length, enum EInvariant inv) | | * UnicodeString(const char *src, int32_t length, enum EInvariant inv) | |
| * because it avoids object code dependencies of UnicodeString on | | * because it avoids object code dependencies of UnicodeString on | |
| * the conversion code. | | * the conversion code. | |
| * | | * | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
|
| UnicodeString(const char *codepageData, | | UnicodeString(const char *codepageData, int32_t dataLength, const char *c | |
| int32_t dataLength, | | odepage); | |
| const char *codepage = 0); | | | |
| | | | |
| /** | | /** | |
| * char * / UConverter constructor. | | * char * / UConverter constructor. | |
| * This constructor uses an existing UConverter object to | | * This constructor uses an existing UConverter object to | |
| * convert the codepage string to Unicode and construct a UnicodeString | | * convert the codepage string to Unicode and construct a UnicodeString | |
| * from that. | | * from that. | |
| * | | * | |
| * The converter is reset at first. | | * The converter is reset at first. | |
| * If the error code indicates a failure before this constructor is calle
d, | | * If the error code indicates a failure before this constructor is calle
d, | |
| * or if an error occurs during conversion or construction, | | * or if an error occurs during conversion or construction, | |
| | | | |
| skipping to change at line 2893 | | skipping to change at line 2994 | |
| * @see getDynamicClassID | | * @see getDynamicClassID | |
| * @stable ICU 2.6 | | * @stable ICU 2.6 | |
| */ | | */ | |
| virtual Replaceable *clone() const; | | virtual Replaceable *clone() const; | |
| | | | |
| /** Destructor. | | /** Destructor. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| virtual ~UnicodeString(); | | virtual ~UnicodeString(); | |
| | | | |
|
| | | /** | |
| | | * Create a UnicodeString from a UTF-8 string. | |
| | | * Illegal input is replaced with U+FFFD. Otherwise, errors result in a b | |
| | | ogus string. | |
| | | * Calls u_strFromUTF8WithSub(). | |
| | | * | |
| | | * @param utf8 UTF-8 input string. | |
| | | * Note that a StringPiece can be implicitly constructed | |
| | | * from a std::string or a NUL-terminated const char * string | |
| | | . | |
| | | * @return A UnicodeString with equivalent UTF-16 contents. | |
| | | * @see toUTF8 | |
| | | * @see toUTF8String | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | static UnicodeString fromUTF8(const StringPiece &utf8); | |
| | | | |
| | | /** | |
| | | * Create a UnicodeString from a UTF-32 string. | |
| | | * Illegal input is replaced with U+FFFD. Otherwise, errors result in a b | |
| | | ogus string. | |
| | | * Calls u_strFromUTF32WithSub(). | |
| | | * | |
| | | * @param utf32 UTF-32 input string. Must not be NULL. | |
| | | * @param length Length of the input string, or -1 if NUL-terminated. | |
| | | * @return A UnicodeString with equivalent UTF-16 contents. | |
| | | * @see toUTF32 | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | static UnicodeString fromUTF32(const UChar32 *utf32, int32_t length); | |
| | | | |
| /* Miscellaneous operations */ | | /* Miscellaneous operations */ | |
| | | | |
| /** | | /** | |
| * Unescape a string of characters and return a string containing | | * Unescape a string of characters and return a string containing | |
| * the result. The following escape sequences are recognized: | | * the result. The following escape sequences are recognized: | |
| * | | * | |
| * \\uhhhh 4 hex digits; h in [0-9A-Fa-f] | | * \\uhhhh 4 hex digits; h in [0-9A-Fa-f] | |
| * \\Uhhhhhhhh 8 hex digits | | * \\Uhhhhhhhh 8 hex digits | |
| * \\xhh 1-2 hex digits | | * \\xhh 1-2 hex digits | |
| * \\ooo 1-3 octal digits; o in [0-7] | | * \\ooo 1-3 octal digits; o in [0-7] | |
| | | | |
| skipping to change at line 2992 | | skipping to change at line 3121 | |
| virtual UChar getCharAt(int32_t offset) const; | | virtual UChar getCharAt(int32_t offset) const; | |
| | | | |
| /** | | /** | |
| * The change in Replaceable to use virtual getChar32At() allows | | * The change in Replaceable to use virtual getChar32At() allows | |
| * UnicodeString::char32At() to be inline again (see jitterbug 709). | | * UnicodeString::char32At() to be inline again (see jitterbug 709). | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| virtual UChar32 getChar32At(int32_t offset) const; | | virtual UChar32 getChar32At(int32_t offset) const; | |
| | | | |
| private: | | private: | |
|
| | | // For char* constructors. Could be made public. | |
| | | UnicodeString &setToUTF8(const StringPiece &utf8); | |
| | | // For extract(char*). | |
| | | // We could make a toUTF8(target, capacity, errorCode) public but not | |
| | | // this version: New API will be cleaner if we make callers create substr | |
| | | ings | |
| | | // rather than having start+length on every method, | |
| | | // and it should take a UErrorCode&. | |
| | | int32_t | |
| | | toUTF8(int32_t start, int32_t len, | |
| | | char *target, int32_t capacity) const; | |
| | | | |
| inline int8_t | | inline int8_t | |
| doCompare(int32_t start, | | doCompare(int32_t start, | |
| int32_t length, | | int32_t length, | |
| const UnicodeString& srcText, | | const UnicodeString& srcText, | |
| int32_t srcStart, | | int32_t srcStart, | |
| int32_t srcLength) const; | | int32_t srcLength) const; | |
| | | | |
| int8_t doCompare(int32_t start, | | int8_t doCompare(int32_t start, | |
| int32_t length, | | int32_t length, | |
| | | | |
| skipping to change at line 4015 | | skipping to change at line 4154 | |
| fUnion.fFields.fCapacity = capacity; | | fUnion.fFields.fCapacity = capacity; | |
| } | | } | |
| | | | |
| inline const UChar * | | inline const UChar * | |
| UnicodeString::getTerminatedBuffer() { | | UnicodeString::getTerminatedBuffer() { | |
| if(!isWritable()) { | | if(!isWritable()) { | |
| return 0; | | return 0; | |
| } else { | | } else { | |
| UChar *array = getArrayStart(); | | UChar *array = getArrayStart(); | |
| int32_t len = length(); | | int32_t len = length(); | |
|
| | | #ifndef U_VALGRIND | |
| if(len < getCapacity() && array[len] == 0) { | | if(len < getCapacity() && array[len] == 0) { | |
| return array; | | return array; | |
|
| } else if(cloneArrayIfNeeded(len+1)) { | | } | |
| | | #endif | |
| | | if(cloneArrayIfNeeded(len+1)) { | |
| array = getArrayStart(); | | array = getArrayStart(); | |
| array[len] = 0; | | array[len] = 0; | |
| return array; | | return array; | |
| } else { | | } else { | |
| return 0; | | return 0; | |
| } | | } | |
| } | | } | |
| } | | } | |
| | | | |
| inline UnicodeString& | | inline UnicodeString& | |
| | | | |
End of changes. 13 change blocks. |
| 8 lines changed or deleted | | 160 lines changed or added | |
|
| uregex.h | | uregex.h | |
| /* | | /* | |
| ********************************************************************** | | ********************************************************************** | |
|
| * Copyright (C) 2004-2008, International Business Machines | | * Copyright (C) 2004-2009, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| ********************************************************************** | | ********************************************************************** | |
| * file name: regex.h | | * file name: regex.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 2004mar09 | | * created on: 2004mar09 | |
| * created by: Andy Heninger | | * created by: Andy Heninger | |
| * | | * | |
| * ICU Regular Expressions, API for C | | * ICU Regular Expressions, API for C | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| #define UREGEX_H | | #define UREGEX_H | |
| | | | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| | | | |
| #if !UCONFIG_NO_REGULAR_EXPRESSIONS | | #if !UCONFIG_NO_REGULAR_EXPRESSIONS | |
| | | | |
| #include "unicode/parseerr.h" | | #include "unicode/parseerr.h" | |
| | | | |
| struct URegularExpression; | | struct URegularExpression; | |
| /** | | /** | |
|
| * Structure represeting a compiled regular rexpression, plus the results | | * Structure representing a compiled regular rexpression, plus the results | |
| * of a match operation. | | * of a match operation. | |
| * @stable ICU 3.0 | | * @stable ICU 3.0 | |
| */ | | */ | |
| typedef struct URegularExpression URegularExpression; | | typedef struct URegularExpression URegularExpression; | |
| | | | |
| /** | | /** | |
| * Constants for Regular Expression Match Modes. | | * Constants for Regular Expression Match Modes. | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| typedef enum URegexpFlag{ | | typedef enum URegexpFlag{ | |
| | | | |
| skipping to change at line 71 | | skipping to change at line 71 | |
| | | | |
| /** If set, treat the entire pattern as a literal string. | | /** If set, treat the entire pattern as a literal string. | |
| * Metacharacters or escape sequences in the input sequence will be g
iven | | * Metacharacters or escape sequences in the input sequence will be g
iven | |
| * no special meaning. | | * no special meaning. | |
| * | | * | |
| * The flags CASE_INSENSITIVE and UNICODE_CASE retain their impact | | * The flags CASE_INSENSITIVE and UNICODE_CASE retain their impact | |
| * on matching when used in conjunction with this flag. | | * on matching when used in conjunction with this flag. | |
| * The other flags become superfluous. | | * The other flags become superfluous. | |
| * TODO: say which escapes are still handled; anything Java does | | * TODO: say which escapes are still handled; anything Java does | |
| * early (\\u) we should still do. | | * early (\\u) we should still do. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UREGEX_LITERAL = 16, | | UREGEX_LITERAL = 16, | |
| | | | |
| /** Control behavior of "$" and "^" | | /** Control behavior of "$" and "^" | |
| * If set, recognize line terminators within string, | | * If set, recognize line terminators within string, | |
| * otherwise, match only at start and end of input string. | | * otherwise, match only at start and end of input string. | |
| * @stable ICU 2.4 */ | | * @stable ICU 2.4 */ | |
| UREGEX_MULTILINE = 8, | | UREGEX_MULTILINE = 8, | |
| | | | |
| /** Unix-only line endings. | | /** Unix-only line endings. | |
| * When this mode is enabled, only \\u000a is recognized as a line e
nding | | * When this mode is enabled, only \\u000a is recognized as a line e
nding | |
| * in the behavior of ., ^, and $. | | * in the behavior of ., ^, and $. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UREGEX_UNIX_LINES = 1, | | UREGEX_UNIX_LINES = 1, | |
| | | | |
| /** Unicode word boundaries. | | /** Unicode word boundaries. | |
| * If set, \b uses the Unicode TR 29 definition of word boundaries
. | | * If set, \b uses the Unicode TR 29 definition of word boundaries
. | |
| * Warning: Unicode word boundaries are quite different from | | * Warning: Unicode word boundaries are quite different from | |
| * traditional regular expression word boundaries. See | | * traditional regular expression word boundaries. See | |
| * http://unicode.org/reports/tr29/#Word_Boundaries | | * http://unicode.org/reports/tr29/#Word_Boundaries | |
| * @stable ICU 2.8 | | * @stable ICU 2.8 | |
| */ | | */ | |
| UREGEX_UWORD = 256, | | UREGEX_UWORD = 256, | |
| | | | |
| /** Error on Unrecognized backslash escapes. | | /** Error on Unrecognized backslash escapes. | |
| * If set, fail with an error on patterns that contain | | * If set, fail with an error on patterns that contain | |
| * backslash-escaped ASCII letters without a known specail | | * backslash-escaped ASCII letters without a known specail | |
| * meaning. If this flag is not set, these | | * meaning. If this flag is not set, these | |
| * escaped letters represent themselves. | | * escaped letters represent themselves. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| UREGEX_ERROR_ON_UNKNOWN_ESCAPES = 512 | | UREGEX_ERROR_ON_UNKNOWN_ESCAPES = 512 | |
| | | | |
| } URegexpFlag; | | } URegexpFlag; | |
| | | | |
| /** | | /** | |
| * Open (compile) an ICU regular expression. Compiles the regular expres
sion in | | * Open (compile) an ICU regular expression. Compiles the regular expres
sion in | |
| * string form into an internal representation using the specified match
mode flags. | | * string form into an internal representation using the specified match
mode flags. | |
| * The resulting regular expression handle can then be used to perform va
rious | | * The resulting regular expression handle can then be used to perform va
rious | |
| * matching operations. | | * matching operations. | |
| | | | |
| skipping to change at line 478 | | skipping to change at line 478 | |
| * and useAnchoringBounds), certain constructs such as anchors may behave
differently | | * and useAnchoringBounds), certain constructs such as anchors may behave
differently | |
| * at or around the boundaries of the region | | * at or around the boundaries of the region | |
| * | | * | |
| * The function will fail if start is greater than limit, or if either ind
ex | | * The function will fail if start is greater than limit, or if either ind
ex | |
| * is less than zero or greater than the length of the string being match
ed. | | * is less than zero or greater than the length of the string being match
ed. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param regionStart The index to begin searches at. | | * @param regionStart The index to begin searches at. | |
| * @param regionLimit The index to end searches at (exclusive). | | * @param regionLimit The index to end searches at (exclusive). | |
| * @param status A pointer to a UErrorCode to receive any errors. | | * @param status A pointer to a UErrorCode to receive any errors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT void U_EXPORT2 | | U_DRAFT void U_EXPORT2 | |
| uregex_setRegion(URegularExpression *regexp, | | uregex_setRegion(URegularExpression *regexp, | |
| int32_t regionStart, | | int32_t regionStart, | |
| int32_t regionLimit, | | int32_t regionLimit, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Reports the start index of the matching region. Any matches found are l
imited to | | * Reports the start index of the matching region. Any matches found are l
imited to | |
| * to the region bounded by regionStart (inclusive) and regionEnd (exclusi
ve). | | * to the region bounded by regionStart (inclusive) and regionEnd (exclusi
ve). | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param status A pointer to a UErrorCode to receive any errors. | | * @param status A pointer to a UErrorCode to receive any errors. | |
| * @return The starting index of this matcher's region. | | * @return The starting index of this matcher's region. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT int32_t U_EXPORT2 | | U_DRAFT int32_t U_EXPORT2 | |
| uregex_regionStart(const URegularExpression *regexp, | | uregex_regionStart(const URegularExpression *regexp, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Reports the end index (exclusive) of the matching region for this URegu
larExpression. | | * Reports the end index (exclusive) of the matching region for this URegu
larExpression. | |
| * Any matches found are limited to to the region bounded by regionStart (
inclusive) | | * Any matches found are limited to to the region bounded by regionStart (
inclusive) | |
| * and regionEnd (exclusive). | | * and regionEnd (exclusive). | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param status A pointer to a UErrorCode to receive any errors. | | * @param status A pointer to a UErrorCode to receive any errors. | |
| * @return The ending point of this matcher's region. | | * @return The ending point of this matcher's region. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT int32_t U_EXPORT2 | | U_DRAFT int32_t U_EXPORT2 | |
| uregex_regionEnd(const URegularExpression *regexp, | | uregex_regionEnd(const URegularExpression *regexp, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Queries the transparency of region bounds for this URegularExpression. | | * Queries the transparency of region bounds for this URegularExpression. | |
| * See useTransparentBounds for a description of transparent and opaque bo
unds. | | * See useTransparentBounds for a description of transparent and opaque bo
unds. | |
| * By default, matching boundaries are opaque. | | * By default, matching boundaries are opaque. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param status A pointer to a UErrorCode to receive any errors. | | * @param status A pointer to a UErrorCode to receive any errors. | |
| * @return TRUE if this matcher is using opaque bounds, false if it is not
. | | * @return TRUE if this matcher is using opaque bounds, false if it is not
. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT UBool U_EXPORT2 | | U_DRAFT UBool U_EXPORT2 | |
| uregex_hasTransparentBounds(const URegularExpression *regexp, | | uregex_hasTransparentBounds(const URegularExpression *regexp, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Sets the transparency of region bounds for this URegularExpression. | | * Sets the transparency of region bounds for this URegularExpression. | |
| * Invoking this function with an argument of TRUE will set matches to use
transparent bounds. | | * Invoking this function with an argument of TRUE will set matches to use
transparent bounds. | |
| * If the boolean argument is FALSE, then opaque bounds will be used. | | * If the boolean argument is FALSE, then opaque bounds will be used. | |
| * | | * | |
| | | | |
| skipping to change at line 544 | | skipping to change at line 544 | |
| * see text beyond the boundaries of the region while checking for a match
. | | * see text beyond the boundaries of the region while checking for a match
. | |
| * | | * | |
| * With opaque bounds, no text outside of the matching region is visible t
o lookahead, | | * With opaque bounds, no text outside of the matching region is visible t
o lookahead, | |
| * lookbehind, and boundary matching constructs. | | * lookbehind, and boundary matching constructs. | |
| * | | * | |
| * By default, opaque bounds are used. | | * By default, opaque bounds are used. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param b TRUE for transparent bounds; FALSE for opaque bounds | | * @param b TRUE for transparent bounds; FALSE for opaque bounds | |
| * @param status A pointer to a UErrorCode to receive any errors. | | * @param status A pointer to a UErrorCode to receive any errors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| **/ | | **/ | |
| U_DRAFT void U_EXPORT2 | | U_DRAFT void U_EXPORT2 | |
| uregex_useTransparentBounds(URegularExpression *regexp, | | uregex_useTransparentBounds(URegularExpression *regexp, | |
| UBool b, | | UBool b, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Return true if this URegularExpression is using anchoring bounds. | | * Return true if this URegularExpression is using anchoring bounds. | |
| * By default, anchoring region bounds are used. | | * By default, anchoring region bounds are used. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param status A pointer to a UErrorCode to receive any errors. | | * @param status A pointer to a UErrorCode to receive any errors. | |
| * @return TRUE if this matcher is using anchoring bounds. | | * @return TRUE if this matcher is using anchoring bounds. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT UBool U_EXPORT2 | | U_DRAFT UBool U_EXPORT2 | |
| uregex_hasAnchoringBounds(const URegularExpression *regexp, | | uregex_hasAnchoringBounds(const URegularExpression *regexp, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Set whether this URegularExpression is using Anchoring Bounds for its r
egion. | | * Set whether this URegularExpression is using Anchoring Bounds for its r
egion. | |
| * With anchoring bounds, pattern anchors such as ^ and $ will match at th
e start | | * With anchoring bounds, pattern anchors such as ^ and $ will match at th
e start | |
| * and end of the region. Without Anchoring Bounds, anchors will only mat
ch at | | * and end of the region. Without Anchoring Bounds, anchors will only mat
ch at | |
| * the positions they would in the complete text. | | * the positions they would in the complete text. | |
| * | | * | |
| * Anchoring Bounds are the default for regions. | | * Anchoring Bounds are the default for regions. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param b TRUE if to enable anchoring bounds; FALSE to disable them
. | | * @param b TRUE if to enable anchoring bounds; FALSE to disable them
. | |
| * @param status A pointer to a UErrorCode to receive any errors. | | * @param status A pointer to a UErrorCode to receive any errors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT void U_EXPORT2 | | U_DRAFT void U_EXPORT2 | |
| uregex_useAnchoringBounds(URegularExpression *regexp, | | uregex_useAnchoringBounds(URegularExpression *regexp, | |
| UBool b, | | UBool b, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Return TRUE if the most recent matching operation touched the | | * Return TRUE if the most recent matching operation touched the | |
| * end of the text being processed. In this case, additional input text
could | | * end of the text being processed. In this case, additional input text
could | |
| * change the results of that match. | | * change the results of that match. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param status A pointer to a UErrorCode to receive any errors. | | * @param status A pointer to a UErrorCode to receive any errors. | |
| * @return TRUE if the most recent match hit the end of input | | * @return TRUE if the most recent match hit the end of input | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT UBool U_EXPORT2 | | U_DRAFT UBool U_EXPORT2 | |
| uregex_hitEnd(const URegularExpression *regexp, | | uregex_hitEnd(const URegularExpression *regexp, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Return TRUE the most recent match succeeded and additional input could
cause | | * Return TRUE the most recent match succeeded and additional input could
cause | |
| * it to fail. If this function returns false and a match was found, then
more input | | * it to fail. If this function returns false and a match was found, then
more input | |
| * might change the match but the match won't be lost. If a match was not
found, | | * might change the match but the match won't be lost. If a match was not
found, | |
| * then requireEnd has no meaning. | | * then requireEnd has no meaning. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param status A pointer to a UErrorCode to receive any errors. | | * @param status A pointer to a UErrorCode to receive any errors. | |
| * @return TRUE if more input could cause the most recent match to no lon
ger match. | | * @return TRUE if more input could cause the most recent match to no lon
ger match. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT UBool U_EXPORT2 | | U_DRAFT UBool U_EXPORT2 | |
| uregex_requireEnd(const URegularExpression *regexp, | | uregex_requireEnd(const URegularExpression *regexp, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Replaces every substring of the input that matches the pattern | | * Replaces every substring of the input that matches the pattern | |
| * with the given replacement string. This is a convenience function t
hat | | * with the given replacement string. This is a convenience function t
hat | |
| * provides a complete find-and-replace-all operation. | | * provides a complete find-and-replace-all operation. | |
| * | | * | |
| | | | |
| skipping to change at line 842 | | skipping to change at line 842 | |
| * Correspondence with actual processor time will depend on the speed | | * Correspondence with actual processor time will depend on the speed | |
| * of the processor and the details of the specific pattern, but will | | * of the processor and the details of the specific pattern, but will | |
| * typically be on the order of milliseconds. | | * typically be on the order of milliseconds. | |
| * <p> | | * <p> | |
| * By default, the matching time is not limited. | | * By default, the matching time is not limited. | |
| * <p> | | * <p> | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param limit The limit value, or 0 for no limit. | | * @param limit The limit value, or 0 for no limit. | |
| * @param status A reference to a UErrorCode to receive any errors. | | * @param status A reference to a UErrorCode to receive any errors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT void U_EXPORT2 | | U_DRAFT void U_EXPORT2 | |
| uregex_setTimeLimit(URegularExpression *regexp, | | uregex_setTimeLimit(URegularExpression *regexp, | |
| int32_t limit, | | int32_t limit, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Get the time limit for for matches with this URegularExpression. | | * Get the time limit for for matches with this URegularExpression. | |
| * A return value of zero indicates that there is no limit. | | * A return value of zero indicates that there is no limit. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param status A reference to a UErrorCode to receive any errors. | | * @param status A reference to a UErrorCode to receive any errors. | |
| * @return the maximum allowed time for a match, in units of processing ste
ps. | | * @return the maximum allowed time for a match, in units of processing ste
ps. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT int32_t U_EXPORT2 | | U_DRAFT int32_t U_EXPORT2 | |
| uregex_getTimeLimit(const URegularExpression *regexp, | | uregex_getTimeLimit(const URegularExpression *regexp, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Set the amount of heap storage avaliable for use by the match backtracki
ng stack. | | * Set the amount of heap storage avaliable for use by the match backtracki
ng stack. | |
| * <p> | | * <p> | |
| * ICU uses a backtracking regular expression engine, with the backtrack st
ack | | * ICU uses a backtracking regular expression engine, with the backtrack st
ack | |
| * maintained on the heap. This function sets the limit to the amount of m
emory | | * maintained on the heap. This function sets the limit to the amount of m
emory | |
| | | | |
| skipping to change at line 880 | | skipping to change at line 880 | |
| * A limit is desirable because a malicious or poorly designed pattern can
use | | * A limit is desirable because a malicious or poorly designed pattern can
use | |
| * excessive memory, potentially crashing the process. A limit is enabled | | * excessive memory, potentially crashing the process. A limit is enabled | |
| * by default. | | * by default. | |
| * <p> | | * <p> | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param limit The maximum size, in bytes, of the matching backtra
ck stack. | | * @param limit The maximum size, in bytes, of the matching backtra
ck stack. | |
| * A value of -1 means no limit. | | * A value of -1 means no limit. | |
| * The limit must be greater than zero, or -1. | | * The limit must be greater than zero, or -1. | |
| * @param status A reference to a UErrorCode to receive any errors. | | * @param status A reference to a UErrorCode to receive any errors. | |
| * | | * | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT void U_EXPORT2 | | U_DRAFT void U_EXPORT2 | |
| uregex_setStackLimit(URegularExpression *regexp, | | uregex_setStackLimit(URegularExpression *regexp, | |
| int32_t limit, | | int32_t limit, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Get the size of the heap storage available for use by the back tracking
stack. | | * Get the size of the heap storage available for use by the back tracking
stack. | |
| * | | * | |
| * @return the maximum backtracking stack size, in bytes, or zero if the | | * @return the maximum backtracking stack size, in bytes, or zero if the | |
| * stack size is unlimited. | | * stack size is unlimited. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT int32_t U_EXPORT2 | | U_DRAFT int32_t U_EXPORT2 | |
| uregex_getStackLimit(const URegularExpression *regexp, | | uregex_getStackLimit(const URegularExpression *regexp, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Function pointer for a regular expression matching callback function. | | * Function pointer for a regular expression matching callback function. | |
| * When set, a callback function will be called periodically during matchin
g | | * When set, a callback function will be called periodically during matchin
g | |
| * operations. If the call back function returns FALSE, the matching | | * operations. If the call back function returns FALSE, the matching | |
| * operation will be terminated early. | | * operation will be terminated early. | |
| | | | |
| skipping to change at line 914 | | skipping to change at line 914 | |
| * Note: the callback function must not call other functions on this | | * Note: the callback function must not call other functions on this | |
| * URegularExpression. | | * URegularExpression. | |
| * | | * | |
| * @param context context pointer. The callback function will be invoked | | * @param context context pointer. The callback function will be invoked | |
| * with the context specified at the time that | | * with the context specified at the time that | |
| * uregex_setMatchCallback() is called. | | * uregex_setMatchCallback() is called. | |
| * @param steps the accumulated processing time, in match steps, | | * @param steps the accumulated processing time, in match steps, | |
| * for this matching operation. | | * for this matching operation. | |
| * @return TRUE to continue the matching operation. | | * @return TRUE to continue the matching operation. | |
| * FALSE to terminate the matching operation. | | * FALSE to terminate the matching operation. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_CDECL_BEGIN | | U_CDECL_BEGIN | |
| typedef UBool U_CALLCONV URegexMatchCallback ( | | typedef UBool U_CALLCONV URegexMatchCallback ( | |
| const void *context, | | const void *context, | |
| int32_t steps); | | int32_t steps); | |
| U_CDECL_END | | U_CDECL_END | |
| | | | |
| /** | | /** | |
| * Set a callback function for this URegularExpression. | | * Set a callback function for this URegularExpression. | |
| * During matching operations the function will be called periodically, | | * During matching operations the function will be called periodically, | |
| * giving the application the opportunity to terminate a long-running | | * giving the application the opportunity to terminate a long-running | |
| * match. | | * match. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param callback A pointer to the user-supplied callback function. | | * @param callback A pointer to the user-supplied callback function. | |
| * @param context User context pointer. The value supplied at the | | * @param context User context pointer. The value supplied at the | |
| * time the callback function is set will be saved | | * time the callback function is set will be saved | |
| * and passed to the callback each time that it is cal
led. | | * and passed to the callback each time that it is cal
led. | |
| * @param status A reference to a UErrorCode to receive any errors. | | * @param status A reference to a UErrorCode to receive any errors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT void U_EXPORT2 | | U_DRAFT void U_EXPORT2 | |
| uregex_setMatchCallback(URegularExpression *regexp, | | uregex_setMatchCallback(URegularExpression *regexp, | |
| URegexMatchCallback *callback, | | URegexMatchCallback *callback, | |
| const void *context, | | const void *context, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Get the callback function for this URegularExpression. | | * Get the callback function for this URegularExpression. | |
| * | | * | |
| * @param regexp The compiled regular expression. | | * @param regexp The compiled regular expression. | |
| * @param callback Out paramater, receives a pointer to the user-suppl
ied | | * @param callback Out paramater, receives a pointer to the user-suppl
ied | |
| * callback function. | | * callback function. | |
| * @param context Out parameter, receives the user context pointer th
at | | * @param context Out parameter, receives the user context pointer th
at | |
| * was set when uregex_setMatchCallback() was called. | | * was set when uregex_setMatchCallback() was called. | |
| * @param status A reference to a UErrorCode to receive any errors. | | * @param status A reference to a UErrorCode to receive any errors. | |
|
| * @draft ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| U_DRAFT void U_EXPORT2 | | U_DRAFT void U_EXPORT2 | |
| uregex_getMatchCallback(const URegularExpression *regexp, | | uregex_getMatchCallback(const URegularExpression *regexp, | |
| URegexMatchCallback **callback, | | URegexMatchCallback **callback, | |
| const void **context, | | const void **context, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| #endif /* !UCONFIG_NO_REGULAR_EXPRESSIONS */ | | #endif /* !UCONFIG_NO_REGULAR_EXPRESSIONS */ | |
| #endif /* UREGEX_H */ | | #endif /* UREGEX_H */ | |
| | | | |
End of changes. 21 change blocks. |
| 21 lines changed or deleted | | 21 lines changed or added | |
|
| uset.h | | uset.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
|
| * Copyright (C) 2002-2008, International Business Machines | | * Copyright (C) 2002-2009, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| * | | * | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * file name: uset.h | | * file name: uset.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * tab size: 8 (not used) | | * tab size: 8 (not used) | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 2002mar07 | | * created on: 2002mar07 | |
| * created by: Markus W. Scherer | | * created by: Markus W. Scherer | |
| | | | |
| skipping to change at line 99 | | skipping to change at line 99 | |
| */ | | */ | |
| USET_ADD_CASE_MAPPINGS = 4, | | USET_ADD_CASE_MAPPINGS = 4, | |
| | | | |
| /** | | /** | |
| * Enough for any single-code point set | | * Enough for any single-code point set | |
| * @internal | | * @internal | |
| */ | | */ | |
| USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8 | | USET_SERIALIZED_STATIC_ARRAY_CAPACITY=8 | |
| }; | | }; | |
| | | | |
|
| #ifndef U_HIDE_DRAFT_API | | | |
| | | | |
| /** | | /** | |
| * Argument values for whether span() and similar functions continue while | | * Argument values for whether span() and similar functions continue while | |
| * the current character is contained vs. not contained in the set. | | * the current character is contained vs. not contained in the set. | |
| * | | * | |
| * The functionality is straightforward for sets with only single code poin
ts, | | * The functionality is straightforward for sets with only single code poin
ts, | |
| * without strings (which is the common case): | | * without strings (which is the common case): | |
| * - USET_SPAN_CONTAINED and USET_SPAN_SIMPLE | | * - USET_SPAN_CONTAINED and USET_SPAN_SIMPLE | |
| * work the same. | | * work the same. | |
| * - span() and spanBack() partition any string the same way when | | * - span() and spanBack() partition any string the same way when | |
| * alternating between span(USET_SPAN_NOT_CONTAINED) and | | * alternating between span(USET_SPAN_NOT_CONTAINED) and | |
| | | | |
| skipping to change at line 210 | | skipping to change at line 208 | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| USET_SPAN_SIMPLE = 2, | | USET_SPAN_SIMPLE = 2, | |
| /** | | /** | |
| * One more than the last span condition. | | * One more than the last span condition. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| USET_SPAN_CONDITION_COUNT | | USET_SPAN_CONDITION_COUNT | |
| } USetSpanCondition; | | } USetSpanCondition; | |
| | | | |
|
| #endif /* U_HIDE_DRAFT_API */ | | | |
| | | | |
| /** | | /** | |
| * A serialized form of a Unicode set. Limited manipulations are | | * A serialized form of a Unicode set. Limited manipulations are | |
| * possible directly on a serialized set. See below. | | * possible directly on a serialized set. See below. | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| typedef struct USerializedSet { | | typedef struct USerializedSet { | |
| /** | | /** | |
| * The serialized Unicode Set. | | * The serialized Unicode Set. | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| | | | |
| skipping to change at line 245 | | skipping to change at line 241 | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY]; | | uint16_t staticArray[USET_SERIALIZED_STATIC_ARRAY_CAPACITY]; | |
| } USerializedSet; | | } USerializedSet; | |
| | | | |
| /********************************************************************* | | /********************************************************************* | |
| * USet API | | * USet API | |
| *********************************************************************/ | | *********************************************************************/ | |
| | | | |
| /** | | /** | |
|
| | | * Create an empty USet object. | |
| | | * Equivalent to uset_open(1, 0). | |
| | | * @return a newly created USet. The caller must call uset_close() on | |
| | | * it when done. | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | U_DRAFT USet* U_EXPORT2 | |
| | | uset_openEmpty(); | |
| | | | |
| | | /** | |
| * Creates a USet object that contains the range of characters | | * Creates a USet object that contains the range of characters | |
| * start..end, inclusive. If <code>start > end</code> | | * start..end, inclusive. If <code>start > end</code> | |
|
| * then an empty set is created. | | * then an empty set is created (same as using uset_openEmpty()). | |
| * @param start first character of the range, inclusive | | * @param start first character of the range, inclusive | |
| * @param end last character of the range, inclusive | | * @param end last character of the range, inclusive | |
| * @return a newly created USet. The caller must call uset_close() on | | * @return a newly created USet. The caller must call uset_close() on | |
| * it when done. | | * it when done. | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| U_STABLE USet* U_EXPORT2 | | U_STABLE USet* U_EXPORT2 | |
| uset_open(UChar32 start, UChar32 end); | | uset_open(UChar32 start, UChar32 end); | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 680 | | skipping to change at line 686 | |
| * Removes all of the elements from this set. This set will be | | * Removes all of the elements from this set. This set will be | |
| * empty after this call returns. | | * empty after this call returns. | |
| * A frozen set will not be modified. | | * A frozen set will not be modified. | |
| * @param set the set | | * @param set the set | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| U_STABLE void U_EXPORT2 | | U_STABLE void U_EXPORT2 | |
| uset_clear(USet* set); | | uset_clear(USet* set); | |
| | | | |
| /** | | /** | |
|
| | | * Close this set over the given attribute. For the attribute | |
| | | * USET_CASE, the result is to modify this set so that: | |
| | | * | |
| | | * 1. For each character or string 'a' in this set, all strings or | |
| | | * characters 'b' such that foldCase(a) == foldCase(b) are added | |
| | | * to this set. | |
| | | * | |
| | | * 2. For each string 'e' in the resulting set, if e != | |
| | | * foldCase(e), 'e' will be removed. | |
| | | * | |
| | | * Example: [aq\\u00DF{Bc}{bC}{Fi}] => [aAqQ\\u00DF\\uFB01{ss}{bc}{fi}] | |
| | | * | |
| | | * (Here foldCase(x) refers to the operation u_strFoldCase, and a | |
| | | * == b denotes that the contents are the same, not pointer | |
| | | * comparison.) | |
| | | * | |
| | | * A frozen set will not be modified. | |
| | | * | |
| | | * @param set the set | |
| | | * | |
| | | * @param attributes bitmask for attributes to close over. | |
| | | * Currently only the USET_CASE bit is supported. Any undefined bits | |
| | | * are ignored. | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | U_DRAFT void U_EXPORT2 | |
| | | uset_closeOver(USet* set, int32_t attributes); | |
| | | | |
| | | /** | |
| | | * Remove all strings from this set. | |
| | | * | |
| | | * @param set the set | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | U_DRAFT void U_EXPORT2 | |
| | | uset_removeAllStrings(USet* set); | |
| | | | |
| | | /** | |
| * Returns TRUE if the given USet contains no characters and no | | * Returns TRUE if the given USet contains no characters and no | |
| * strings. | | * strings. | |
| * @param set the set | | * @param set the set | |
| * @return true if set is empty | | * @return true if set is empty | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| U_STABLE UBool U_EXPORT2 | | U_STABLE UBool U_EXPORT2 | |
| uset_isEmpty(const USet* set); | | uset_isEmpty(const USet* set); | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 742 | | skipping to change at line 786 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uset_indexOf(const USet* set, UChar32 c); | | uset_indexOf(const USet* set, UChar32 c); | |
| | | | |
| /** | | /** | |
| * Returns the character at the given index within this set, where | | * Returns the character at the given index within this set, where | |
| * the set is ordered by ascending code point. If the index is | | * the set is ordered by ascending code point. If the index is | |
| * out of range, return (UChar32)-1. The inverse of this method is | | * out of range, return (UChar32)-1. The inverse of this method is | |
| * <code>indexOf()</code>. | | * <code>indexOf()</code>. | |
| * @param set the set | | * @param set the set | |
|
| * @param index an index from 0..size()-1 to obtain the char for | | * @param charIndex an index from 0..size()-1 to obtain the char for | |
| * @return the character at the given index, or (UChar32)-1. | | * @return the character at the given index, or (UChar32)-1. | |
| * @stable ICU 3.2 | | * @stable ICU 3.2 | |
| */ | | */ | |
| U_STABLE UChar32 U_EXPORT2 | | U_STABLE UChar32 U_EXPORT2 | |
|
| uset_charAt(const USet* set, int32_t index); | | uset_charAt(const USet* set, int32_t charIndex); | |
| | | | |
| /** | | /** | |
| * Returns the number of characters and strings contained in the given | | * Returns the number of characters and strings contained in the given | |
| * USet. | | * USet. | |
| * @param set the set | | * @param set the set | |
| * @return a non-negative integer counting the characters and strings | | * @return a non-negative integer counting the characters and strings | |
| * contained in set | | * contained in set | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| | | | |
End of changes. 8 change blocks. |
| 8 lines changed or deleted | | 52 lines changed or added | |
|
| ushape.h | | ushape.h | |
| /* | | /* | |
| ***************************************************************************
*** | | ***************************************************************************
*** | |
| * | | * | |
|
| * Copyright (C) 2000-2007, International Business Machines | | * Copyright (C) 2000-2009, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| * | | * | |
| ***************************************************************************
*** | | ***************************************************************************
*** | |
| * file name: ushape.h | | * file name: ushape.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * tab size: 8 (not used) | | * tab size: 8 (not used) | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 2000jun29 | | * created on: 2000jun29 | |
| * created by: Markus W. Scherer | | * created by: Markus W. Scherer | |
| | | | |
| skipping to change at line 107 | | skipping to change at line 107 | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| u_shapeArabic(const UChar *source, int32_t sourceLength, | | u_shapeArabic(const UChar *source, int32_t sourceLength, | |
| UChar *dest, int32_t destSize, | | UChar *dest, int32_t destSize, | |
| uint32_t options, | | uint32_t options, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
| * Memory option: allow the result to have a different length than the sour
ce. | | * Memory option: allow the result to have a different length than the sour
ce. | |
|
| | | * Affects: LamAlef options | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| #define U_SHAPE_LENGTH_GROW_SHRINK 0 | | #define U_SHAPE_LENGTH_GROW_SHRINK 0 | |
| | | | |
| /** | | /** | |
|
| | | * Memory option: allow the result to have a different length than the sour | |
| | | ce. | |
| | | * Affects: LamAlef options | |
| | | * This option is an alias to U_SHAPE_LENGTH_GROW_SHRINK | |
| | | */ | |
| | | #define U_SHAPE_LAMALEF_RESIZE 0 | |
| | | | |
| | | /** | |
| * Memory option: the result must have the same length as the source. | | * Memory option: the result must have the same length as the source. | |
| * If more room is necessary, then try to consume spaces next to modified c
haracters. | | * If more room is necessary, then try to consume spaces next to modified c
haracters. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| #define U_SHAPE_LENGTH_FIXED_SPACES_NEAR 1 | | #define U_SHAPE_LENGTH_FIXED_SPACES_NEAR 1 | |
| | | | |
| /** | | /** | |
| * Memory option: the result must have the same length as the source. | | * Memory option: the result must have the same length as the source. | |
|
| | | * If more room is necessary, then try to consume spaces next to modified c | |
| | | haracters. | |
| | | * Affects: LamAlef options | |
| | | * This option is an alias to U_SHAPE_LENGTH_FIXED_SPACES_NEAR | |
| | | */ | |
| | | #define U_SHAPE_LAMALEF_NEAR 1 | |
| | | | |
| | | /** | |
| | | * Memory option: the result must have the same length as the source. | |
| * If more room is necessary, then try to consume spaces at the end of the
text. | | * If more room is necessary, then try to consume spaces at the end of the
text. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| #define U_SHAPE_LENGTH_FIXED_SPACES_AT_END 2 | | #define U_SHAPE_LENGTH_FIXED_SPACES_AT_END 2 | |
| | | | |
| /** | | /** | |
| * Memory option: the result must have the same length as the source. | | * Memory option: the result must have the same length as the source. | |
|
| | | * If more room is necessary, then try to consume spaces at the end of the | |
| | | text. | |
| | | * Affects: LamAlef options | |
| | | * This option is an alias to U_SHAPE_LENGTH_FIXED_SPACES_AT_END | |
| | | */ | |
| | | #define U_SHAPE_LAMALEF_END 2 | |
| | | | |
| | | /** | |
| | | * Memory option: the result must have the same length as the source. | |
| * If more room is necessary, then try to consume spaces at the beginning o
f the text. | | * If more room is necessary, then try to consume spaces at the beginning o
f the text. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| #define U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING 3 | | #define U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING 3 | |
| | | | |
|
| | | /** | |
| | | * Memory option: the result must have the same length as the source. | |
| | | * If more room is necessary, then try to consume spaces at the beginning o | |
| | | f the text. | |
| | | * Affects: LamAlef options | |
| | | * This option is an alias to U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING | |
| | | */ | |
| | | #define U_SHAPE_LAMALEF_BEGIN 3 | |
| | | | |
| | | /** | |
| | | * Memory option: the result must have the same length as the source. | |
| | | * Shaping Mode: For each LAMALEF character found, expand LAMALEF using spa | |
| | | ce at end. | |
| | | * If there is no space at end, use spaces at beginning of th | |
| | | e buffer. If there | |
| | | * is no space at beginning of the buffer, use spaces at the | |
| | | near (i.e. the space | |
| | | * after the LAMALEF character). | |
| | | * If there are no spaces found, an error U_NO_SPACE_AVAILABL | |
| | | E (as defined in utypes.h) | |
| | | * will be set in pErrorCode | |
| | | * | |
| | | * Deshaping Mode: Perform the same function as the flag equals U_SHAPE_LAM | |
| | | ALEF_END. | |
| | | * Affects: LamAlef options | |
| | | */ | |
| | | #define U_SHAPE_LAMALEF_AUTO 0x10000 | |
| | | | |
| /** Bit mask for memory options. @stable ICU 2.0 */ | | /** Bit mask for memory options. @stable ICU 2.0 */ | |
|
| #define U_SHAPE_LENGTH_MASK 3 | | #define U_SHAPE_LENGTH_MASK 0x10003 /* Changed old val | |
| | | ue 3 */ | |
| | | | |
| | | /** Bit mask for LamAlef memory options. */ | |
| | | #define U_SHAPE_LAMALEF_MASK 0x10003 /* updated */ | |
| | | | |
| /** Direction indicator: the source is in logical (keyboard) order. @stable
ICU 2.0 */ | | /** Direction indicator: the source is in logical (keyboard) order. @stable
ICU 2.0 */ | |
| #define U_SHAPE_TEXT_DIRECTION_LOGICAL 0 | | #define U_SHAPE_TEXT_DIRECTION_LOGICAL 0 | |
| | | | |
| /** | | /** | |
| * Direction indicator: | | * Direction indicator: | |
|
| | | * the source is in visual RTL order, | |
| | | * the rightmost displayed character stored first. | |
| | | * This option is an alias to U_SHAPE_TEXT_DIRECTION_LOGICAL | |
| | | */ | |
| | | #define U_SHAPE_TEXT_DIRECTION_VISUAL_RTL 0 | |
| | | | |
| | | /** | |
| | | * Direction indicator: | |
| * the source is in visual LTR order, | | * the source is in visual LTR order, | |
| * the leftmost displayed character stored first. | | * the leftmost displayed character stored first. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| #define U_SHAPE_TEXT_DIRECTION_VISUAL_LTR 4 | | #define U_SHAPE_TEXT_DIRECTION_VISUAL_LTR 4 | |
| | | | |
| /** Bit mask for direction indicators. @stable ICU 2.0 */ | | /** Bit mask for direction indicators. @stable ICU 2.0 */ | |
| #define U_SHAPE_TEXT_DIRECTION_MASK 4 | | #define U_SHAPE_TEXT_DIRECTION_MASK 4 | |
| | | | |
| /** Letter shaping option: do not perform letter shaping. @stable ICU 2.0 *
/ | | /** Letter shaping option: do not perform letter shaping. @stable ICU 2.0 *
/ | |
| | | | |
| skipping to change at line 168 | | skipping to change at line 225 | |
| /** | | /** | |
| * Letter shaping option: replace abstract letter characters by "shaped" on
es. | | * Letter shaping option: replace abstract letter characters by "shaped" on
es. | |
| * The only difference with U_SHAPE_LETTERS_SHAPE is that Tashkeel letters | | * The only difference with U_SHAPE_LETTERS_SHAPE is that Tashkeel letters | |
| * are always "shaped" into the isolated form instead of the medial form | | * are always "shaped" into the isolated form instead of the medial form | |
| * (selecting code points from the Arabic Presentation Forms-B block). | | * (selecting code points from the Arabic Presentation Forms-B block). | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| #define U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED 0x18 | | #define U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED 0x18 | |
| | | | |
| /** Bit mask for letter shaping options. @stable ICU 2.0 */ | | /** Bit mask for letter shaping options. @stable ICU 2.0 */ | |
|
| #define U_SHAPE_LETTERS_MASK 0x18 | | #define U_SHAPE_LETTERS_MASK 0x18 | |
| | | | |
| /** Digit shaping option: do not perform digit shaping. @stable ICU 2.0 */ | | /** Digit shaping option: do not perform digit shaping. @stable ICU 2.0 */ | |
| #define U_SHAPE_DIGITS_NOOP 0 | | #define U_SHAPE_DIGITS_NOOP 0 | |
| | | | |
| /** | | /** | |
| * Digit shaping option: | | * Digit shaping option: | |
| * Replace European digits (U+0030...) by Arabic-Indic digits. | | * Replace European digits (U+0030...) by Arabic-Indic digits. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| #define U_SHAPE_DIGITS_EN2AN 0x20 | | #define U_SHAPE_DIGITS_EN2AN 0x20 | |
| | | | |
| skipping to change at line 228 | | skipping to change at line 285 | |
| /** Digit type option: Use Arabic-Indic digits (U+0660...U+0669). @stable I
CU 2.0 */ | | /** Digit type option: Use Arabic-Indic digits (U+0660...U+0669). @stable I
CU 2.0 */ | |
| #define U_SHAPE_DIGIT_TYPE_AN 0 | | #define U_SHAPE_DIGIT_TYPE_AN 0 | |
| | | | |
| /** Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0..
.U+06f9). @stable ICU 2.0 */ | | /** Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0..
.U+06f9). @stable ICU 2.0 */ | |
| #define U_SHAPE_DIGIT_TYPE_AN_EXTENDED 0x100 | | #define U_SHAPE_DIGIT_TYPE_AN_EXTENDED 0x100 | |
| | | | |
| /** Not a valid option value. May be replaced by a new option. @stable ICU
2.0 */ | | /** Not a valid option value. May be replaced by a new option. @stable ICU
2.0 */ | |
| #define U_SHAPE_DIGIT_TYPE_RESERVED 0x200 | | #define U_SHAPE_DIGIT_TYPE_RESERVED 0x200 | |
| | | | |
| /** Bit mask for digit type options. @stable ICU 2.0 */ | | /** Bit mask for digit type options. @stable ICU 2.0 */ | |
|
| #define U_SHAPE_DIGIT_TYPE_MASK 0x3f00 | | #define U_SHAPE_DIGIT_TYPE_MASK 0x300 /* I need to change t
his from 0x3f00 to 0x300 */ | |
| | | | |
| /** | | /** | |
| * Tashkeel aggregation option: | | * Tashkeel aggregation option: | |
| * Replaces any combination of U+0651 with one of | | * Replaces any combination of U+0651 with one of | |
| * U+064C, U+064D, U+064E, U+064F, U+0650 with | | * U+064C, U+064D, U+064E, U+064F, U+0650 with | |
| * U+FC5E, U+FC5F, U+FC60, U+FC61, U+FC62 consecutively. | | * U+FC5E, U+FC5F, U+FC60, U+FC61, U+FC62 consecutively. | |
| * @stable ICU 3.6 | | * @stable ICU 3.6 | |
| */ | | */ | |
| #define U_SHAPE_AGGREGATE_TASHKEEL 0x4000 | | #define U_SHAPE_AGGREGATE_TASHKEEL 0x4000 | |
| /** Tashkeel aggregation option: do not aggregate tashkeels. @stable ICU 3.
6 */ | | /** Tashkeel aggregation option: do not aggregate tashkeels. @stable ICU 3.
6 */ | |
| | | | |
| skipping to change at line 259 | | skipping to change at line 316 | |
| #define U_SHAPE_PRESERVE_PRESENTATION 0x8000 | | #define U_SHAPE_PRESERVE_PRESENTATION 0x8000 | |
| /** Presentation form option: | | /** Presentation form option: | |
| * Replace Arabic Presentation Forms-A and Arabic Presentationo Forms-B wit
h | | * Replace Arabic Presentation Forms-A and Arabic Presentationo Forms-B wit
h | |
| * their unshaped correspondants in range 0+06xx, before shaping. | | * their unshaped correspondants in range 0+06xx, before shaping. | |
| * @stable ICU 3.6 | | * @stable ICU 3.6 | |
| */ | | */ | |
| #define U_SHAPE_PRESERVE_PRESENTATION_NOOP 0 | | #define U_SHAPE_PRESERVE_PRESENTATION_NOOP 0 | |
| /** Bit mask for preserve presentation form. @stable ICU 3.6 */ | | /** Bit mask for preserve presentation form. @stable ICU 3.6 */ | |
| #define U_SHAPE_PRESERVE_PRESENTATION_MASK 0x8000 | | #define U_SHAPE_PRESERVE_PRESENTATION_MASK 0x8000 | |
| | | | |
|
| | | /* Seen Tail option */ | |
| | | /** | |
| | | * Memory option: the result must have the same length as the source. | |
| | | * Shaping mode: The SEEN family character will expand into two characters | |
| | | using space near | |
| | | * the SEEN family character(i.e. the space after the charact | |
| | | er). | |
| | | * If there are no spaces found, an error U_NO_SPACE_AVAILABL | |
| | | E (as defined in utypes.h) | |
| | | * will be set in pErrorCode | |
| | | * | |
| | | * De-shaping mode: Any Seen character followed by Tail character will be | |
| | | * replaced by one cell Seen and a space will replace the | |
| | | Tail. | |
| | | * Affects: Seen options | |
| | | */ | |
| | | #define U_SHAPE_SEEN_TWOCELL_NEAR 0x200000 | |
| | | | |
| | | /** Bit mask for Seen memory options. */ | |
| | | #define U_SHAPE_SEEN_MASK 0x700000 | |
| | | | |
| | | /* YehHamza option */ | |
| | | /** | |
| | | * Memory option: the result must have the same length as the source. | |
| | | * Shaping mode: The YEHHAMZA character will expand into two characters usi | |
| | | ng space near it | |
| | | * (i.e. the space after the character | |
| | | * If there are no spaces found, an error U_NO_SPACE_AVAILABL | |
| | | E (as defined in utypes.h) | |
| | | * will be set in pErrorCode | |
| | | * | |
| | | * De-shaping mode: Any Yeh (final or isolated) character followed by Hamza | |
| | | character will be | |
| | | * replaced by one cell YehHamza and space will replace th | |
| | | e Hamza. | |
| | | * Affects: YehHamza options | |
| | | */ | |
| | | #define U_SHAPE_YEHHAMZA_TWOCELL_NEAR 0x1000000 | |
| | | | |
| | | /** Bit mask for YehHamza memory options. */ | |
| | | #define U_SHAPE_YEHHAMZA_MASK 0x3800000 | |
| | | | |
| | | /* New Tashkeel options */ | |
| | | /** | |
| | | * Memory option: the result must have the same length as the source. | |
| | | * Shaping mode: Tashkeel characters will be replaced by spaces. | |
| | | * Spaces will be placed at beginning of the buffer | |
| | | * | |
| | | * De-shaping mode: N/A | |
| | | * Affects: Tashkeel options | |
| | | */ | |
| | | #define U_SHAPE_TASHKEEL_BEGIN 0x40000 | |
| | | | |
| | | /** | |
| | | * Memory option: the result must have the same length as the source. | |
| | | * Shaping mode: Tashkeel characters will be replaced by spaces. | |
| | | * Spaces will be placed at end of the buffer | |
| | | * | |
| | | * De-shaping mode: N/A | |
| | | * Affects: Tashkeel options | |
| | | */ | |
| | | #define U_SHAPE_TASHKEEL_END 0x60000 | |
| | | | |
| | | /** | |
| | | * Memory option: allow the result to have a different length than the sour | |
| | | ce. | |
| | | * Shaping mode: Tashkeel characters will be removed, buffer length will sh | |
| | | rink. | |
| | | * De-shaping mode: N/A | |
| | | * | |
| | | * Affect: Tashkeel options | |
| | | */ | |
| | | #define U_SHAPE_TASHKEEL_RESIZE 0x80000 | |
| | | | |
| | | /** | |
| | | * Memory option: the result must have the same length as the source. | |
| | | * Shaping mode: Tashkeel characters will be replaced by Tatweel if it is c | |
| | | onnected to adjacent | |
| | | * characters (i.e. shaped on Tatweel) or replaced by space i | |
| | | f it is not connected. | |
| | | * | |
| | | * De-shaping mode: N/A | |
| | | * Affects: YehHamza options | |
| | | */ | |
| | | #define U_SHAPE_TASHKEEL_REPLACE_BY_TATWEEL 0xC0000 | |
| | | | |
| | | /** Bit mask for Tashkeel replacement with Space or Tatweel memory options. | |
| | | */ | |
| | | #define U_SHAPE_TASHKEEL_MASK 0xE0000 | |
| | | | |
| | | /* Space location Control options */ | |
| | | /** | |
| | | * This option affect the meaning of BEGIN and END options. if this option | |
| | | is not used the default | |
| | | * for BEGIN and END will be as following: | |
| | | * The Default (for both Visual LTR, Visual RTL and Logical Text) | |
| | | * 1. BEGIN always refers to the start address of physical memory | |
| | | . | |
| | | * 2. END always refers to the end address of physical memory. | |
| | | * | |
| | | * If this option is used it will swap the meaning of BEGIN and END only fo | |
| | | r Visual LTR text. | |
| | | * | |
| | | * The effect on BEGIN and END Memory Options will be as following: | |
| | | * A. BEGIN For Visual LTR text: This will be the beginning (right side) | |
| | | of the visual text( | |
| | | * corresponding to the physical memory address end for Visual LTR te | |
| | | xt, Same as END in | |
| | | * default behavior) | |
| | | * B. BEGIN For Logical text: Same as BEGIN in default behavior. | |
| | | * C. END For Visual LTR text: This will be the end (left side) of the v | |
| | | isual text (corresponding | |
| | | * to the physical memory address beginning for Visual LTR text, Same | |
| | | as BEGIN in default behavior. | |
| | | * D. END For Logical text: Same as END in default behavior). | |
| | | * Affects: All LamAlef BEGIN, END and AUTO options. | |
| | | */ | |
| | | #define U_SHAPE_SPACES_RELATIVE_TO_TEXT_BEGIN_END 0x4000000 | |
| | | | |
| | | /** Bit mask for swapping BEGIN and END for Visual LTR text */ | |
| | | #define U_SHAPE_SPACES_RELATIVE_TO_TEXT_MASK 0x4000000 | |
| | | | |
| | | /** | |
| | | * If this option is used, shaping will use the new Unicode code point for | |
| | | TAIL (i.e. 0xFE73). | |
| | | * If this option is not specified (Default), old unofficial Unicode TAIL c | |
| | | ode point is used (i.e. 0x200B) | |
| | | * De-shaping will not use this option as it will always search for both th | |
| | | e new Unicode code point for the | |
| | | * TAIL (i.e. 0xFE73) or the old unofficial Unicode TAIL code point (i.e. 0 | |
| | | x200B) and de-shape the | |
| | | * Seen-Family letter accordingly. | |
| | | * | |
| | | * Shaping Mode: Only shaping. | |
| | | * De-shaping Mode: N/A. | |
| | | * Affects: All Seen options | |
| | | */ | |
| | | #define SHAPE_TAIL_NEW_UNICODE 0x8000000 | |
| | | | |
| | | /** Bit mask for new Unicode Tail option */ | |
| | | #define SHAPE_TAIL_TYPE_MASK 0x8000000 | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 11 change blocks. |
| 4 lines changed or deleted | | 213 lines changed or added | |
|
| ustring.h | | ustring.h | |
| /* | | /* | |
| ********************************************************************** | | ********************************************************************** | |
|
| * Copyright (C) 1998-2008, International Business Machines | | * Copyright (C) 1998-2009, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| ********************************************************************** | | ********************************************************************** | |
| * | | * | |
| * File ustring.h | | * File ustring.h | |
| * | | * | |
| * Modification History: | | * Modification History: | |
| * | | * | |
| * Date Name Description | | * Date Name Description | |
| * 12/07/98 bertrand Creation. | | * 12/07/98 bertrand Creation. | |
| ***************************************************************************
*** | | ***************************************************************************
*** | |
| | | | |
| skipping to change at line 921 | | skipping to change at line 921 | |
| * int32_t function() { | | * int32_t function() { | |
| * if(!didInit) { | | * if(!didInit) { | |
| * U_STRING_INIT(ustringVar1, "Quick-Fox 2", 11); | | * U_STRING_INIT(ustringVar1, "Quick-Fox 2", 11); | |
| * U_STRING_INIT(ustringVar2, "jumps 5%", 8); | | * U_STRING_INIT(ustringVar2, "jumps 5%", 8); | |
| * didInit=TRUE; | | * didInit=TRUE; | |
| * } | | * } | |
| * return u_strcmp(ustringVar1, ustringVar2); | | * return u_strcmp(ustringVar1, ustringVar2); | |
| * } | | * } | |
| * </pre> | | * </pre> | |
| * | | * | |
|
| * Note that the macros will NOT consistently work if their argument is ano | | * Note that the macros will NOT consistently work if their argument is ano | |
| ther | | ther #define. | |
| * #define. The following will not work on all platforms, don't use it. | | * The following will not work on all platforms, don't use it. | |
| * | | * | |
| * <pre> | | * <pre> | |
| * #define GLUCK "Mr. Gluck" | | * #define GLUCK "Mr. Gluck" | |
| * U_STRING_DECL(var, GLUCK, 9) | | * U_STRING_DECL(var, GLUCK, 9) | |
| * U_STRING_INIT(var, GLUCK, 9) | | * U_STRING_INIT(var, GLUCK, 9) | |
| * </pre> | | * </pre> | |
| * | | * | |
| * Instead, use the string literal "Mr. Gluck" as the argument to both mac
ro | | * Instead, use the string literal "Mr. Gluck" as the argument to both mac
ro | |
| * calls. | | * calls. | |
| * | | * | |
| | | | |
| skipping to change at line 1186 | | skipping to change at line 1186 | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| u_strFoldCase(UChar *dest, int32_t destCapacity, | | u_strFoldCase(UChar *dest, int32_t destCapacity, | |
| const UChar *src, int32_t srcLength, | | const UChar *src, int32_t srcLength, | |
| uint32_t options, | | uint32_t options, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| #if defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFIG_NO_C
ONVERSION | | #if defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFIG_NO_C
ONVERSION | |
| /** | | /** | |
|
| * Converts a sequence of UChars to wchar_t units. | | * Convert a UTF-16 string to a wchar_t string. | |
| | | * If it is known at compile time that wchar_t strings are in UTF-16 or UTF | |
| | | -32, then | |
| | | * this function simply calls the fast, dedicated function for that. | |
| | | * Otherwise, two conversions UTF-16 -> default charset -> wchar_t* are per | |
| | | formed. | |
| * | | * | |
| * @param dest A buffer for the result string. The result will be
zero-terminated if | | * @param dest A buffer for the result string. The result will be
zero-terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * @param destCapacity The size of the buffer (number of wchar_t's). If it
is 0, then | | * @param destCapacity The size of the buffer (number of wchar_t's). If it
is 0, then | |
| * dest may be NULL and the function will only return
the length of the | | * dest may be NULL and the function will only return
the length of the | |
| * result without writing any of the result string (pr
e-flighting). | | * result without writing any of the result string (pr
e-flighting). | |
| * @param pDestLength A pointer to receive the number of units written to
the destination. If | | * @param pDestLength A pointer to receive the number of units written to
the destination. If | |
| * pDestLength!=NULL then *pDestLength is always set t
o the | | * pDestLength!=NULL then *pDestLength is always set t
o the | |
| * number of output units corresponding to the transfo
rmation of | | * number of output units corresponding to the transfo
rmation of | |
| * all the input units, even in case of a buffer overf
low. | | * all the input units, even in case of a buffer overf
low. | |
| | | | |
| skipping to change at line 1212 | | skipping to change at line 1215 | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE wchar_t* U_EXPORT2 | | U_STABLE wchar_t* U_EXPORT2 | |
| u_strToWCS(wchar_t *dest, | | u_strToWCS(wchar_t *dest, | |
| int32_t destCapacity, | | int32_t destCapacity, | |
| int32_t *pDestLength, | | int32_t *pDestLength, | |
| const UChar *src, | | const UChar *src, | |
| int32_t srcLength, | | int32_t srcLength, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| /** | | /** | |
|
| * Converts a sequence of wchar_t units to UChars | | * Convert a wchar_t string to UTF-16. | |
| | | * If it is known at compile time that wchar_t strings are in UTF-16 or UTF | |
| | | -32, then | |
| | | * this function simply calls the fast, dedicated function for that. | |
| | | * Otherwise, two conversions wchar_t* -> default charset -> UTF-16 are per | |
| | | formed. | |
| * | | * | |
| * @param dest A buffer for the result string. The result will be
zero-terminated if | | * @param dest A buffer for the result string. The result will be
zero-terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | | * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | |
| * dest may be NULL and the function will only return
the length of the | | * dest may be NULL and the function will only return
the length of the | |
| * result without writing any of the result string (pr
e-flighting). | | * result without writing any of the result string (pr
e-flighting). | |
| * @param pDestLength A pointer to receive the number of units written to
the destination. If | | * @param pDestLength A pointer to receive the number of units written to
the destination. If | |
| * pDestLength!=NULL then *pDestLength is always set t
o the | | * pDestLength!=NULL then *pDestLength is always set t
o the | |
| * number of output units corresponding to the transfo
rmation of | | * number of output units corresponding to the transfo
rmation of | |
| * all the input units, even in case of a buffer overf
low. | | * all the input units, even in case of a buffer overf
low. | |
| | | | |
| skipping to change at line 1240 | | skipping to change at line 1246 | |
| U_STABLE UChar* U_EXPORT2 | | U_STABLE UChar* U_EXPORT2 | |
| u_strFromWCS(UChar *dest, | | u_strFromWCS(UChar *dest, | |
| int32_t destCapacity, | | int32_t destCapacity, | |
| int32_t *pDestLength, | | int32_t *pDestLength, | |
| const wchar_t *src, | | const wchar_t *src, | |
| int32_t srcLength, | | int32_t srcLength, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| #endif /* defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFI
G_NO_CONVERSION */ | | #endif /* defined(U_WCHAR_IS_UTF16) || defined(U_WCHAR_IS_UTF32) || !UCONFI
G_NO_CONVERSION */ | |
| | | | |
| /** | | /** | |
|
| * Converts a sequence of UChars (UTF-16) to UTF-8 bytes | | * Convert a UTF-16 string to UTF-8. | |
| | | * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND er | |
| | | ror code is set. | |
| * | | * | |
| * @param dest A buffer for the result string. The result will be
zero-terminated if | | * @param dest A buffer for the result string. The result will be
zero-terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * @param destCapacity The size of the buffer (number of chars). If it is
0, then | | * @param destCapacity The size of the buffer (number of chars). If it is
0, then | |
| * dest may be NULL and the function will only return
the length of the | | * dest may be NULL and the function will only return
the length of the | |
| * result without writing any of the result string (pr
e-flighting). | | * result without writing any of the result string (pr
e-flighting). | |
| * @param pDestLength A pointer to receive the number of units written to
the destination. If | | * @param pDestLength A pointer to receive the number of units written to
the destination. If | |
| * pDestLength!=NULL then *pDestLength is always set t
o the | | * pDestLength!=NULL then *pDestLength is always set t
o the | |
| * number of output units corresponding to the transfo
rmation of | | * number of output units corresponding to the transfo
rmation of | |
| * all the input units, even in case of a buffer overf
low. | | * all the input units, even in case of a buffer overf
low. | |
| | | | |
| skipping to change at line 1269 | | skipping to change at line 1276 | |
| */ | | */ | |
| U_STABLE char* U_EXPORT2 | | U_STABLE char* U_EXPORT2 | |
| u_strToUTF8(char *dest, | | u_strToUTF8(char *dest, | |
| int32_t destCapacity, | | int32_t destCapacity, | |
| int32_t *pDestLength, | | int32_t *pDestLength, | |
| const UChar *src, | | const UChar *src, | |
| int32_t srcLength, | | int32_t srcLength, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
|
| * Converts a sequence of UTF-8 bytes to UChars (UTF-16). | | * Convert a UTF-8 string to UTF-16. | |
| | | * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND er | |
| | | ror code is set. | |
| * | | * | |
| * @param dest A buffer for the result string. The result will be
zero-terminated if | | * @param dest A buffer for the result string. The result will be
zero-terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | | * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | |
| * dest may be NULL and the function will only return
the length of the | | * dest may be NULL and the function will only return
the length of the | |
| * result without writing any of the result string (pr
e-flighting). | | * result without writing any of the result string (pr
e-flighting). | |
| * @param pDestLength A pointer to receive the number of units written to
the destination. If | | * @param pDestLength A pointer to receive the number of units written to
the destination. If | |
| * pDestLength!=NULL then *pDestLength is always set t
o the | | * pDestLength!=NULL then *pDestLength is always set t
o the | |
| * number of output units corresponding to the transfo
rmation of | | * number of output units corresponding to the transfo
rmation of | |
| * all the input units, even in case of a buffer overf
low. | | * all the input units, even in case of a buffer overf
low. | |
| | | | |
| skipping to change at line 1298 | | skipping to change at line 1306 | |
| */ | | */ | |
| U_STABLE UChar* U_EXPORT2 | | U_STABLE UChar* U_EXPORT2 | |
| u_strFromUTF8(UChar *dest, | | u_strFromUTF8(UChar *dest, | |
| int32_t destCapacity, | | int32_t destCapacity, | |
| int32_t *pDestLength, | | int32_t *pDestLength, | |
| const char *src, | | const char *src, | |
| int32_t srcLength, | | int32_t srcLength, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
|
| * Converts a sequence of UChars (UTF-16) to UTF-8 bytes. | | * Convert a UTF-16 string to UTF-8. | |
| | | * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND er | |
| | | ror code is set. | |
| | | * | |
| * Same as u_strToUTF8() except for the additional subchar which is output
for | | * Same as u_strToUTF8() except for the additional subchar which is output
for | |
| * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOU
ND error code. | | * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOU
ND error code. | |
| * With subchar==U_SENTINEL, this function behaves exactly like u_strToUTF8
(). | | * With subchar==U_SENTINEL, this function behaves exactly like u_strToUTF8
(). | |
| * | | * | |
| * @param dest A buffer for the result string. The result will be
zero-terminated if | | * @param dest A buffer for the result string. The result will be
zero-terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * @param destCapacity The size of the buffer (number of chars). If it is
0, then | | * @param destCapacity The size of the buffer (number of chars). If it is
0, then | |
| * dest may be NULL and the function will only return
the length of the | | * dest may be NULL and the function will only return
the length of the | |
| * result without writing any of the result string (pr
e-flighting). | | * result without writing any of the result string (pr
e-flighting). | |
| * @param pDestLength A pointer to receive the number of units written to
the destination. If | | * @param pDestLength A pointer to receive the number of units written to
the destination. If | |
| | | | |
| skipping to change at line 1341 | | skipping to change at line 1351 | |
| U_STABLE char* U_EXPORT2 | | U_STABLE char* U_EXPORT2 | |
| u_strToUTF8WithSub(char *dest, | | u_strToUTF8WithSub(char *dest, | |
| int32_t destCapacity, | | int32_t destCapacity, | |
| int32_t *pDestLength, | | int32_t *pDestLength, | |
| const UChar *src, | | const UChar *src, | |
| int32_t srcLength, | | int32_t srcLength, | |
| UChar32 subchar, int32_t *pNumSubstitutions, | | UChar32 subchar, int32_t *pNumSubstitutions, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
|
| * Converts a sequence of UTF-8 bytes to UChars (UTF-16). | | * Convert a UTF-8 string to UTF-16. | |
| | | * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND er | |
| | | ror code is set. | |
| | | * | |
| * Same as u_strFromUTF8() except for the additional subchar which is outpu
t for | | * Same as u_strFromUTF8() except for the additional subchar which is outpu
t for | |
| * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOU
ND error code. | | * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOU
ND error code. | |
| * With subchar==U_SENTINEL, this function behaves exactly like u_strFromUT
F8(). | | * With subchar==U_SENTINEL, this function behaves exactly like u_strFromUT
F8(). | |
| * | | * | |
| * @param dest A buffer for the result string. The result will be
zero-terminated if | | * @param dest A buffer for the result string. The result will be
zero-terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | | * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | |
| * dest may be NULL and the function will only return
the length of the | | * dest may be NULL and the function will only return
the length of the | |
| * result without writing any of the result string (pr
e-flighting). | | * result without writing any of the result string (pr
e-flighting). | |
| * @param pDestLength A pointer to receive the number of units written to
the destination. If | | * @param pDestLength A pointer to receive the number of units written to
the destination. If | |
| | | | |
| skipping to change at line 1385 | | skipping to change at line 1397 | |
| U_STABLE UChar* U_EXPORT2 | | U_STABLE UChar* U_EXPORT2 | |
| u_strFromUTF8WithSub(UChar *dest, | | u_strFromUTF8WithSub(UChar *dest, | |
| int32_t destCapacity, | | int32_t destCapacity, | |
| int32_t *pDestLength, | | int32_t *pDestLength, | |
| const char *src, | | const char *src, | |
| int32_t srcLength, | | int32_t srcLength, | |
| UChar32 subchar, int32_t *pNumSubstitutions, | | UChar32 subchar, int32_t *pNumSubstitutions, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
|
| * Converts a sequence of UTF-8 bytes to UChars (UTF-16). | | * Convert a UTF-8 string to UTF-16. | |
| | | * | |
| * Same as u_strFromUTF8() except that this function is designed to be very
fast, | | * Same as u_strFromUTF8() except that this function is designed to be very
fast, | |
| * which it achieves by being lenient about malformed UTF-8 sequences. | | * which it achieves by being lenient about malformed UTF-8 sequences. | |
| * This function is intended for use in environments where UTF-8 text is | | * This function is intended for use in environments where UTF-8 text is | |
| * expected to be well-formed. | | * expected to be well-formed. | |
| * | | * | |
| * Its semantics are: | | * Its semantics are: | |
| * - Well-formed UTF-8 text is correctly converted to well-formed UTF-16 te
xt. | | * - Well-formed UTF-8 text is correctly converted to well-formed UTF-16 te
xt. | |
| * - The function will not read beyond the input string, nor write beyond | | * - The function will not read beyond the input string, nor write beyond | |
| * the destCapacity. | | * the destCapacity. | |
| * - Malformed UTF-8 results in "garbage" 16-bit Unicode strings which may
not | | * - Malformed UTF-8 results in "garbage" 16-bit Unicode strings which may
not | |
| * be well-formed UTF-16. | | * be well-formed UTF-16. | |
| * The function will resynchronize to valid code point boundaries | | * The function will resynchronize to valid code point boundaries | |
| * within a small number of code points after an illegal sequence. | | * within a small number of code points after an illegal sequence. | |
| * - Non-shortest forms are not detected and will result in "spoofing" outp
ut. | | * - Non-shortest forms are not detected and will result in "spoofing" outp
ut. | |
| * | | * | |
| * For further performance improvement, if srcLength is given (>=0), | | * For further performance improvement, if srcLength is given (>=0), | |
| * then it must be destCapacity>=srcLength. | | * then it must be destCapacity>=srcLength. | |
| * | | * | |
|
| | | * There is no inverse u_strToUTF8Lenient() function because there is pract | |
| | | ically | |
| | | * no performance gain from not checking that a UTF-16 string is well-forme | |
| | | d. | |
| | | * | |
| * @param dest A buffer for the result string. The result will be
zero-terminated if | | * @param dest A buffer for the result string. The result will be
zero-terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | | * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | |
| * dest may be NULL and the function will only return
the length of the | | * dest may be NULL and the function will only return
the length of the | |
| * result without writing any of the result string (pr
e-flighting). | | * result without writing any of the result string (pr
e-flighting). | |
| * Unlike for other ICU functions, if srcLength>=0 the
n it | | * Unlike for other ICU functions, if srcLength>=0 the
n it | |
| * must be destCapacity>=srcLength. | | * must be destCapacity>=srcLength. | |
| * @param pDestLength A pointer to receive the number of units written to
the destination. If | | * @param pDestLength A pointer to receive the number of units written to
the destination. If | |
| * pDestLength!=NULL then *pDestLength is always set t
o the | | * pDestLength!=NULL then *pDestLength is always set t
o the | |
| * number of output units corresponding to the transfo
rmation of | | * number of output units corresponding to the transfo
rmation of | |
| | | | |
| skipping to change at line 1440 | | skipping to change at line 1456 | |
| */ | | */ | |
| U_STABLE UChar * U_EXPORT2 | | U_STABLE UChar * U_EXPORT2 | |
| u_strFromUTF8Lenient(UChar *dest, | | u_strFromUTF8Lenient(UChar *dest, | |
| int32_t destCapacity, | | int32_t destCapacity, | |
| int32_t *pDestLength, | | int32_t *pDestLength, | |
| const char *src, | | const char *src, | |
| int32_t srcLength, | | int32_t srcLength, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
|
| * Converts a sequence of UChars (UTF-16) to UTF32 units. | | * Convert a UTF-16 string to UTF-32. | |
| | | * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND er | |
| | | ror code is set. | |
| * | | * | |
| * @param dest A buffer for the result string. The result will be
zero-terminated if | | * @param dest A buffer for the result string. The result will be
zero-terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * @param destCapacity The size of the buffer (number of UChar32s). If it
is 0, then | | * @param destCapacity The size of the buffer (number of UChar32s). If it
is 0, then | |
| * dest may be NULL and the function will only return
the length of the | | * dest may be NULL and the function will only return
the length of the | |
| * result without writing any of the result string (pr
e-flighting). | | * result without writing any of the result string (pr
e-flighting). | |
| * @param pDestLength A pointer to receive the number of units written to
the destination. If | | * @param pDestLength A pointer to receive the number of units written to
the destination. If | |
| * pDestLength!=NULL then *pDestLength is always set t
o the | | * pDestLength!=NULL then *pDestLength is always set t
o the | |
| * number of output units corresponding to the transfo
rmation of | | * number of output units corresponding to the transfo
rmation of | |
| * all the input units, even in case of a buffer overf
low. | | * all the input units, even in case of a buffer overf
low. | |
| * @param src The original source string | | * @param src The original source string | |
| * @param srcLength The length of the original string. If -1, then src
must be zero-terminated. | | * @param srcLength The length of the original string. If -1, then src
must be zero-terminated. | |
| * @param pErrorCode Must be a valid pointer to an error code value, | | * @param pErrorCode Must be a valid pointer to an error code value, | |
| * which must not indicate a failure before the functi
on call. | | * which must not indicate a failure before the functi
on call. | |
| * @return The pointer to destination buffer. | | * @return The pointer to destination buffer. | |
|
| | | * @see u_strToUTF32WithSub | |
| | | * @see u_strFromUTF32 | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE UChar32* U_EXPORT2 | | U_STABLE UChar32* U_EXPORT2 | |
| u_strToUTF32(UChar32 *dest, | | u_strToUTF32(UChar32 *dest, | |
| int32_t destCapacity, | | int32_t destCapacity, | |
| int32_t *pDestLength, | | int32_t *pDestLength, | |
| const UChar *src, | | const UChar *src, | |
| int32_t srcLength, | | int32_t srcLength, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
|
| * Converts a sequence of UTF32 units to UChars (UTF-16) | | * Convert a UTF-32 string to UTF-16. | |
| | | * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND er | |
| | | ror code is set. | |
| * | | * | |
| * @param dest A buffer for the result string. The result will be
zero-terminated if | | * @param dest A buffer for the result string. The result will be
zero-terminated if | |
| * the buffer is large enough. | | * the buffer is large enough. | |
| * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | | * @param destCapacity The size of the buffer (number of UChars). If it is
0, then | |
| * dest may be NULL and the function will only return
the length of the | | * dest may be NULL and the function will only return
the length of the | |
| * result without writing any of the result string (pr
e-flighting). | | * result without writing any of the result string (pr
e-flighting). | |
| * @param pDestLength A pointer to receive the number of units written to
the destination. If | | * @param pDestLength A pointer to receive the number of units written to
the destination. If | |
| * pDestLength!=NULL then *pDestLength is always set t
o the | | * pDestLength!=NULL then *pDestLength is always set t
o the | |
| * number of output units corresponding to the transfo
rmation of | | * number of output units corresponding to the transfo
rmation of | |
| * all the input units, even in case of a buffer overf
low. | | * all the input units, even in case of a buffer overf
low. | |
| * @param src The original source string | | * @param src The original source string | |
| * @param srcLength The length of the original string. If -1, then src
must be zero-terminated. | | * @param srcLength The length of the original string. If -1, then src
must be zero-terminated. | |
| * @param pErrorCode Must be a valid pointer to an error code value, | | * @param pErrorCode Must be a valid pointer to an error code value, | |
| * which must not indicate a failure before the functi
on call. | | * which must not indicate a failure before the functi
on call. | |
| * @return The pointer to destination buffer. | | * @return The pointer to destination buffer. | |
|
| | | * @see u_strFromUTF32WithSub | |
| | | * @see u_strToUTF32 | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE UChar* U_EXPORT2 | | U_STABLE UChar* U_EXPORT2 | |
| u_strFromUTF32(UChar *dest, | | u_strFromUTF32(UChar *dest, | |
| int32_t destCapacity, | | int32_t destCapacity, | |
| int32_t *pDestLength, | | int32_t *pDestLength, | |
| const UChar32 *src, | | const UChar32 *src, | |
| int32_t srcLength, | | int32_t srcLength, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
|
| | | /** | |
| | | * Convert a UTF-16 string to UTF-32. | |
| | | * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND er | |
| | | ror code is set. | |
| | | * | |
| | | * Same as u_strToUTF32() except for the additional subchar which is output | |
| | | for | |
| | | * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOU | |
| | | ND error code. | |
| | | * With subchar==U_SENTINEL, this function behaves exactly like u_strToUTF3 | |
| | | 2(). | |
| | | * | |
| | | * @param dest A buffer for the result string. The result will be | |
| | | zero-terminated if | |
| | | * the buffer is large enough. | |
| | | * @param destCapacity The size of the buffer (number of UChar32s). If it | |
| | | is 0, then | |
| | | * dest may be NULL and the function will only return | |
| | | the length of the | |
| | | * result without writing any of the result string (pr | |
| | | e-flighting). | |
| | | * @param pDestLength A pointer to receive the number of units written to | |
| | | the destination. If | |
| | | * pDestLength!=NULL then *pDestLength is always set t | |
| | | o the | |
| | | * number of output units corresponding to the transfo | |
| | | rmation of | |
| | | * all the input units, even in case of a buffer overf | |
| | | low. | |
| | | * @param src The original source string | |
| | | * @param srcLength The length of the original string. If -1, then src | |
| | | must be zero-terminated. | |
| | | * @param subchar The substitution character to use in place of an il | |
| | | legal input sequence, | |
| | | * or U_SENTINEL if the function is to return with U_I | |
| | | NVALID_CHAR_FOUND instead. | |
| | | * A substitution character can be any valid Unicode c | |
| | | ode point (up to U+10FFFF) | |
| | | * except for surrogate code points (U+D800..U+DFFF). | |
| | | * The recommended value is U+FFFD "REPLACEMENT CHARAC | |
| | | TER". | |
| | | * @param pNumSubstitutions Output parameter receiving the number of substi | |
| | | tutions if subchar>=0. | |
| | | * Set to 0 if no substitutions occur or subchar<0. | |
| | | * pNumSubstitutions can be NULL. | |
| | | * @param pErrorCode Pointer to a standard ICU error code. Its input val | |
| | | ue must | |
| | | * pass the U_SUCCESS() test, or else the function ret | |
| | | urns | |
| | | * immediately. Check for U_FAILURE() on output or use | |
| | | with | |
| | | * function chaining. (See User Guide for details.) | |
| | | * @return The pointer to destination buffer. | |
| | | * @see u_strToUTF32 | |
| | | * @see u_strFromUTF32WithSub | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | U_DRAFT UChar32* U_EXPORT2 | |
| | | u_strToUTF32WithSub(UChar32 *dest, | |
| | | int32_t destCapacity, | |
| | | int32_t *pDestLength, | |
| | | const UChar *src, | |
| | | int32_t srcLength, | |
| | | UChar32 subchar, int32_t *pNumSubstitutions, | |
| | | UErrorCode *pErrorCode); | |
| | | | |
| | | /** | |
| | | * Convert a UTF-32 string to UTF-16. | |
| | | * If the input string is not well-formed, then the U_INVALID_CHAR_FOUND er | |
| | | ror code is set. | |
| | | * | |
| | | * Same as u_strFromUTF32() except for the additional subchar which is outp | |
| | | ut for | |
| | | * illegal input sequences, instead of stopping with the U_INVALID_CHAR_FOU | |
| | | ND error code. | |
| | | * With subchar==U_SENTINEL, this function behaves exactly like u_strFromUT | |
| | | F32(). | |
| | | * | |
| | | * @param dest A buffer for the result string. The result will be | |
| | | zero-terminated if | |
| | | * the buffer is large enough. | |
| | | * @param destCapacity The size of the buffer (number of UChars). If it is | |
| | | 0, then | |
| | | * dest may be NULL and the function will only return | |
| | | the length of the | |
| | | * result without writing any of the result string (pr | |
| | | e-flighting). | |
| | | * @param pDestLength A pointer to receive the number of units written to | |
| | | the destination. If | |
| | | * pDestLength!=NULL then *pDestLength is always set t | |
| | | o the | |
| | | * number of output units corresponding to the transfo | |
| | | rmation of | |
| | | * all the input units, even in case of a buffer overf | |
| | | low. | |
| | | * @param src The original source string | |
| | | * @param srcLength The length of the original string. If -1, then src | |
| | | must be zero-terminated. | |
| | | * @param subchar The substitution character to use in place of an il | |
| | | legal input sequence, | |
| | | * or U_SENTINEL if the function is to return with U_I | |
| | | NVALID_CHAR_FOUND instead. | |
| | | * A substitution character can be any valid Unicode c | |
| | | ode point (up to U+10FFFF) | |
| | | * except for surrogate code points (U+D800..U+DFFF). | |
| | | * The recommended value is U+FFFD "REPLACEMENT CHARAC | |
| | | TER". | |
| | | * @param pNumSubstitutions Output parameter receiving the number of substi | |
| | | tutions if subchar>=0. | |
| | | * Set to 0 if no substitutions occur or subchar<0. | |
| | | * pNumSubstitutions can be NULL. | |
| | | * @param pErrorCode Pointer to a standard ICU error code. Its input val | |
| | | ue must | |
| | | * pass the U_SUCCESS() test, or else the function ret | |
| | | urns | |
| | | * immediately. Check for U_FAILURE() on output or use | |
| | | with | |
| | | * function chaining. (See User Guide for details.) | |
| | | * @return The pointer to destination buffer. | |
| | | * @see u_strFromUTF32 | |
| | | * @see u_strToUTF32WithSub | |
| | | * @draft ICU 4.2 | |
| | | */ | |
| | | U_DRAFT UChar* U_EXPORT2 | |
| | | u_strFromUTF32WithSub(UChar *dest, | |
| | | int32_t destCapacity, | |
| | | int32_t *pDestLength, | |
| | | const UChar32 *src, | |
| | | int32_t srcLength, | |
| | | UChar32 subchar, int32_t *pNumSubstitutions, | |
| | | UErrorCode *pErrorCode); | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 15 change blocks. |
| 13 lines changed or deleted | | 179 lines changed or added | |
|
| vtzone.h | | vtzone.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 2007-2008, International Business Machines Corporation and
* | | * Copyright (C) 2007-2009, International Business Machines Corporation and
* | |
| * others. All Rights Reserved.
* | | * others. All Rights Reserved.
* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| */ | | */ | |
| #ifndef VTZONE_H | | #ifndef VTZONE_H | |
| #define VTZONE_H | | #define VTZONE_H | |
| | | | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| | | | |
| /** | | /** | |
| * \file | | * \file | |
| | | | |
| skipping to change at line 371 | | skipping to change at line 371 | |
| void writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) /*c
onst*/; | | void writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) /*c
onst*/; | |
| void load(VTZReader& reader, UErrorCode& status); | | void load(VTZReader& reader, UErrorCode& status); | |
| void parse(UErrorCode& status); | | void parse(UErrorCode& status); | |
| | | | |
| void writeZone(VTZWriter& w, BasicTimeZone& basictz, UVector* customPro
ps, | | void writeZone(VTZWriter& w, BasicTimeZone& basictz, UVector* customPro
ps, | |
| UErrorCode& status) const; | | UErrorCode& status) const; | |
| | | | |
| void writeHeaders(VTZWriter& w, UErrorCode& status) const; | | void writeHeaders(VTZWriter& w, UErrorCode& status) const; | |
| void writeFooter(VTZWriter& writer, UErrorCode& status) const; | | void writeFooter(VTZWriter& writer, UErrorCode& status) const; | |
| | | | |
|
| void writeZonePropsByTime(VTZWriter& writer, UBool isDst, const Unicode
String& tzname, | | void writeZonePropsByTime(VTZWriter& writer, UBool isDst, const Unicode
String& zonename, | |
| int32_t fromOffset, int32_t toOffset, UDate t
ime, UBool withRDATE, | | int32_t fromOffset, int32_t toOffset, UDate t
ime, UBool withRDATE, | |
| UErrorCode& status) const; | | UErrorCode& status) const; | |
|
| void writeZonePropsByDOM(VTZWriter& writer, UBool isDst, const UnicodeS
tring& tzname, | | void writeZonePropsByDOM(VTZWriter& writer, UBool isDst, const UnicodeS
tring& zonename, | |
| int32_t fromOffset, int32_t toOffset, | | int32_t fromOffset, int32_t toOffset, | |
| int32_t month, int32_t dayOfMonth, UDate start
Time, UDate untilTime, | | int32_t month, int32_t dayOfMonth, UDate start
Time, UDate untilTime, | |
| UErrorCode& status) const; | | UErrorCode& status) const; | |
|
| void writeZonePropsByDOW(VTZWriter& writer, UBool isDst, const UnicodeS
tring& tzname, | | void writeZonePropsByDOW(VTZWriter& writer, UBool isDst, const UnicodeS
tring& zonename, | |
| int32_t fromOffset, int32_t toOffset, | | int32_t fromOffset, int32_t toOffset, | |
| int32_t month, int32_t weekInMonth, int32_t da
yOfWeek, | | int32_t month, int32_t weekInMonth, int32_t da
yOfWeek, | |
| UDate startTime, UDate untilTime, UErrorCode&
status) const; | | UDate startTime, UDate untilTime, UErrorCode&
status) const; | |
|
| void writeZonePropsByDOW_GEQ_DOM(VTZWriter& writer, UBool isDst, const
UnicodeString& tzname, | | void writeZonePropsByDOW_GEQ_DOM(VTZWriter& writer, UBool isDst, const
UnicodeString& zonename, | |
| int32_t fromOffset, int32_t toOffset, | | int32_t fromOffset, int32_t toOffset, | |
| int32_t month, int32_t dayOfMonth, int
32_t dayOfWeek, | | int32_t month, int32_t dayOfMonth, int
32_t dayOfWeek, | |
| UDate startTime, UDate untilTime, UErr
orCode& status) const; | | UDate startTime, UDate untilTime, UErr
orCode& status) const; | |
| void writeZonePropsByDOW_GEQ_DOM_sub(VTZWriter& writer, int32_t month,
int32_t dayOfMonth, | | void writeZonePropsByDOW_GEQ_DOM_sub(VTZWriter& writer, int32_t month,
int32_t dayOfMonth, | |
| int32_t dayOfWeek, int32_t numDays
, | | int32_t dayOfWeek, int32_t numDays
, | |
| UDate untilTime, int32_t fromOffse
t, UErrorCode& status) const; | | UDate untilTime, int32_t fromOffse
t, UErrorCode& status) const; | |
|
| void writeZonePropsByDOW_LEQ_DOM(VTZWriter& writer, UBool isDst, const
UnicodeString& tzname, | | void writeZonePropsByDOW_LEQ_DOM(VTZWriter& writer, UBool isDst, const
UnicodeString& zonename, | |
| int32_t fromOffset, int32_t toOffset, | | int32_t fromOffset, int32_t toOffset, | |
| int32_t month, int32_t dayOfMonth, int
32_t dayOfWeek, | | int32_t month, int32_t dayOfMonth, int
32_t dayOfWeek, | |
| UDate startTime, UDate untilTime, UErr
orCode& status) const; | | UDate startTime, UDate untilTime, UErr
orCode& status) const; | |
| void writeFinalRule(VTZWriter& writer, UBool isDst, const AnnualTimeZon
eRule* rule, | | void writeFinalRule(VTZWriter& writer, UBool isDst, const AnnualTimeZon
eRule* rule, | |
| int32_t fromRawOffset, int32_t fromDSTSavings, | | int32_t fromRawOffset, int32_t fromDSTSavings, | |
| UDate startTime, UErrorCode& status) const; | | UDate startTime, UErrorCode& status) const; | |
| | | | |
|
| void beginZoneProps(VTZWriter& writer, UBool isDst, const UnicodeString
& tzname, | | void beginZoneProps(VTZWriter& writer, UBool isDst, const UnicodeString
& zonename, | |
| int32_t fromOffset, int32_t toOffset, UDate startTi
me, UErrorCode& status) const; | | int32_t fromOffset, int32_t toOffset, UDate startTi
me, UErrorCode& status) const; | |
| void endZoneProps(VTZWriter& writer, UBool isDst, UErrorCode& status) c
onst; | | void endZoneProps(VTZWriter& writer, UBool isDst, UErrorCode& status) c
onst; | |
| void beginRRULE(VTZWriter& writer, int32_t month, UErrorCode& status) c
onst; | | void beginRRULE(VTZWriter& writer, int32_t month, UErrorCode& status) c
onst; | |
| void appendUNTIL(VTZWriter& writer, const UnicodeString& until, UErrorC
ode& status) const; | | void appendUNTIL(VTZWriter& writer, const UnicodeString& until, UErrorC
ode& status) const; | |
| | | | |
| BasicTimeZone *tz; | | BasicTimeZone *tz; | |
| UVector *vtzlines; | | UVector *vtzlines; | |
| UnicodeString tzurl; | | UnicodeString tzurl; | |
| UDate lastmod; | | UDate lastmod; | |
| UnicodeString olsonzid; | | UnicodeString olsonzid; | |
| | | | |
End of changes. 7 change blocks. |
| 7 lines changed or deleted | | 7 lines changed or added | |
|