| LETypes.h | | LETypes.h | |
| /* | | /* | |
| * | | * | |
|
| * (C) Copyright IBM Corp. 1998-2012 - All Rights Reserved | | * (C) Copyright IBM Corp. and others 1998-2013 - 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 450 | | skipping to change at line 450 | |
| 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_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 514 | | skipping to change at line 514 | |
| 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_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' */ | |
| | | | |
| skipping to change at line 566 | | skipping to change at line 566 | |
| LE_VHAL_FEATURE_TAG = 0x7668616CUL, /**< 'vhal' */ | | LE_VHAL_FEATURE_TAG = 0x7668616CUL, /**< 'vhal' */ | |
| LE_VJMO_FEATURE_TAG = 0x766A6D6FUL, /**< 'vjmo' */ | | LE_VJMO_FEATURE_TAG = 0x766A6D6FUL, /**< 'vjmo' */ | |
| LE_VKNA_FEATURE_TAG = 0x766B6E61UL, /**< 'vkna' */ | | LE_VKNA_FEATURE_TAG = 0x766B6E61UL, /**< 'vkna' */ | |
| LE_VKRN_FEATURE_TAG = 0x766B726EUL, /**< 'vkrn' */ | | LE_VKRN_FEATURE_TAG = 0x766B726EUL, /**< 'vkrn' */ | |
| LE_VPAL_FEATURE_TAG = 0x7670616CUL, /**< 'vpal' */ | | LE_VPAL_FEATURE_TAG = 0x7670616CUL, /**< 'vpal' */ | |
| LE_VRT2_FEATURE_TAG = 0x76727432UL, /**< 'vrt2' */ | | LE_VRT2_FEATURE_TAG = 0x76727432UL, /**< 'vrt2' */ | |
| LE_ZERO_FEATURE_TAG = 0x7A65726FUL /**< 'zero' */ | | LE_ZERO_FEATURE_TAG = 0x7A65726FUL /**< 'zero' */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
|
| | | * @internal | |
| | | */ | |
| | | enum LEFeatureENUMs { | |
| | | LE_Kerning_FEATURE_ENUM = 0, /**< Requests Kerning. Formerly LayoutEngi | |
| | | ne::kTypoFlagKern */ | |
| | | LE_Ligatures_FEATURE_ENUM = 1, /**< Requests Ligatures. Formerly LayoutEn | |
| | | gine::kTypoFlagLiga */ | |
| | | LE_CLIG_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_DLIG_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_HLIG_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_LIGA_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_RLIG_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SMCP_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_FRAC_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_AFRC_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_ZERO_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SWSH_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_CSWH_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SALT_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_NALT_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_RUBY_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SS01_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SS02_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SS03_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SS04_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SS05_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SS06_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | LE_SS07_FEATURE_ENUM, /**< Feature specific enum */ | |
| | | | |
| | | LE_CHAR_FILTER_FEATURE_ENUM = 31, /**< Apply CharSubstitutionFilter */ | |
| | | LE_FEATURE_ENUM_MAX = LE_CHAR_FILTER_FEATURE_ENUM | |
| | | }; | |
| | | | |
| | | /** | |
| | | * Flags for typographic features. | |
| | | * @internal | |
| | | * @{ | |
| | | */ | |
| | | #define LE_Kerning_FEATURE_FLAG (1 << LE_Kerning_FEATURE_ENUM) | |
| | | #define LE_Ligatures_FEATURE_FLAG (1 << LE_Ligatures_FEATURE_ENUM) | |
| | | #define LE_CLIG_FEATURE_FLAG (1 << LE_CLIG_FEATURE_ENUM) | |
| | | #define LE_DLIG_FEATURE_FLAG (1 << LE_DLIG_FEATURE_ENUM) | |
| | | #define LE_HLIG_FEATURE_FLAG (1 << LE_HLIG_FEATURE_ENUM) | |
| | | #define LE_LIGA_FEATURE_FLAG (1 << LE_LIGA_FEATURE_ENUM) | |
| | | #define LE_RLIG_FEATURE_FLAG (1 << LE_RLIG_FEATURE_ENUM) | |
| | | #define LE_SMCP_FEATURE_FLAG (1 << LE_SMCP_FEATURE_ENUM) | |
| | | #define LE_FRAC_FEATURE_FLAG (1 << LE_FRAC_FEATURE_ENUM) | |
| | | #define LE_AFRC_FEATURE_FLAG (1 << LE_AFRC_FEATURE_ENUM) | |
| | | #define LE_ZERO_FEATURE_FLAG (1 << LE_ZERO_FEATURE_ENUM) | |
| | | #define LE_SWSH_FEATURE_FLAG (1 << LE_SWSH_FEATURE_ENUM) | |
| | | #define LE_CSWH_FEATURE_FLAG (1 << LE_CSWH_FEATURE_ENUM) | |
| | | #define LE_SALT_FEATURE_FLAG (1 << LE_SALT_FEATURE_ENUM) | |
| | | #define LE_NALT_FEATURE_FLAG (1 << LE_NALT_FEATURE_ENUM) | |
| | | #define LE_RUBY_FEATURE_FLAG (1 << LE_RUBY_FEATURE_ENUM) | |
| | | #define LE_SS01_FEATURE_FLAG (1 << LE_SS01_FEATURE_ENUM) | |
| | | #define LE_SS02_FEATURE_FLAG (1 << LE_SS02_FEATURE_ENUM) | |
| | | #define LE_SS03_FEATURE_FLAG (1 << LE_SS03_FEATURE_ENUM) | |
| | | #define LE_SS04_FEATURE_FLAG (1 << LE_SS04_FEATURE_ENUM) | |
| | | #define LE_SS05_FEATURE_FLAG (1 << LE_SS05_FEATURE_ENUM) | |
| | | #define LE_SS06_FEATURE_FLAG (1 << LE_SS06_FEATURE_ENUM) | |
| | | #define LE_SS07_FEATURE_FLAG (1 << LE_SS07_FEATURE_ENUM) | |
| | | | |
| | | #define LE_CHAR_FILTER_FEATURE_FLAG (1 << LE_CHAR_FILTER_FEATURE_ENUM) | |
| | | /** | |
| | | * @} | |
| | | */ | |
| | | | |
| | | /** | |
| * Error codes returned by the LayoutEngine. | | * Error codes returned by the LayoutEngine. | |
| * | | * | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| enum LEErrorCode { | | enum LEErrorCode { | |
| /* informational */ | | /* informational */ | |
| LE_NO_SUBFONT_WARNING = U_USING_DEFAULT_WARNING, /**< The font
does not contain subfonts. */ | | LE_NO_SUBFONT_WARNING = U_USING_DEFAULT_WARNING, /**< The font
does not contain subfonts. */ | |
| | | | |
| /* success */ | | /* success */ | |
| LE_NO_ERROR = U_ZERO_ERROR, /**< No error, no warni
ng. */ | | LE_NO_ERROR = U_ZERO_ERROR, /**< No error, no warni
ng. */ | |
| | | | |
End of changes. 4 change blocks. |
| 3 lines changed or deleted | | 71 lines changed or added | |
|
| alphaindex.h | | alphaindex.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
|
| * Copyright (C) 2011-2012 International Business Machines | | * Copyright (C) 2011-2013 International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| * | | * | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| */ | | */ | |
| | | | |
| #ifndef INDEXCHARS_H | | #ifndef INDEXCHARS_H | |
| #define INDEXCHARS_H | | #define INDEXCHARS_H | |
| | | | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| #include "unicode/uobject.h" | | #include "unicode/uobject.h" | |
| | | | |
| skipping to change at line 72 | | skipping to change at line 72 | |
| U_ALPHAINDEX_OVERFLOW = 3 | | U_ALPHAINDEX_OVERFLOW = 3 | |
| } UAlphabeticIndexLabelType; | | } UAlphabeticIndexLabelType; | |
| | | | |
| struct UHashtable; | | struct UHashtable; | |
| U_CDECL_END | | U_CDECL_END | |
| | | | |
| U_NAMESPACE_BEGIN | | U_NAMESPACE_BEGIN | |
| | | | |
| // Forward Declarations | | // Forward Declarations | |
| | | | |
|
| | | class BucketList; | |
| class Collator; | | class Collator; | |
| class RuleBasedCollator; | | class RuleBasedCollator; | |
| class StringEnumeration; | | class StringEnumeration; | |
| class UnicodeSet; | | class UnicodeSet; | |
| class UVector; | | class UVector; | |
| | | | |
| /** | | /** | |
|
| * class AlphabeticIndex supports the creation of a UI index appropriate fo | | * AlphabeticIndex supports the creation of a UI index appropriate for a gi | |
| r a given language, such as: | | ven language. | |
| | | * It can support either direct use, or use with a client that doesn't supp | |
| | | ort localized collation. | |
| | | * The following is an example of what an index might look like in a UI: | |
| * | | * | |
| * <pre> | | * <pre> | |
|
| * <b>... A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \\u00C6 \\u0
0D8 \\u00C5 ...</b> | | * <b>... A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ...</b> | |
| * | | * | |
| * <b>A</b> | | * <b>A</b> | |
| * Addison | | * Addison | |
| * Albertson | | * Albertson | |
| * Azensky | | * Azensky | |
| * <b>B</b> | | * <b>B</b> | |
| * Baker | | * Baker | |
| * ... | | * ... | |
| * </pre> | | * </pre> | |
| * | | * | |
| | | | |
| skipping to change at line 106 | | skipping to change at line 109 | |
| * the target list, where everything in the bucket is greater than or equal
to the character | | * the target list, where everything in the bucket is greater than or equal
to the character | |
| * (according to the locale's collation). Strings can be added to the index
; | | * (according to the locale's collation). Strings can be added to the index
; | |
| * they will be in sorted order in the right bucket. | | * they will be in sorted order in the right bucket. | |
| * <p> | | * <p> | |
| * The class also supports having buckets for strings before the first (und
erflow), | | * The class also supports having buckets for strings before the first (und
erflow), | |
| * after the last (overflow), and between scripts (inflow). For example, if
the index | | * after the last (overflow), and between scripts (inflow). For example, if
the index | |
| * is constructed with labels for Russian and English, Greek characters wou
ld fall | | * is constructed with labels for Russian and English, Greek characters wou
ld fall | |
| * into an inflow bucket between the other two scripts. | | * into an inflow bucket between the other two scripts. | |
| * <p> | | * <p> | |
| * The AlphabeticIndex class is not intended for public subclassing. | | * The AlphabeticIndex class is not intended for public subclassing. | |
|
| * <p> | | * | |
| * <i>Example</i> | | * <p><em>Note:</em> If you expect to have a lot of ASCII or Latin characte | |
| * <p> | | rs | |
| * The "show..." methods below are just to illustrate usage. | | * as well as characters from the user's language, | |
| | | * then it is a good idea to call addLabels(Locale::getEnglish(), status).< | |
| | | /p> | |
| | | * | |
| | | * <h2>Direct Use</h2> | |
| | | * <p>The following shows an example of building an index directly. | |
| | | * The "show..." methods below are just to illustrate usage. | |
| * | | * | |
| * <pre> | | * <pre> | |
| * // Create a simple index. "Item" is assumed to be an application | | * // Create a simple index. "Item" is assumed to be an application | |
| * // defined type that the application's UI and other processing knows abo
ut, | | * // defined type that the application's UI and other processing knows abo
ut, | |
| * // and that has a name. | | * // and that has a name. | |
| * | | * | |
| * UErrorCode status = U_ZERO_ERROR; | | * UErrorCode status = U_ZERO_ERROR; | |
| * AlphabeticIndex index = new AlphabeticIndex(desiredLocale, status); | | * AlphabeticIndex index = new AlphabeticIndex(desiredLocale, status); | |
| * index->addLabels(additionalLocale, status); | | * index->addLabels(additionalLocale, status); | |
| * for (Item *item in some source of Items ) { | | * for (Item *item in some source of Items ) { | |
| | | | |
| skipping to change at line 149 | | skipping to change at line 156 | |
| * </pre> | | * </pre> | |
| * | | * | |
| * The caller can build different UIs using this class. | | * The caller can build different UIs using this class. | |
| * For example, an index character could be omitted or grayed-out | | * For example, an index character could be omitted or grayed-out | |
| * if its bucket is empty. Small buckets could also be combined based on si
ze, such as: | | * if its bucket is empty. Small buckets could also be combined based on si
ze, such as: | |
| * | | * | |
| * <pre> | | * <pre> | |
| * <b>... A-F G-N O-Z ...</b> | | * <b>... A-F G-N O-Z ...</b> | |
| * </pre> | | * </pre> | |
| * | | * | |
|
| * <p> | | * <h2>Client Support</h2> | |
| * <b>Notes:</b> | | * <p>Callers can also use the AlphabeticIndex::ImmutableIndex, or the Alph | |
| | | abeticIndex itself, | |
| | | * to support sorting on a client that doesn't support AlphabeticIndex func | |
| | | tionality. | |
| | | * | |
| | | * <p>The ImmutableIndex is both immutable and thread-safe. | |
| | | * The corresponding AlphabeticIndex methods are not thread-safe because | |
| | | * they "lazily" build the index buckets. | |
| * <ul> | | * <ul> | |
|
| * <li>Additional collation parameters can be passed in as part of the loca | | * <li>ImmutableIndex.getBucket(index) provides random access to all | |
| le name. | | * buckets and their labels and label types. | |
| * For example, German plus numeric | | * <li>The AlphabeticIndex bucket iterator or ImmutableIndex.getBucket(0..g | |
| * sorting would be "de@kn-true". | | etBucketCount-1) | |
| | | * can be used to get a list of the labels, | |
| | | * such as "...", "A", "B",..., and send that list to the client. | |
| | | * <li>When the client has a new name, it sends that name to the server. | |
| | | * The server needs to call the following methods, | |
| | | * and communicate the bucketIndex and collationKey back to the client. | |
| | | * | |
| | | * <pre> | |
| | | * int32_t bucketIndex = index.getBucketIndex(name, status); | |
| | | * const UnicodeString &label = immutableIndex.getBucket(bucketIndex)->getL | |
| | | abel(); // optional | |
| | | * int32_t skLength = collator.getSortKey(name, sk, skCapacity); | |
| | | * </pre> | |
| | | * | |
| | | * <li>The client would put the name (and associated information) into its | |
| | | bucket for bucketIndex. The sort key sk is a | |
| | | * sequence of bytes that can be compared with a binary compare, and produc | |
| | | e the right localized result.</li> | |
| * </ul> | | * </ul> | |
| * | | * | |
| * @stable ICU 4.8 | | * @stable ICU 4.8 | |
| */ | | */ | |
|
| | | | |
| class U_I18N_API AlphabeticIndex: public UObject { | | class U_I18N_API AlphabeticIndex: public UObject { | |
|
| | | public: | |
| | | #ifdef U_HIDE_DRAFT_API | |
| | | class Bucket; | |
| | | #else | |
| | | /** | |
| | | * An index "bucket" with a label string and type. | |
| | | * It is referenced by getBucketIndex(), | |
| | | * and returned by ImmutableIndex.getBucket(). | |
| | | * | |
| | | * The Bucket class is not intended for public subclassing. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | class U_I18N_API Bucket : public UObject { | |
| | | public: | |
| | | /** | |
| | | * Destructor. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | virtual ~Bucket(); | |
| | | | |
| | | /** | |
| | | * Returns the label string. | |
| | | * | |
| | | * @return the label string for the bucket | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | const UnicodeString &getLabel() const { return label_; } | |
| | | /** | |
| | | * Returns whether this bucket is a normal, underflow, overflow, or | |
| | | inflow bucket. | |
| | | * | |
| | | * @return the bucket label type | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UAlphabeticIndexLabelType getLabelType() const { return labelType_; | |
| | | } | |
| | | | |
| | | private: | |
| | | friend class AlphabeticIndex; | |
| | | friend class BucketList; | |
| | | | |
| | | UnicodeString label_; | |
| | | UnicodeString lowerBoundary_; | |
| | | UAlphabeticIndexLabelType labelType_; | |
| | | Bucket *displayBucket_; | |
| | | int32_t displayIndex_; | |
| | | UVector *records_; // Records are owned by the inputList_ vector. | |
| | | | |
| | | Bucket(const UnicodeString &label, // Parameter strings are copie | |
| | | d. | |
| | | const UnicodeString &lowerBoundary, | |
| | | UAlphabeticIndexLabelType type); | |
| | | }; | |
| | | | |
|
| public: | | /** | |
| | | * Immutable, thread-safe version of AlphabeticIndex. | |
| | | * This class provides thread-safe methods for bucketing, | |
| | | * and random access to buckets and their properties, | |
| | | * but does not offer adding records to the index. | |
| | | * | |
| | | * The ImmutableIndex class is not intended for public subclassing. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | class U_I18N_API ImmutableIndex : public UObject { | |
| | | public: | |
| | | /** | |
| | | * Destructor. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | virtual ~ImmutableIndex(); | |
| | | | |
| | | /** | |
| | | * Returns the number of index buckets and labels, including underf | |
| | | low/inflow/overflow. | |
| | | * | |
| | | * @return the number of index buckets | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | int32_t getBucketCount() const; | |
| | | | |
| | | /** | |
| | | * Finds the index bucket for the given name and returns the number | |
| | | of that bucket. | |
| | | * Use getBucket() to get the bucket's properties. | |
| | | * | |
| | | * @param name the string to be sorted into an index bucket | |
| | | * @return the bucket number for the name | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | int32_t getBucketIndex(const UnicodeString &name, UErrorCode &error | |
| | | Code) const; | |
| | | | |
| | | /** | |
| | | * Returns the index-th bucket. Returns NULL if the index is out of | |
| | | range. | |
| | | * | |
| | | * @param index bucket number | |
| | | * @return the index-th bucket | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | const Bucket *getBucket(int32_t index) const; | |
| | | | |
| | | private: | |
| | | friend class AlphabeticIndex; | |
| | | | |
| | | ImmutableIndex(BucketList *bucketList, Collator *collatorPrimaryOnl | |
| | | y) | |
| | | : buckets_(bucketList), collatorPrimaryOnly_(collatorPrimar | |
| | | yOnly) {} | |
| | | | |
| | | BucketList *buckets_; | |
| | | Collator *collatorPrimaryOnly_; | |
| | | }; | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Construct an AlphabeticIndex object for the specified locale. If th
e locale's | | * Construct an AlphabeticIndex object for the specified locale. If th
e locale's | |
| * data does not include index characters, a set of them will be | | * data does not include index characters, a set of them will be | |
| * synthesized based on the locale's exemplar characters. The locale | | * synthesized based on the locale's exemplar characters. The locale | |
| * determines the sorting order for both the index characters and the | | * determines the sorting order for both the index characters and the | |
| * user item names appearing under each Index character. | | * user item names appearing under each Index character. | |
| * | | * | |
| * @param locale the desired locale. | | * @param locale the desired locale. | |
| * @param status Error code, will be set with the reason if the constru
ction | | * @param status Error code, will be set with the reason if the constru
ction | |
| * of the AlphabeticIndex object fails. | | * of the AlphabeticIndex object fails. | |
| * @stable ICU 4.8 | | * @stable ICU 4.8 | |
| */ | | */ | |
| AlphabeticIndex(const Locale &locale, UErrorCode &status); | | AlphabeticIndex(const Locale &locale, UErrorCode &status); | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Construct an AlphabeticIndex that uses a specific collator. | |
| | | * | |
| | | * The index will be created with no labels; the addLabels() function m | |
| | | ust be called | |
| | | * after creation to add the desired labels to the index. | |
| | | * | |
| | | * The index adopts the collator, and is responsible for deleting it. | |
| | | * The caller should make no further use of the collator after creating | |
| | | the index. | |
| | | * | |
| | | * @param collator The collator to use to order the contents of this in | |
| | | dex. | |
| | | * @param status Error code, will be set with the reason if the | |
| | | * operation fails. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | AlphabeticIndex(RuleBasedCollator *collator, UErrorCode &status); | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Add Labels to this Index. The labels are additions to those | | * Add Labels to this Index. The labels are additions to those | |
| * that are already in the index; they do not replace the existing | | * that are already in the index; they do not replace the existing | |
| * ones. | | * ones. | |
| * @param additions The additional characters to add to the index, such
as A-Z. | | * @param additions The additional characters to add to the index, such
as A-Z. | |
| * @param status Error code, will be set with the reason if the | | * @param status Error code, will be set with the reason if the | |
| * operation fails. | | * operation fails. | |
| * @return this, for chaining | | * @return this, for chaining | |
| * @stable ICU 4.8 | | * @stable ICU 4.8 | |
| */ | | */ | |
|
| virtual AlphabeticIndex &addLabels(const UnicodeSet &additions, UError
Code &status); | | virtual AlphabeticIndex &addLabels(const UnicodeSet &additions, UErrorC
ode &status); | |
| | | | |
| /** | | /** | |
| * Add the index characters from a Locale to the index. The labels | | * Add the index characters from a Locale to the index. The labels | |
| * are added to those that are already in the index; they do not replac
e the | | * are added to those that are already in the index; they do not replac
e the | |
| * existing index characters. The collation order for this index is no
t | | * existing index characters. The collation order for this index is no
t | |
| * changed; it remains that of the locale that was originally specified | | * changed; it remains that of the locale that was originally specified | |
| * when creating this Index. | | * when creating this Index. | |
| * | | * | |
| * @param locale The locale whose index characters are to be added. | | * @param locale The locale whose index characters are to be added. | |
| * @param status Error code, will be set with the reason if the | | * @param status Error code, will be set with the reason if the | |
| * operation fails. | | * operation fails. | |
| * @return this, for chaining | | * @return this, for chaining | |
| * @stable ICU 4.8 | | * @stable ICU 4.8 | |
| */ | | */ | |
|
| virtual AlphabeticIndex &addLabels(const Locale &locale, UErrorCode &s
tatus); | | virtual AlphabeticIndex &addLabels(const Locale &locale, UErrorCode &st
atus); | |
| | | | |
| /** | | /** | |
| * Destructor | | * Destructor | |
| * @stable ICU 4.8 | | * @stable ICU 4.8 | |
| */ | | */ | |
|
| virtual ~AlphabeticIndex(); | | virtual ~AlphabeticIndex(); | |
| | | | |
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Builds an immutable, thread-safe version of this instance, without d | |
| | | ata records. | |
| | | * | |
| | | * @return an immutable index instance | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | ImmutableIndex *buildImmutableIndex(UErrorCode &errorCode); | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Get the Collator that establishes the ordering of the items in this
index. | | * Get the Collator that establishes the ordering of the items in this
index. | |
| * Ownership of the collator remains with the AlphabeticIndex instance. | | * Ownership of the collator remains with the AlphabeticIndex instance. | |
| * | | * | |
| * The returned collator is a reference to the internal collator used b
y this | | * The returned collator is a reference to the internal collator used b
y this | |
| * index. It may be safely used to compare the names of items or to ge
t | | * index. It may be safely used to compare the names of items or to ge
t | |
| * sort keys for names. However if any settings need to be changed, | | * sort keys for names. However if any settings need to be changed, | |
| * or other non-const methods called, a cloned copy must be made first. | | * or other non-const methods called, a cloned copy must be made first. | |
| * | | * | |
| | | | |
| skipping to change at line 312 | | skipping to change at line 469 | |
| * A more sophisticated mechanism may be available in the future. | | * A more sophisticated mechanism may be available in the future. | |
| * | | * | |
| * @param maxLabelCount the maximum number of labels. | | * @param maxLabelCount the maximum number of labels. | |
| * @param status error code | | * @param status error code | |
| * @return This, for chaining | | * @return This, for chaining | |
| * @stable ICU 4.8 | | * @stable ICU 4.8 | |
| */ | | */ | |
| virtual AlphabeticIndex &setMaxLabelCount(int32_t maxLabelCount, UError
Code &status); | | virtual AlphabeticIndex &setMaxLabelCount(int32_t maxLabelCount, UError
Code &status); | |
| | | | |
| /** | | /** | |
|
| * Get the Unicode character (or tailored string) that defines an overf | | | |
| low bucket; | | | |
| * that is anything greater than or equal to that string should go in t | | | |
| hat bucket, | | | |
| * instead of with the last character. Normally that is the first chara | | | |
| cter of the script | | | |
| * after lowerLimit. Thus in X Y Z ... <i>Devanagari-ka</i>, the overfl | | | |
| ow character for Z | | | |
| * would be the <i>Greek-alpha</i>. | | | |
| * | | | |
| * @param lowerLimit The character below the overflow (or inflow) buc | | | |
| ket | | | |
| * @param status error code | | | |
| * @return string that defines top of the overflow buck for lowerLimit, | | | |
| or an empty string if there is none | | | |
| * @internal | | | |
| */ | | | |
| virtual const UnicodeString &getOverflowComparisonString(const UnicodeS | | | |
| tring &lowerLimit, | | | |
| UErrorCode &st | | | |
| atus); | | | |
| | | | |
| /** | | | |
| * Add a record to the index. Each record will be associated with an i
ndex Bucket | | * Add a record to the index. Each record will be associated with an i
ndex Bucket | |
| * based on the record's name. The list of records for each bucket wi
ll be sorted | | * based on the record's name. The list of records for each bucket wi
ll be sorted | |
| * based on the collation ordering of the names in the index's locale. | | * based on the collation ordering of the names in the index's locale. | |
| * Records with duplicate names are permitted; they will be kept in th
e order | | * Records with duplicate names are permitted; they will be kept in th
e order | |
| * that they were added. | | * that they were added. | |
| * | | * | |
| * @param name The display name for the Record. The Record will be pla
ced in | | * @param name The display name for the Record. The Record will be pla
ced in | |
| * a bucket based on this name. | | * a bucket based on this name. | |
| * @param data An optional pointer to user data associated with this | | * @param data An optional pointer to user data associated with this | |
| * item. When iterating the contents of a bucket, both the | | * item. When iterating the contents of a bucket, both the | |
| | | | |
| skipping to change at line 490 | | skipping to change at line 632 | |
| | | | |
| /** | | /** | |
| * Reset the Record iterator position to before the first Record in the
current Bucket. | | * Reset the Record iterator position to before the first Record in the
current Bucket. | |
| * | | * | |
| * @return This, for chaining. | | * @return This, for chaining. | |
| * @stable ICU 4.8 | | * @stable ICU 4.8 | |
| */ | | */ | |
| virtual AlphabeticIndex &resetRecordIterator(); | | virtual AlphabeticIndex &resetRecordIterator(); | |
| | | | |
| private: | | private: | |
|
| // No ICU "poor man's RTTI" for this class nor its subclasses. | | | |
| virtual UClassID getDynamicClassID() const; | | | |
| | | | |
| /** | | /** | |
| * No Copy constructor. | | * No Copy constructor. | |
| * @internal | | * @internal | |
| */ | | */ | |
| AlphabeticIndex(const AlphabeticIndex &other); | | AlphabeticIndex(const AlphabeticIndex &other); | |
| | | | |
| /** | | /** | |
| * No assignment. | | * No assignment. | |
| */ | | */ | |
| AlphabeticIndex &operator =(const AlphabeticIndex & /*other*/) { retur
n *this;}; | | AlphabeticIndex &operator =(const AlphabeticIndex & /*other*/) { retur
n *this;}; | |
| | | | |
| skipping to change at line 517 | | skipping to change at line 656 | |
| */ | | */ | |
| virtual UBool operator==(const AlphabeticIndex& other) const; | | virtual UBool operator==(const AlphabeticIndex& other) const; | |
| | | | |
| /** | | /** | |
| * Inequality operator. | | * Inequality operator. | |
| * @internal | | * @internal | |
| */ | | */ | |
| virtual UBool operator!=(const AlphabeticIndex& other) const; | | virtual UBool operator!=(const AlphabeticIndex& other) const; | |
| | | | |
| // Common initialization, for use from all constructors. | | // Common initialization, for use from all constructors. | |
|
| void init(UErrorCode &status); | | void init(const Locale *locale, UErrorCode &status); | |
| | | | |
| // Initialize & destruct static constants used by this class. | | | |
| static void staticInit(UErrorCode &status); | | | |
| | | | |
| // Pinyin stuff. If the input name is Chinese, add the Pinyin prefix | | | |
| to the dest string. | | | |
| void hackName(UnicodeString &dest, const UnicodeString &name, const Co | | | |
| llator *coll); | | | |
| void initPinyinBounds(const Collator *coll, UErrorCode &status); | | | |
| | | | |
| public: | | | |
| #ifndef U_HIDE_INTERNAL_API | | | |
| /** | | | |
| * Delete all shared (static) data associated with an AlphabeticInde | | | |
| x. | | | |
| * Internal function, not intended for direct use. | | | |
| * @internal. | | | |
| */ | | | |
| static void staticCleanup(); | | | |
| #endif /* U_HIDE_INTERNAL_API */ | | | |
| private: | | | |
| | | | |
|
| // Add index characters from the specified locale to the dest set. | | /** | |
| // Does not remove any previous contents from dest. | | * This method is called to get the index exemplars. Normally these com | |
| static void getIndexExemplars(UnicodeSet &dest, const Locale &locale, | | e from the locale directly, | |
| UErrorCode &status); | | * but if they aren't available, we have to synthesize them. | |
| | | */ | |
| UVector *firstStringsInScript(UErrorCode &status); | | void addIndexExemplars(const Locale &locale, UErrorCode &status); | |
| | | /** | |
| | | * Add Chinese index characters from the tailoring. | |
| | | */ | |
| | | UBool addChineseIndexCharacters(UErrorCode &errorCode); | |
| | | | |
|
| static UnicodeString separated(const UnicodeString &item); | | UVector *firstStringsInScript(UErrorCode &status); | |
| | | | |
|
| static UnicodeSet *getScriptSet(UnicodeSet &dest, const UnicodeString
&codePoint, UErrorCode &status); | | static UnicodeString separated(const UnicodeString &item); | |
| | | | |
|
| void buildIndex(UErrorCode &status); | | /** | |
| void buildBucketList(UErrorCode &status); | | * Determine the best labels to use. | |
| void bucketRecords(UErrorCode &status); | | * This is based on the exemplars, but we also process to make sure tha | |
| | | t they are unique, | |
| | | * and sort differently, and that the overall list is small enough. | |
| | | */ | |
| | | void initLabels(UVector &indexCharacters, UErrorCode &errorCode) const; | |
| | | BucketList *createBucketList(UErrorCode &errorCode) const; | |
| | | void initBuckets(UErrorCode &errorCode); | |
| | | void clearBuckets(); | |
| | | void internalResetBucketIterator(); | |
| | | | |
|
| public: | | public: | |
| | | | |
|
| // The following internal items are declared public only to allow acce | | // The Record is declared public only to allow access from | |
| ss from | | // implementation code written in plain C. | |
| // implementation code written in plain C. They are not intended for | | // It is not intended for public use. | |
| // public use. | | | |
| | | | |
| #ifndef U_HIDE_INTERNAL_API | | #ifndef U_HIDE_INTERNAL_API | |
| /** | | /** | |
|
| * A record, or item, in the index. | | * A (name, data) pair, to be sorted by name into one of the index buck | |
| | | ets. | |
| | | * The user data is not used by the index implementation. | |
| * @internal | | * @internal | |
| */ | | */ | |
|
| struct Record: public UMemory { | | struct Record: public UMemory { | |
| AlphabeticIndex *alphaIndex_; | | const UnicodeString name_; | |
| const UnicodeString name_; | | const void *data_; | |
| UnicodeString sortingName_; // Usually the same as name_; | | Record(const UnicodeString &name, const void *data); | |
| different for Pinyin. | | ~Record(); | |
| const void *data_; | | }; | |
| int32_t serialNumber_; // Defines sorting order for | | | |
| names that compare equal. | | | |
| Record(AlphabeticIndex *alphaIndex, const UnicodeString &name, con | | | |
| st void *data); | | | |
| ~Record(); | | | |
| }; | | | |
| #endif /* U_HIDE_INTERNAL_API */ | | #endif /* U_HIDE_INTERNAL_API */ | |
| | | | |
|
| /** | | private: | |
| * Holds all user records before they are distributed into buckets. | | | |
| * Type of contents is (Record *) | | | |
| * @internal | | | |
| */ | | | |
| UVector *inputRecords_; | | | |
| | | | |
|
| /** | | /** | |
| * A Bucket holds an index label and references to everything belongin | | * Holds all user records before they are distributed into buckets. | |
| g to that label. | | * Type of contents is (Record *) | |
| * For implementation use only. Declared public because pure C implem | | * @internal | |
| entation code needs access. | | */ | |
| * @internal | | UVector *inputList_; | |
| */ | | | |
| struct Bucket: public UMemory { | | | |
| UnicodeString label_; | | | |
| UnicodeString lowerBoundary_; | | | |
| UAlphabeticIndexLabelType labelType_; | | | |
| UVector *records_; // Records are owned by inputRecords_ | | | |
| vector. | | | |
| | | | |
| Bucket(const UnicodeString &label, // Parameter strings are copi | | | |
| ed. | | | |
| const UnicodeString &lowerBoundary, | | | |
| UAlphabeticIndexLabelType type, UErrorCode &status); | | | |
| ~Bucket(); | | | |
| }; | | | |
| | | | |
|
| public: | | int32_t labelsIterIndex_; // Index of next item to return. | |
| | | int32_t itemsIterIndex_; | |
| | | Bucket *currentBucket_; // While an iteration of the index in | |
| | | underway, | |
| | | // point to the bucket for the curr | |
| | | ent label. | |
| | | // NULL when no iteration underway. | |
| | | | |
|
| /** | | int32_t maxLabelCount_; // Limit on # of labels permitted in | |
| * Language Types. For internal ICU use only. | | the index. | |
| * @internal (but not hidden with U_HIDE_INTERNAL_API because it is us | | | |
| ed in public API) | | | |
| */ | | | |
| enum ELangType { | | | |
| /** @internal */ | | | |
| kNormal, | | | |
| /** @internal */ | | | |
| kSimplified, | | | |
| /** @internal */ | | | |
| kTraditional | | | |
| }; | | | |
| | | | |
|
| /** | | UnicodeSet *initialLabels_; // Initial (unprocessed) set of Label | |
| * Get the Language Type for this Index. Based on the locale. | | s. Union | |
| * @internal | | // of those explicitly set by the u | |
| */ | | ser plus | |
| static ELangType langTypeFromLocale(const Locale &loc); | | // those from locales. Raw values, | |
| | | before | |
| | | // crunching into bucket labels. | |
| | | | |
| | | UVector *firstCharsInScripts_; // The first character from each scri | |
| | | pt, | |
| | | // in collation order. | |
| | | | |
| | | RuleBasedCollator *collator_; | |
| | | RuleBasedCollator *collatorPrimaryOnly_; | |
| | | | |
|
| private: | | // Lazy evaluated: null means that we have not built yet. | |
| | | BucketList *buckets_; | |
| | | | |
|
| // Holds the contents of this index, buckets of user items. | | UnicodeString inflowLabel_; | |
| // UVector elements are of type (Bucket *) | | UnicodeString overflowLabel_; | |
| UVector *bucketList_; | | UnicodeString underflowLabel_; | |
| | | UnicodeString overflowComparisonString_; | |
| int32_t labelsIterIndex_; // Index of next item to return. | | | |
| int32_t itemsIterIndex_; | | | |
| Bucket *currentBucket_; // While an iteration of the index in | | | |
| underway, | | | |
| // point to the bucket for the curre | | | |
| nt label. | | | |
| // NULL when no iteration underway. | | | |
| | | | |
| UBool indexBuildRequired_; // Caller has made changes to the ind | | | |
| ex that | | | |
| // require rebuilding & bucketing bef | | | |
| ore the | | | |
| // contents can be iterated. | | | |
| | | | |
| int32_t maxLabelCount_; // Limit on # of labels permitted in t | | | |
| he index. | | | |
| | | | |
| UHashtable *alreadyIn_; // Key=UnicodeString, value=UnicodeSet | | | |
| | | | |
| UnicodeSet *initialLabels_; // Initial (unprocessed) set of Labels | | | |
| . Union | | | |
| // of those explicitly set by the us | | | |
| er plus | | | |
| // those from locales. Raw values, | | | |
| before | | | |
| // crunching into bucket labels. | | | |
| | | | |
| UVector *labels_; // List of Labels, after processing, s | | | |
| orting. | | | |
| // Contents are (UnicodeString *) | | | |
| | | | |
| UnicodeSet *noDistinctSorting_; // As the set of labels is built, stri | | | |
| ngs may | | | |
| // be discarded from the exemplars. Th | | | |
| is contains | | | |
| // some of the discards, and is | | | |
| // intended for debugging. | | | |
| | | | |
| UnicodeSet *notAlphabetic_; // As the set of labels is built, stri | | | |
| ngs may | | | |
| // be discarded from the exemplars. Th | | | |
| is contains | | | |
| // some of the discards, and is | | | |
| // intended for debugging. | | | |
| | | | |
| UVector *firstScriptCharacters_; // The first character from each | | | |
| script, | | | |
| // in collation order. | | | |
| | | | |
| Locale locale_; | | | |
| Collator *collator_; | | | |
| Collator *collatorPrimaryOnly_; | | | |
| | | | |
| UnicodeString inflowLabel_; | | | |
| UnicodeString overflowLabel_; | | | |
| UnicodeString underflowLabel_; | | | |
| UnicodeString overflowComparisonString_; | | | |
| | | | |
| ELangType langType_; // The language type, simplified Chin | | | |
| ese, Traditional Chinese, | | | |
| // or not Chinese (Normal). Part of | | | |
| the Pinyin support | | | |
| | | | |
| typedef const UChar PinyinLookup[24][3]; | | | |
| static PinyinLookup HACK_PINYIN_LOOKUP_SHORT; | | | |
| static PinyinLookup HACK_PINYIN_LOOKUP_LONG; | | | |
| | | | |
| // These will be lazily set to the short or long tables based on which | | | |
| // Chinese collation has been configured into the ICU library. | | | |
| static PinyinLookup *HACK_PINYIN_LOOKUP; | | | |
| static const UChar *PINYIN_LOWER_BOUNDS; | | | |
| | | | |
| int32_t recordCounter_; // Counts Records created. For min | | | |
| ting record serial numbers. | | | |
| | | | |
| // Constants. Lazily initialized the first time an AlphabeticIndex object | | | |
| is created. | | | |
| | | | |
| static UnicodeSet *ALPHABETIC; | | | |
| static UnicodeSet *CORE_LATIN; | | | |
| static UnicodeSet *ETHIOPIC; | | | |
| static UnicodeSet *HANGUL; | | | |
| static UnicodeSet *IGNORE_SCRIPTS; | | | |
| static UnicodeSet *TO_TRY; | | | |
| static UnicodeSet *UNIHAN; | | | |
| static const UnicodeString *EMPTY_STRING; | | | |
| | | | |
|
| | | UnicodeString emptyString_; | |
| }; | | }; | |
| | | | |
| U_NAMESPACE_END | | U_NAMESPACE_END | |
| | | | |
| #endif /* UCONFIG_NO_COLLATION / UCONFIG_NO_NORMALIZATION */ | | #endif /* UCONFIG_NO_COLLATION / UCONFIG_NO_NORMALIZATION */ | |
| #endif | | #endif | |
| | | | |
End of changes. 33 change blocks. |
| 232 lines changed or deleted | | 271 lines changed or added | |
|
| basictz.h | | basictz.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 2007-2011, International Business Machines Corporation and | | * Copyright (C) 2007-2013, International Business Machines Corporation and | |
| * others. All Rights Reserved. | | * others. All Rights Reserved. | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| */ | | */ | |
| #ifndef BASICTZ_H | | #ifndef BASICTZ_H | |
| #define BASICTZ_H | | #define BASICTZ_H | |
| | | | |
| /** | | /** | |
| * \file | | * \file | |
| * \brief C++ API: ICU TimeZone base class | | * \brief C++ API: ICU TimeZone base class | |
| */ | | */ | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 50 | |
| virtual ~BasicTimeZone(); | | virtual ~BasicTimeZone(); | |
| | | | |
| /** | | /** | |
| * Gets the first time zone transition after the base time. | | * Gets the first time zone transition after the base time. | |
| * @param base The base time. | | * @param base The base time. | |
| * @param inclusive Whether the base time is inclusive or not. | | * @param inclusive Whether the base time is inclusive or not. | |
| * @param result Receives the first transition after the base time. | | * @param result Receives the first transition after the base time. | |
| * @return TRUE if the transition is found. | | * @return TRUE if the transition is found. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
|
| virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTr
ansition& result) /*const*/ = 0; | | virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTr
ansition& result) const = 0; | |
| | | | |
| /** | | /** | |
| * Gets the most recent time zone transition before the base time. | | * Gets the most recent time zone transition before the base time. | |
| * @param base The base time. | | * @param base The base time. | |
| * @param inclusive Whether the base time is inclusive or not. | | * @param inclusive Whether the base time is inclusive or not. | |
| * @param result Receives the most recent transition before the base
time. | | * @param result Receives the most recent transition before the base
time. | |
| * @return TRUE if the transition is found. | | * @return TRUE if the transition is found. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
|
| virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZo
neTransition& result) /*const*/ = 0; | | virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZo
neTransition& result) const = 0; | |
| | | | |
| /** | | /** | |
| * Checks if the time zone has equivalent transitions in the time range
. | | * Checks if the time zone has equivalent transitions in the time range
. | |
| * This method returns true when all of transition times, from/to stand
ard | | * This method returns true when all of transition times, from/to stand
ard | |
| * offsets and DST savings used by this time zone match the other in th
e | | * offsets and DST savings used by this time zone match the other in th
e | |
| * time range. | | * time range. | |
| * @param tz The <code>BasicTimeZone</code> object to be compared wi
th. | | * @param tz The <code>BasicTimeZone</code> object to be compared wi
th. | |
| * @param start The start time of the evaluated time range (inclusive) | | * @param start The start time of the evaluated time range (inclusive) | |
| * @param end The end time of the evaluated time range (inclusive) | | * @param end The end time of the evaluated time range (inclusive) | |
| * @param ignoreDstAmount | | * @param ignoreDstAmount | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 82 | |
| * changes will be ignored, except either of them is zero. | | * changes will be ignored, except either of them is zero. | |
| * For example, a transition from rawoffset 3:00/dstsaving
s 1:00 | | * For example, a transition from rawoffset 3:00/dstsaving
s 1:00 | |
| * to rawoffset 2:00/dstsavings 2:00 is excluded from the
comparison, | | * to rawoffset 2:00/dstsavings 2:00 is excluded from the
comparison, | |
| * but a transtion from rawoffset 2:00/dstsavings 1:00 to | | * but a transtion from rawoffset 2:00/dstsavings 1:00 to | |
| * rawoffset 3:00/dstsavings 0:00 is included. | | * rawoffset 3:00/dstsavings 0:00 is included. | |
| * @param ec Output param to filled in with a success or an error. | | * @param ec Output param to filled in with a success or an error. | |
| * @return true if the other time zone has the equivalent transiti
ons in the | | * @return true if the other time zone has the equivalent transiti
ons in the | |
| * time range. | | * time range. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
|
| virtual UBool hasEquivalentTransitions(/*const*/ BasicTimeZone& tz, UDa | | virtual UBool hasEquivalentTransitions(const BasicTimeZone& tz, UDate s | |
| te start, UDate end, | | tart, UDate end, | |
| UBool ignoreDstAmount, UErrorCode& ec) /*const*/; | | UBool ignoreDstAmount, UErrorCode& ec) const; | |
| | | | |
| /** | | /** | |
| * Returns the number of <code>TimeZoneRule</code>s which represents ti
me transitions, | | * Returns the number of <code>TimeZoneRule</code>s which represents ti
me transitions, | |
| * for this time zone, that is, all <code>TimeZoneRule</code>s for this
time zone except | | * for this time zone, that is, all <code>TimeZoneRule</code>s for this
time zone except | |
| * <code>InitialTimeZoneRule</code>. The return value range is 0 or an
y positive value. | | * <code>InitialTimeZoneRule</code>. The return value range is 0 or an
y positive value. | |
| * @param status Receives error status code. | | * @param status Receives error status code. | |
| * @return The number of <code>TimeZoneRule</code>s representing time t
ransitions. | | * @return The number of <code>TimeZoneRule</code>s representing time t
ransitions. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
|
| virtual int32_t countTransitionRules(UErrorCode& status) /*const*/ = 0; | | virtual int32_t countTransitionRules(UErrorCode& status) const = 0; | |
| | | | |
| /** | | /** | |
| * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZ
oneRule</code> | | * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZ
oneRule</code> | |
| * which represent time transitions for this time zone. On successful
return, | | * which represent time transitions for this time zone. On successful
return, | |
| * the argument initial points to non-NULL <code>InitialTimeZoneRule</c
ode> and | | * the argument initial points to non-NULL <code>InitialTimeZoneRule</c
ode> and | |
| * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</
code> | | * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</
code> | |
| * instances up to the size specified by trscount. The results are ref
erencing the | | * instances up to the size specified by trscount. The results are ref
erencing the | |
| * rule instance held by this time zone instance. Therefore, after thi
s time zone | | * rule instance held by this time zone instance. Therefore, after thi
s time zone | |
| * is destructed, they are no longer available. | | * is destructed, they are no longer available. | |
| * @param initial Receives the initial timezone rule | | * @param initial Receives the initial timezone rule | |
| * @param trsrules Receives the timezone transition rules | | * @param trsrules Receives the timezone transition rules | |
| * @param trscount On input, specify the size of the array 'transi
tions' receiving | | * @param trscount On input, specify the size of the array 'transi
tions' receiving | |
| * the timezone transition rules. On output, actu
al number of | | * the timezone transition rules. On output, actu
al number of | |
| * rules filled in the array will be set. | | * rules filled in the array will be set. | |
| * @param status Receives error status code. | | * @param status Receives error status code. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial, | | virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial, | |
|
| const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& stat
us) /*const*/ = 0; | | const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& stat
us) const = 0; | |
| | | | |
| /** | | /** | |
| * Gets the set of time zone rules valid at the specified time. Some k
nown external time zone | | * Gets the set of time zone rules valid at the specified time. Some k
nown external time zone | |
| * implementations are not capable to handle historic time zone rule ch
anges. Also some | | * implementations are not capable to handle historic time zone rule ch
anges. Also some | |
| * implementations can only handle certain type of rule definitions. | | * implementations can only handle certain type of rule definitions. | |
| * If this time zone does not use any daylight saving time within about
1 year from the specified | | * If this time zone does not use any daylight saving time within about
1 year from the specified | |
| * time, only the <code>InitialTimeZone</code> is returned. Otherwise,
the rule for standard | | * time, only the <code>InitialTimeZone</code> is returned. Otherwise,
the rule for standard | |
| * time and daylight saving time transitions are returned in addition t
o the | | * time and daylight saving time transitions are returned in addition t
o the | |
| * <code>InitialTimeZoneRule</code>. The standard and daylight saving
time transition rules are | | * <code>InitialTimeZoneRule</code>. The standard and daylight saving
time transition rules are | |
| * represented by <code>AnnualTimeZoneRule</code> with <code>DateTimeRu
le::DOW</code> for its date | | * represented by <code>AnnualTimeZoneRule</code> with <code>DateTimeRu
le::DOW</code> for its date | |
| | | | |
| skipping to change at line 141 | | skipping to change at line 141 | |
| * @param std Receives the <code>AnnualTimeZoneRule</code> for st
andard time transitions. | | * @param std Receives the <code>AnnualTimeZoneRule</code> for st
andard time transitions. | |
| * When this time time zone does not observe daylight
saving times around the | | * When this time time zone does not observe daylight
saving times around the | |
| * specified date, NULL is set. | | * specified date, NULL is set. | |
| * @param dst Receives the <code>AnnualTimeZoneRule</code> for da
ylight saving time | | * @param dst Receives the <code>AnnualTimeZoneRule</code> for da
ylight saving time | |
| * transitions. When this time zone does not observer
daylight saving times | | * transitions. When this time zone does not observer
daylight saving times | |
| * around the specified date, NULL is set. | | * around the specified date, NULL is set. | |
| * @param status Receives error status code. | | * @param status Receives error status code. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| virtual void getSimpleRulesNear(UDate date, InitialTimeZoneRule*& initi
al, | | virtual void getSimpleRulesNear(UDate date, InitialTimeZoneRule*& initi
al, | |
|
| AnnualTimeZoneRule*& std, AnnualTimeZoneRule*& dst, UErrorCode& sta
tus) /*const*/; | | AnnualTimeZoneRule*& std, AnnualTimeZoneRule*& dst, UErrorCode& sta
tus) const; | |
| | | | |
| #ifndef U_HIDE_INTERNAL_API | | #ifndef U_HIDE_INTERNAL_API | |
| /** | | /** | |
| * The time type option bit flags used by getOffsetFromLocal | | * The time type option bit flags used by getOffsetFromLocal | |
| * @internal | | * @internal | |
| */ | | */ | |
| enum { | | enum { | |
| kStandard = 0x01, | | kStandard = 0x01, | |
| kDaylight = 0x03, | | kDaylight = 0x03, | |
| kFormer = 0x04, | | kFormer = 0x04, | |
| kLatter = 0x0C | | kLatter = 0x0C | |
| }; | | }; | |
| #endif /* U_HIDE_INTERNAL_API */ | | #endif /* U_HIDE_INTERNAL_API */ | |
| | | | |
| /** | | /** | |
| * Get time zone offsets from local wall time. | | * Get time zone offsets from local wall time. | |
| * @internal | | * @internal | |
| */ | | */ | |
| virtual void getOffsetFromLocal(UDate date, int32_t nonExistingTimeOpt,
int32_t duplicatedTimeOpt, | | virtual void getOffsetFromLocal(UDate date, int32_t nonExistingTimeOpt,
int32_t duplicatedTimeOpt, | |
|
| int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) /*const
*/; | | int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const; | |
| | | | |
| protected: | | protected: | |
| | | | |
| #ifndef U_HIDE_INTERNAL_API | | #ifndef U_HIDE_INTERNAL_API | |
| /** | | /** | |
| * The time type option bit masks used by getOffsetFromLocal | | * The time type option bit masks used by getOffsetFromLocal | |
| * @internal | | * @internal | |
| */ | | */ | |
| enum { | | enum { | |
| kStdDstMask = kDaylight, | | kStdDstMask = kDaylight, | |
| | | | |
| skipping to change at line 204 | | skipping to change at line 204 | |
| BasicTimeZone(const BasicTimeZone& source); | | BasicTimeZone(const BasicTimeZone& source); | |
| | | | |
| /** | | /** | |
| * Gets the set of TimeZoneRule instances applicable to the specified t
ime and after. | | * Gets the set of TimeZoneRule instances applicable to the specified t
ime and after. | |
| * @param start The start date used for extracting time zone rules | | * @param start The start date used for extracting time zone rules | |
| * @param initial Receives the InitialTimeZone, always not NULL | | * @param initial Receives the InitialTimeZone, always not NULL | |
| * @param transitionRules Receives the transition rules, could be NUL
L | | * @param transitionRules Receives the transition rules, could be NUL
L | |
| * @param status Receives error status code | | * @param status Receives error status code | |
| */ | | */ | |
| void getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial,
UVector*& transitionRules, | | void getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial,
UVector*& transitionRules, | |
|
| UErrorCode& status) /*const*/; | | UErrorCode& status) const; | |
| }; | | }; | |
| | | | |
| U_NAMESPACE_END | | U_NAMESPACE_END | |
| | | | |
| #endif /* #if !UCONFIG_NO_FORMATTING */ | | #endif /* #if !UCONFIG_NO_FORMATTING */ | |
| | | | |
| #endif // BASICTZ_H | | #endif // BASICTZ_H | |
| | | | |
| //eof | | //eof | |
| | | | |
End of changes. 9 change blocks. |
| 11 lines changed or deleted | | 11 lines changed or added | |
|
| calendar.h | | calendar.h | |
| /* | | /* | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
|
| * Copyright (C) 1997-2012, International Business Machines | | * Copyright (C) 1997-2013, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
| * | | * | |
| * File CALENDAR.H | | * File CALENDAR.H | |
| * | | * | |
| * Modification History: | | * Modification History: | |
| * | | * | |
| * Date Name Description | | * Date Name Description | |
| * 04/22/97 aliu Expanded and corrected comments and other heade
r | | * 04/22/97 aliu Expanded and corrected comments and other heade
r | |
| * contents. | | * contents. | |
| | | | |
| skipping to change at line 900 | | skipping to change at line 900 | |
| void setLenient(UBool lenient); | | void setLenient(UBool lenient); | |
| | | | |
| /** | | /** | |
| * Tells whether date/time interpretation is to be lenient. | | * Tells whether date/time interpretation is to be lenient. | |
| * | | * | |
| * @return True tells that date/time interpretation is to be lenient. | | * @return True tells that date/time interpretation is to be lenient. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| UBool isLenient(void) const; | | UBool isLenient(void) const; | |
| | | | |
|
| #ifndef U_HIDE_DRAFT_API | | | |
| /** | | /** | |
| * Sets the behavior for handling wall time repeating multiple times | | * Sets the behavior for handling wall time repeating multiple times | |
| * at negative time zone offset transitions. For example, 1:30 AM on | | * at negative time zone offset transitions. For example, 1:30 AM on | |
| * November 6, 2011 in US Eastern time (Ameirca/New_York) occurs twice; | | * November 6, 2011 in US Eastern time (Ameirca/New_York) occurs twice; | |
| * 1:30 AM EDT, then 1:30 AM EST one hour later. When <code>UCAL_WALLTI
ME_FIRST</code> | | * 1:30 AM EDT, then 1:30 AM EST one hour later. When <code>UCAL_WALLTI
ME_FIRST</code> | |
| * is used, the wall time 1:30AM in this example will be interpreted as
1:30 AM EDT | | * is used, the wall time 1:30AM in this example will be interpreted as
1:30 AM EDT | |
| * (first occurrence). When <code>UCAL_WALLTIME_LAST</code> is used, it
will be | | * (first occurrence). When <code>UCAL_WALLTIME_LAST</code> is used, it
will be | |
| * interpreted as 1:30 AM EST (last occurrence). The default value is | | * interpreted as 1:30 AM EST (last occurrence). The default value is | |
| * <code>UCAL_WALLTIME_LAST</code>. | | * <code>UCAL_WALLTIME_LAST</code>. | |
| * <p> | | * <p> | |
| * <b>Note:</b>When <code>UCAL_WALLTIME_NEXT_VALID</code> is not a vali
d | | * <b>Note:</b>When <code>UCAL_WALLTIME_NEXT_VALID</code> is not a vali
d | |
| * option for this. When the argument is neither <code>UCAL_WALLTIME_FI
RST</code> | | * option for this. When the argument is neither <code>UCAL_WALLTIME_FI
RST</code> | |
| * nor <code>UCAL_WALLTIME_LAST</code>, this method has no effect and w
ill keep | | * nor <code>UCAL_WALLTIME_LAST</code>, this method has no effect and w
ill keep | |
| * the current setting. | | * the current setting. | |
| * | | * | |
| * @param option the behavior for handling repeating wall time, either | | * @param option the behavior for handling repeating wall time, either | |
| * <code>UCAL_WALLTIME_FIRST</code> or <code>UCAL_WALLTIME_LAST</code>. | | * <code>UCAL_WALLTIME_FIRST</code> or <code>UCAL_WALLTIME_LAST</code>. | |
| * @see #getRepeatedWallTimeOption | | * @see #getRepeatedWallTimeOption | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| void setRepeatedWallTimeOption(UCalendarWallTimeOption option); | | void setRepeatedWallTimeOption(UCalendarWallTimeOption option); | |
| | | | |
| /** | | /** | |
| * Gets the behavior for handling wall time repeating multiple times | | * Gets the behavior for handling wall time repeating multiple times | |
| * at negative time zone offset transitions. | | * at negative time zone offset transitions. | |
| * | | * | |
| * @return the behavior for handling repeating wall time, either | | * @return the behavior for handling repeating wall time, either | |
| * <code>UCAL_WALLTIME_FIRST</code> or <code>UCAL_WALLTIME_LAST</code>. | | * <code>UCAL_WALLTIME_FIRST</code> or <code>UCAL_WALLTIME_LAST</code>. | |
| * @see #setRepeatedWallTimeOption | | * @see #setRepeatedWallTimeOption | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| UCalendarWallTimeOption getRepeatedWallTimeOption(void) const; | | UCalendarWallTimeOption getRepeatedWallTimeOption(void) const; | |
| | | | |
| /** | | /** | |
| * Sets the behavior for handling skipped wall time at positive time zo
ne offset | | * Sets the behavior for handling skipped wall time at positive time zo
ne offset | |
| * transitions. For example, 2:30 AM on March 13, 2011 in US Eastern ti
me (America/New_York) | | * transitions. For example, 2:30 AM on March 13, 2011 in US Eastern ti
me (America/New_York) | |
| * does not exist because the wall time jump from 1:59 AM EST to 3:00 A
M EDT. When | | * does not exist because the wall time jump from 1:59 AM EST to 3:00 A
M EDT. When | |
| * <code>UCAL_WALLTIME_FIRST</code> is used, 2:30 AM is interpreted as
30 minutes before 3:00 AM | | * <code>UCAL_WALLTIME_FIRST</code> is used, 2:30 AM is interpreted as
30 minutes before 3:00 AM | |
| * EDT, therefore, it will be resolved as 1:30 AM EST. When <code>UCAL_
WALLTIME_LAST</code> | | * EDT, therefore, it will be resolved as 1:30 AM EST. When <code>UCAL_
WALLTIME_LAST</code> | |
| * is used, 2:30 AM is interpreted as 31 minutes after 1:59 AM EST, the
refore, it will be | | * is used, 2:30 AM is interpreted as 31 minutes after 1:59 AM EST, the
refore, it will be | |
| | | | |
| skipping to change at line 953 | | skipping to change at line 952 | |
| * <code>UCAL_WALLTIME_LAST</code>. | | * <code>UCAL_WALLTIME_LAST</code>. | |
| * <p> | | * <p> | |
| * <b>Note:</b>This option is effective only when this calendar is leni
ent. | | * <b>Note:</b>This option is effective only when this calendar is leni
ent. | |
| * When the calendar is strict, such non-existing wall time will cause
an error. | | * When the calendar is strict, such non-existing wall time will cause
an error. | |
| * | | * | |
| * @param option the behavior for handling skipped wall time at positiv
e time zone | | * @param option the behavior for handling skipped wall time at positiv
e time zone | |
| * offset transitions, one of <code>UCAL_WALLTIME_FIRST</code>, <code>U
CAL_WALLTIME_LAST</code> and | | * offset transitions, one of <code>UCAL_WALLTIME_FIRST</code>, <code>U
CAL_WALLTIME_LAST</code> and | |
| * <code>UCAL_WALLTIME_NEXT_VALID</code>. | | * <code>UCAL_WALLTIME_NEXT_VALID</code>. | |
| * @see #getSkippedWallTimeOption | | * @see #getSkippedWallTimeOption | |
| * | | * | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| void setSkippedWallTimeOption(UCalendarWallTimeOption option); | | void setSkippedWallTimeOption(UCalendarWallTimeOption option); | |
| | | | |
| /** | | /** | |
| * Gets the behavior for handling skipped wall time at positive time zo
ne offset | | * Gets the behavior for handling skipped wall time at positive time zo
ne offset | |
| * transitions. | | * transitions. | |
| * | | * | |
| * @return the behavior for handling skipped wall time, one of | | * @return the behavior for handling skipped wall time, one of | |
| * <code>UCAL_WALLTIME_FIRST</code>, <code>UCAL_WALLTIME_LAST</code> | | * <code>UCAL_WALLTIME_FIRST</code>, <code>UCAL_WALLTIME_LAST</code> | |
| * and <code>UCAL_WALLTIME_NEXT_VALID</code>. | | * and <code>UCAL_WALLTIME_NEXT_VALID</code>. | |
| * @see #setSkippedWallTimeOption | | * @see #setSkippedWallTimeOption | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| UCalendarWallTimeOption getSkippedWallTimeOption(void) const; | | UCalendarWallTimeOption getSkippedWallTimeOption(void) const; | |
|
| #endif /* U_HIDE_DRAFT_API */ | | | |
| | | | |
| #ifndef U_HIDE_DEPRECATED_API | | #ifndef U_HIDE_DEPRECATED_API | |
| /** | | /** | |
| * Sets what the first day of the week is; e.g., Sunday in US, Monday i
n France. | | * Sets what the first day of the week is; e.g., Sunday in US, Monday i
n France. | |
| * | | * | |
| * @param value The given first day of the week. | | * @param value The given first day of the week. | |
| * @deprecated ICU 2.6. Use setFirstDayOfWeek(UCalendarDaysOfWeek value
) instead. | | * @deprecated ICU 2.6. Use setFirstDayOfWeek(UCalendarDaysOfWeek value
) instead. | |
| */ | | */ | |
| void setFirstDayOfWeek(EDaysOfWeek value); | | void setFirstDayOfWeek(EDaysOfWeek value); | |
| #endif /* U_HIDE_DEPRECATED_API */ | | #endif /* U_HIDE_DEPRECATED_API */ | |
| | | | |
| skipping to change at line 1373 | | skipping to change at line 1371 | |
| * // deal with errors & overflow | | * // deal with errors & overflow | |
| * } | | * } | |
| * string lang(langTag, length); | | * string lang(langTag, length); | |
| * size_t caPos = lang.find("-ca-"); | | * size_t caPos = lang.find("-ca-"); | |
| * lang.erase(0, caPos + 4); | | * lang.erase(0, caPos + 4); | |
| * // lang now contains the LDML calendar type | | * // lang now contains the LDML calendar type | |
| * } | | * } | |
| * \endcode | | * \endcode | |
| * | | * | |
| * @return legacy calendar type name string | | * @return legacy calendar type name string | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| virtual const char * getType() const = 0; | | virtual const char * getType() const = 0; | |
| | | | |
| /** | | /** | |
| * Returns whether the given day of the week is a weekday, a | | * Returns whether the given day of the week is a weekday, a | |
| * weekend day, or a day that transitions from one to the other, | | * weekend day, or a day that transitions from one to the other, | |
| * in this calendar system. If a transition occurs at midnight, | | * in this calendar system. If a transition occurs at midnight, | |
| * then the days before and after the transition will have the | | * then the days before and after the transition will have the | |
| * type UCAL_WEEKDAY or UCAL_WEEKEND. If a transition occurs at a time | | * type UCAL_WEEKDAY or UCAL_WEEKEND. If a transition occurs at a time | |
| * other than midnight, then the day of the transition will have | | * other than midnight, then the day of the transition will have | |
| | | | |
| skipping to change at line 1609 | | skipping to change at line 1607 | |
| * temporary calendar. | | * temporary calendar. | |
| * @internal | | * @internal | |
| */ | | */ | |
| virtual void prepareGetActual(UCalendarDateFields field, UBool isMinimu
m, UErrorCode &status); | | virtual void prepareGetActual(UCalendarDateFields field, UBool isMinimu
m, UErrorCode &status); | |
| | | | |
| /** | | /** | |
| * Limit enums. Not in sync with UCalendarLimitType (refers to internal
fields). | | * Limit enums. Not in sync with UCalendarLimitType (refers to internal
fields). | |
| * @internal | | * @internal | |
| */ | | */ | |
| enum ELimitType { | | enum ELimitType { | |
|
| | | #ifndef U_HIDE_INTERNAL_API | |
| UCAL_LIMIT_MINIMUM = 0, | | UCAL_LIMIT_MINIMUM = 0, | |
| UCAL_LIMIT_GREATEST_MINIMUM, | | UCAL_LIMIT_GREATEST_MINIMUM, | |
| UCAL_LIMIT_LEAST_MAXIMUM, | | UCAL_LIMIT_LEAST_MAXIMUM, | |
| UCAL_LIMIT_MAXIMUM, | | UCAL_LIMIT_MAXIMUM, | |
| UCAL_LIMIT_COUNT | | UCAL_LIMIT_COUNT | |
|
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Subclass API for defining limits of different types. | | * Subclass API for defining limits of different types. | |
| * Subclasses must implement this method to return limits for the | | * Subclasses must implement this method to return limits for the | |
| * following fields: | | * following fields: | |
| * | | * | |
| * <pre>UCAL_ERA | | * <pre>UCAL_ERA | |
| * UCAL_YEAR | | * UCAL_YEAR | |
| * UCAL_MONTH | | * UCAL_MONTH | |
| | | | |
End of changes. 10 change blocks. |
| 8 lines changed or deleted | | 8 lines changed or added | |
|
| decimfmt.h | | decimfmt.h | |
| /* | | /* | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
|
| * Copyright (C) 1997-2012, International Business Machines | | * Copyright (C) 1997-2013, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
| * | | * | |
| * File DECIMFMT.H | | * File DECIMFMT.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 clhuang Updated per C++ implementation. | | * 03/20/97 clhuang Updated per C++ implementation. | |
| * 04/03/97 aliu Rewrote parsing and formatting completely, and | | * 04/03/97 aliu Rewrote parsing and formatting completely, and | |
| * cleaned up and debugged. Actually works now. | | * cleaned up and debugged. Actually works now. | |
| * 04/17/97 aliu Changed DigitCount to int per code review. | | * 04/17/97 aliu Changed DigitCount to int per code review. | |
| * 07/10/97 helena Made ParsePosition a class and get rid of the f
unction | | * 07/10/97 helena Made ParsePosition a class and get rid of the f
unction | |
| * hiding problems. | | * hiding problems. | |
| * 09/09/97 aliu Ported over support for exponential formats. | | * 09/09/97 aliu Ported over support for exponential formats. | |
|
| * 07/20/98 stephen Changed documentation | | * 07/20/98 stephen Changed documentation | |
| | | * 01/30/13 emmons Added Scaling methods | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
| */ | | */ | |
| | | | |
| #ifndef DECIMFMT_H | | #ifndef DECIMFMT_H | |
| #define DECIMFMT_H | | #define DECIMFMT_H | |
| | | | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| /** | | /** | |
| * \file | | * \file | |
| * \brief C++ API: Formats decimal numbers. | | * \brief C++ API: Formats decimal numbers. | |
| | | | |
| skipping to change at line 43 | | skipping to change at line 44 | |
| #if !UCONFIG_NO_FORMATTING | | #if !UCONFIG_NO_FORMATTING | |
| | | | |
| #include "unicode/dcfmtsym.h" | | #include "unicode/dcfmtsym.h" | |
| #include "unicode/numfmt.h" | | #include "unicode/numfmt.h" | |
| #include "unicode/locid.h" | | #include "unicode/locid.h" | |
| #include "unicode/fpositer.h" | | #include "unicode/fpositer.h" | |
| #include "unicode/stringpiece.h" | | #include "unicode/stringpiece.h" | |
| #include "unicode/curramt.h" | | #include "unicode/curramt.h" | |
| #include "unicode/enumset.h" | | #include "unicode/enumset.h" | |
| | | | |
|
| | | #ifndef U_HIDE_INTERNAL_API | |
| /** | | /** | |
| * \def UNUM_DECIMALFORMAT_INTERNAL_SIZE | | * \def UNUM_DECIMALFORMAT_INTERNAL_SIZE | |
| * @internal | | * @internal | |
| */ | | */ | |
| #if UCONFIG_FORMAT_FASTPATHS_49 | | #if UCONFIG_FORMAT_FASTPATHS_49 | |
| #define UNUM_DECIMALFORMAT_INTERNAL_SIZE 16 | | #define UNUM_DECIMALFORMAT_INTERNAL_SIZE 16 | |
| #endif | | #endif | |
|
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| | | | |
| U_NAMESPACE_BEGIN | | U_NAMESPACE_BEGIN | |
| | | | |
| class DigitList; | | class DigitList; | |
| class ChoiceFormat; | | class ChoiceFormat; | |
| class CurrencyPluralInfo; | | class CurrencyPluralInfo; | |
| class Hashtable; | | class Hashtable; | |
| class UnicodeSet; | | class UnicodeSet; | |
| class FieldPositionHandler; | | class FieldPositionHandler; | |
| | | | |
| | | | |
| skipping to change at line 760 | | skipping to change at line 763 | |
| /** | | /** | |
| * 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 | | * @param style style of decimal format | |
| * @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 | |
| */ | | */ | |
| DecimalFormat( const UnicodeString& pattern, | | DecimalFormat( const UnicodeString& pattern, | |
| DecimalFormatSymbols* symbolsToAdopt, | | DecimalFormatSymbols* symbolsToAdopt, | |
| UNumberFormatStyle style, | | UNumberFormatStyle style, | |
| UErrorCode& status); | | UErrorCode& status); | |
| | | | |
|
| | | #if UCONFIG_HAVE_PARSEALLINPUT | |
| | | /** | |
| | | * @internal | |
| | | */ | |
| | | void setParseAllInput(UNumberFormatAttributeValue value); | |
| | | #endif | |
| | | | |
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| | | | |
| /** | | /** | |
| * Set an integer attribute on this DecimalFormat. | | * Set an integer attribute on this DecimalFormat. | |
| * May return U_UNSUPPORTED_ERROR if this instance does not support | | * May return U_UNSUPPORTED_ERROR if this instance does not support | |
| * the specified attribute. | | * the specified attribute. | |
| * @param attr the attribute to set | | * @param attr the attribute to set | |
| * @param newvalue new value | | * @param newvalue new value | |
| * @param status the error type | | * @param status the error type | |
|
| * @return *this - for chaining | | * @return *this - for chaining (example: format.setAttribute(...).setA | |
| * @internal ICU 50 | | ttribute(...) ) | |
| | | * @draft ICU 51 | |
| */ | | */ | |
| virtual DecimalFormat& setAttribute( UNumberFormatAttribute attr, | | virtual DecimalFormat& setAttribute( UNumberFormatAttribute attr, | |
| int32_t newvalue, | | int32_t newvalue, | |
| UErrorCode &status); | | UErrorCode &status); | |
| | | | |
| /** | | /** | |
| * Get an integer | | * Get an integer | |
| * May return U_UNSUPPORTED_ERROR if this instance does not support | | * May return U_UNSUPPORTED_ERROR if this instance does not support | |
| * the specified attribute. | | * the specified attribute. | |
| * @param attr the attribute to set | | * @param attr the attribute to set | |
| * @param status the error type | | * @param status the error type | |
| * @return the attribute value. Undefined if there is an error. | | * @return the attribute value. Undefined if there is an error. | |
|
| * @internal ICU 50 | | * @draft ICU 51 | |
| */ | | */ | |
| virtual int32_t getAttribute( UNumberFormatAttribute attr, | | virtual int32_t getAttribute( UNumberFormatAttribute attr, | |
| UErrorCode &status) const; | | UErrorCode &status) const; | |
| | | | |
|
| #if UCONFIG_HAVE_PARSEALLINPUT | | | |
| /** | | | |
| * @internal | | | |
| */ | | | |
| void setParseAllInput(UNumberFormatAttributeValue value); | | | |
| #endif | | | |
| | | | |
| #endif /* U_HIDE_INTERNAL_API */ | | | |
| | | | |
| /** | | /** | |
| * Create a DecimalFormat from the given pattern and symbols. | | * Create a DecimalFormat from the given pattern and symbols. | |
| * Use this constructor when you need to completely customize the | | * Use this constructor when you need to completely customize the | |
| * behavior of the format. | | * behavior of the format. | |
| * <P> | | * <P> | |
| * To obtain standard formats for a given | | * To obtain standard formats for a given | |
| * locale, use the factory methods on NumberFormat such as | | * locale, use the factory methods on NumberFormat such as | |
| * createInstance or createCurrencyInstance. If you need only minor adj
ustments | | * createInstance or createCurrencyInstance. If you need only minor adj
ustments | |
| * to a standard format, you can modify the format returned by | | * to a standard format, you can modify the format returned by | |
| * a NumberFormat factory method. | | * a NumberFormat factory method. | |
| | | | |
| skipping to change at line 1206 | | skipping to change at line 1209 | |
| * | | * | |
| * @param text The text to be parsed. | | * @param text The text to be parsed. | |
| * @param result Formattable to be set to the parse result. | | * @param result Formattable to be set to the parse result. | |
| * @param status Output parameter filled in with success or failure
status. | | * @param status Output parameter filled in with success or failure
status. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| virtual void parse(const UnicodeString& text, | | virtual void parse(const UnicodeString& text, | |
| Formattable& result, | | Formattable& result, | |
| UErrorCode& status) const; | | UErrorCode& status) const; | |
| | | | |
|
| /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method since
it is virtual */ | | | |
| /** | | /** | |
| * Parses text from the given string as a currency amount. Unlike | | * Parses text from the given string as a currency amount. Unlike | |
| * the parse() method, this method will attempt to parse a generic | | * the parse() method, this method will attempt to parse a generic | |
| * currency name, searching for a match of this object's locale's | | * currency name, searching for a match of this object's locale's | |
| * currency display names, or for a 3-letter ISO currency code. | | * currency display names, or for a 3-letter ISO currency code. | |
| * This method will fail if this format is not a currency format, | | * This method will fail if this format is not a currency format, | |
| * that is, if it does not contain the currency pattern symbol | | * that is, if it does not contain the currency pattern symbol | |
| * (U+00A4) in its prefix or suffix. | | * (U+00A4) in its prefix or suffix. | |
| * | | * | |
| * @param text the string to parse | | * @param text the string to parse | |
| * @param pos input-output position; on input, the position within tex
t | | * @param pos input-output position; on input, the position within tex
t | |
| * to match; must have 0 <= pos.getIndex() < text.length(); | | * to match; must have 0 <= pos.getIndex() < text.length(); | |
| * on output, the position after the last matched character
. | | * on output, the position after the last matched character
. | |
| * If the parse fails, the position in unchanged upon outpu
t. | | * If the parse fails, the position in unchanged upon outpu
t. | |
| * @return if parse succeeds, a pointer to a newly-created Currency
Amount | | * @return if parse succeeds, a pointer to a newly-created Currency
Amount | |
| * object (owned by the caller) containing information abou
t | | * object (owned by the caller) containing information abou
t | |
| * the parsed currency; if parse fails, this is NULL. | | * the parsed currency; if parse fails, this is NULL. | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| virtual CurrencyAmount* parseCurrency(const UnicodeString& text, | | virtual CurrencyAmount* parseCurrency(const UnicodeString& text, | |
| ParsePosition& pos) const; | | ParsePosition& pos) const; | |
| | | | |
| /** | | /** | |
| * Returns the decimal format symbols, which is generally not changed | | * Returns the decimal format symbols, which is generally not changed | |
| * by the programmer or user. | | * by the programmer or user. | |
| * @return desired DecimalFormatSymbols | | * @return desired DecimalFormatSymbols | |
| * @see DecimalFormatSymbols | | * @see DecimalFormatSymbols | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| | | | |
| skipping to change at line 2226 | | skipping to change at line 2228 | |
| UnicodeString* fNegSuffixPattern; | | UnicodeString* fNegSuffixPattern; | |
| | | | |
| /** | | /** | |
| * Formatter for ChoiceFormat-based currency names. If this field | | * Formatter for ChoiceFormat-based currency names. If this field | |
| * is not null, then delegate to it to format currency symbols. | | * is not null, then delegate to it to format currency symbols. | |
| * @since ICU 2.6 | | * @since ICU 2.6 | |
| */ | | */ | |
| ChoiceFormat* fCurrencyChoice; | | ChoiceFormat* fCurrencyChoice; | |
| | | | |
| DigitList * fMultiplier; // NULL for multiplier of one | | DigitList * fMultiplier; // NULL for multiplier of one | |
|
| | | int32_t fScale; | |
| int32_t fGroupingSize; | | int32_t fGroupingSize; | |
| int32_t fGroupingSize2; | | int32_t fGroupingSize2; | |
| UBool fDecimalSeparatorAlwaysShown; | | UBool fDecimalSeparatorAlwaysShown; | |
| DecimalFormatSymbols* fSymbols; | | DecimalFormatSymbols* fSymbols; | |
| | | | |
| UBool fUseSignificantDigits; | | UBool fUseSignificantDigits; | |
| int32_t fMinSignificantDigits; | | int32_t fMinSignificantDigits; | |
| int32_t fMaxSignificantDigits; | | int32_t fMaxSignificantDigits; | |
| | | | |
| UBool fUseExponentialNotation; | | UBool fUseExponentialNotation; | |
| | | | |
| skipping to change at line 2367 | | skipping to change at line 2370 | |
| | | | |
| // Information needed for DecimalFormat to format/parse currency plural
. | | // Information needed for DecimalFormat to format/parse currency plural
. | |
| CurrencyPluralInfo* fCurrencyPluralInfo; | | CurrencyPluralInfo* fCurrencyPluralInfo; | |
| | | | |
| #if UCONFIG_HAVE_PARSEALLINPUT | | #if UCONFIG_HAVE_PARSEALLINPUT | |
| UNumberFormatAttributeValue fParseAllInput; | | UNumberFormatAttributeValue fParseAllInput; | |
| #endif | | #endif | |
| | | | |
| protected: | | protected: | |
| | | | |
|
| | | #ifndef U_HIDE_INTERNAL_API | |
| | | /** | |
| | | * Rounds a value according to the rules of this object. | |
| | | * @internal | |
| | | */ | |
| | | DigitList& _round(const DigitList& number, DigitList& adjustedNum, UBoo | |
| | | l& isNegative, UErrorCode& status) const; | |
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| | | | |
| /** | | /** | |
| * Returns the currency in effect for this formatter. Subclasses | | * Returns the currency in effect for this formatter. Subclasses | |
| * should override this method as needed. Unlike getCurrency(), | | * should override this method as needed. Unlike getCurrency(), | |
| * this method should never return "". | | * this method should never return "". | |
| * @result output parameter for null-terminated result, which must | | * @result output parameter for null-terminated result, which must | |
| * have a capacity of at least 4 | | * have a capacity of at least 4 | |
| * @internal | | * @internal | |
| */ | | */ | |
| virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const; | | virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const; | |
| | | | |
| | | | |
| skipping to change at line 2436 | | skipping to change at line 2447 | |
| return format(number, appendTo, pos); | | return format(number, appendTo, pos); | |
| } | | } | |
| | | | |
| inline UnicodeString& | | inline UnicodeString& | |
| DecimalFormat::format(int32_t number, | | DecimalFormat::format(int32_t number, | |
| UnicodeString& appendTo) const { | | UnicodeString& appendTo) const { | |
| FieldPosition pos(0); | | FieldPosition pos(0); | |
| return format((int64_t)number, appendTo, pos); | | return format((int64_t)number, appendTo, pos); | |
| } | | } | |
| | | | |
|
| #ifndef U_HIDE_INTERNAL_API | | | |
| inline const UnicodeString & | | inline const UnicodeString & | |
| DecimalFormat::getConstSymbol(DecimalFormatSymbols::ENumberFormatSymbol sym
bol) const { | | DecimalFormat::getConstSymbol(DecimalFormatSymbols::ENumberFormatSymbol sym
bol) const { | |
| return fSymbols->getConstSymbol(symbol); | | return fSymbols->getConstSymbol(symbol); | |
| } | | } | |
| | | | |
|
| #endif | | | |
| | | | |
| U_NAMESPACE_END | | U_NAMESPACE_END | |
| | | | |
| #endif /* #if !UCONFIG_NO_FORMATTING */ | | #endif /* #if !UCONFIG_NO_FORMATTING */ | |
| | | | |
| #endif // _DECIMFMT | | #endif // _DECIMFMT | |
| //eof | | //eof | |
| | | | |
End of changes. 15 change blocks. |
| 20 lines changed or deleted | | 30 lines changed or added | |
|
| dtfmtsym.h | | dtfmtsym.h | |
| /* | | /* | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
|
| * Copyright (C) 1997-2012, International Business Machines | | * Copyright (C) 1997-2013, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| ***************************************************************************
***** | | ***************************************************************************
***** | |
| * | | * | |
| * File DTFMTSYM.H | | * File DTFMTSYM.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. | |
| * 07/21/98 stephen Added getZoneIndex() | | * 07/21/98 stephen Added getZoneIndex() | |
| | | | |
| skipping to change at line 286 | | skipping to change at line 286 | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Selector for date formatting width | | * Selector for date formatting width | |
| * @stable ICU 3.6 | | * @stable ICU 3.6 | |
| */ | | */ | |
| enum DtWidthType { | | enum DtWidthType { | |
| ABBREVIATED, | | ABBREVIATED, | |
| WIDE, | | WIDE, | |
| NARROW, | | NARROW, | |
|
| DT_WIDTH_COUNT | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Short width is currently only supported for weekday names. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | SHORT, | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | /** | |
| | | */ | |
| | | DT_WIDTH_COUNT = 4 | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Gets month strings by width and context. For example: "January", "Fe
bruary", etc. | | * Gets month strings by width and context. For example: "January", "Fe
bruary", etc. | |
| * @param count Filled in with length of the array. | | * @param count Filled in with length of the array. | |
| * @param context The formatting context, either FORMAT or STANDALONE | | * @param context The formatting context, either FORMAT or STANDALONE | |
| * @param width The width of returned strings, either WIDE, ABBREVIAT
ED, or NARROW. | | * @param width The width of returned strings, either WIDE, ABBREVIAT
ED, or NARROW. | |
| * @return the month strings. (DateFormatSymbols retains ownership.) | | * @return the month strings. (DateFormatSymbols retains ownership.) | |
| * @stable ICU 3.4 | | * @stable ICU 3.4 | |
| */ | | */ | |
| | | | |
| skipping to change at line 311 | | skipping to change at line 320 | |
| * | | * | |
| * @param months The new month strings. (not adopted; caller retains o
wnership) | | * @param months The new month strings. (not adopted; caller retains o
wnership) | |
| * @param count Filled in with length of the array. | | * @param count Filled in with length of the array. | |
| * @param context The formatting context, either FORMAT or STANDALONE | | * @param context The formatting context, either FORMAT or STANDALONE | |
| * @param width The width of returned strings, either WIDE, ABBREVIAT
ED, or NARROW. | | * @param width The width of returned strings, either WIDE, ABBREVIAT
ED, or NARROW. | |
| * @stable ICU 3.6 | | * @stable ICU 3.6 | |
| */ | | */ | |
| void setMonths(const UnicodeString* months, int32_t count, DtContextTyp
e context, DtWidthType width); | | void setMonths(const UnicodeString* months, int32_t count, DtContextTyp
e context, DtWidthType width); | |
| | | | |
| /** | | /** | |
|
| * Gets weekday strings. For example: "Sunday", "Monday", etc. | | * Gets wide weekday strings. For example: "Sunday", "Monday", etc. | |
| * @param count Filled in with length of the array. | | * @param count Filled in with length of the array. | |
| * @return the weekday strings. (DateFormatSymbols retains ownership.) | | * @return the weekday strings. (DateFormatSymbols retains ownership.) | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| const UnicodeString* getWeekdays(int32_t& count) const; | | const UnicodeString* getWeekdays(int32_t& count) const; | |
| | | | |
| /** | | /** | |
|
| * Sets weekday strings. For example: "Sunday", "Monday", etc. | | * Sets wide weekday strings. For example: "Sunday", "Monday", etc. | |
| * @param weekdays the new weekday strings. (not adopted; caller re
tains ownership) | | * @param weekdays the new weekday strings. (not adopted; caller re
tains ownership) | |
| * @param count Filled in with length of the array. | | * @param count Filled in with length of the array. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| void setWeekdays(const UnicodeString* weekdays, int32_t count); | | void setWeekdays(const UnicodeString* weekdays, int32_t count); | |
| | | | |
| /** | | /** | |
|
| * Gets short weekday strings. For example: "Sun", "Mon", etc. | | * Gets abbreviated weekday strings. For example: "Sun", "Mon", etc. (N | |
| | | ote: The method name is | |
| | | * misleading; it does not get the CLDR-style "short" weekday strings, | |
| | | e.g. "Su", "Mo", etc.) | |
| * @param count Filled in with length of the array. | | * @param count Filled in with length of the array. | |
|
| * @return the short weekday strings. (DateFormatSymbols re
tains ownership.) | | * @return the abbreviated weekday strings. (DateFormatSymb
ols retains ownership.) | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| const UnicodeString* getShortWeekdays(int32_t& count) const; | | const UnicodeString* getShortWeekdays(int32_t& count) const; | |
| | | | |
| /** | | /** | |
|
| * Sets short weekday strings. For example: "Sun", "Mon", etc. | | * Sets abbreviated weekday strings. For example: "Sun", "Mon", etc. (N | |
| * @param shortWeekdays the new short weekday strings. (not adopted; c | | ote: The method name is | |
| aller retains ownership) | | * misleading; it does not set the CLDR-style "short" weekday strings, | |
| * @param count Filled in with length of the array. | | e.g. "Su", "Mo", etc.) | |
| | | * @param abbrevWeekdays the new abbreviated weekday strings. (not ado | |
| | | pted; caller retains ownership) | |
| | | * @param count Filled in with length of the array. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
|
| void setShortWeekdays(const UnicodeString* shortWeekdays, int32_t count
); | | void setShortWeekdays(const UnicodeString* abbrevWeekdays, int32_t coun
t); | |
| | | | |
| /** | | /** | |
| * Gets weekday strings by width and context. For example: "Sunday", "M
onday", etc. | | * Gets weekday strings by width and context. For example: "Sunday", "M
onday", etc. | |
| * @param count Filled in with length of the array. | | * @param count Filled in with length of the array. | |
| * @param context The formatting context, either FORMAT or STANDALONE | | * @param context The formatting context, either FORMAT or STANDALONE | |
|
| * @param width The width of returned strings, either WIDE, ABBREVIAT
ED, or NARROW | | * @param width The width of returned strings, either WIDE, ABBREVIAT
ED, SHORT, or NARROW | |
| * @return the month strings. (DateFormatSymbols retains ownership.) | | * @return the month strings. (DateFormatSymbols retains ownership.) | |
| * @stable ICU 3.4 | | * @stable ICU 3.4 | |
| */ | | */ | |
| const UnicodeString* getWeekdays(int32_t& count, DtContextType context,
DtWidthType width) const; | | const UnicodeString* getWeekdays(int32_t& count, DtContextType context,
DtWidthType width) const; | |
| | | | |
| /** | | /** | |
| * Sets weekday strings by width and context. For example: "Sunday", "M
onday", etc. | | * Sets weekday strings by width and context. For example: "Sunday", "M
onday", etc. | |
| * @param weekdays The new weekday strings. (not adopted; caller retai
ns ownership) | | * @param weekdays The new weekday strings. (not adopted; caller retai
ns ownership) | |
| * @param count Filled in with length of the array. | | * @param count Filled in with length of the array. | |
| * @param context The formatting context, either FORMAT or STANDALONE | | * @param context The formatting context, either FORMAT or STANDALONE | |
|
| * @param width The width of returned strings, either WIDE, ABBREVI
ATED, or NARROW | | * @param width The width of returned strings, either WIDE, ABBREVI
ATED, SHORT, or NARROW | |
| * @stable ICU 3.6 | | * @stable ICU 3.6 | |
| */ | | */ | |
| void setWeekdays(const UnicodeString* weekdays, int32_t count, DtContex
tType context, DtWidthType width); | | void setWeekdays(const UnicodeString* weekdays, int32_t count, DtContex
tType context, DtWidthType width); | |
| | | | |
| /** | | /** | |
| * Gets quarter strings by width and context. For example: "1st Quarter
", "2nd Quarter", etc. | | * Gets quarter strings by width and context. For example: "1st Quarter
", "2nd Quarter", etc. | |
| * @param count Filled in with length of the array. | | * @param count Filled in with length of the array. | |
| * @param context The formatting context, either FORMAT or STANDALONE | | * @param context The formatting context, either FORMAT or STANDALONE | |
| * @param width The width of returned strings, either WIDE or ABBREVI
ATED. There | | * @param width The width of returned strings, either WIDE or ABBREVI
ATED. There | |
| * are no NARROW quarters. | | * are no NARROW quarters. | |
| | | | |
| skipping to change at line 595 | | skipping to change at line 606 | |
| UnicodeString* fStandaloneShortMonths; | | UnicodeString* fStandaloneShortMonths; | |
| int32_t fStandaloneShortMonthsCount; | | int32_t fStandaloneShortMonthsCount; | |
| | | | |
| /** | | /** | |
| * Standalone Narrow month strings. For example: "J", "F", etc. | | * Standalone Narrow month strings. For example: "J", "F", etc. | |
| */ | | */ | |
| UnicodeString* fStandaloneNarrowMonths; | | UnicodeString* fStandaloneNarrowMonths; | |
| int32_t fStandaloneNarrowMonthsCount; | | int32_t fStandaloneNarrowMonthsCount; | |
| | | | |
| /** | | /** | |
|
| * Weekday strings. For example: "Sunday", "Monday", etc. | | * CLDR-style format wide weekday strings. For example: "Sunday", "Mond
ay", etc. | |
| */ | | */ | |
| UnicodeString* fWeekdays; | | UnicodeString* fWeekdays; | |
| int32_t fWeekdaysCount; | | int32_t fWeekdaysCount; | |
| | | | |
| /** | | /** | |
|
| * Short weekday strings. For example: "Sun", "Mon", etc. | | * CLDR-style format abbreviated (not short) weekday strings. For examp
le: "Sun", "Mon", etc. | |
| */ | | */ | |
| UnicodeString* fShortWeekdays; | | UnicodeString* fShortWeekdays; | |
| int32_t fShortWeekdaysCount; | | int32_t fShortWeekdaysCount; | |
| | | | |
| /** | | /** | |
|
| * Narrow weekday strings. For example: "Sun", "Mon", etc. | | * CLDR-style format short weekday strings. For example: "Su", "Mo", et | |
| | | c. | |
| | | */ | |
| | | UnicodeString* fShorterWeekdays; | |
| | | int32_t fShorterWeekdaysCount; | |
| | | | |
| | | /** | |
| | | * CLDR-style format narrow weekday strings. For example: "S", "M", etc | |
| | | . | |
| */ | | */ | |
| UnicodeString* fNarrowWeekdays; | | UnicodeString* fNarrowWeekdays; | |
| int32_t fNarrowWeekdaysCount; | | int32_t fNarrowWeekdaysCount; | |
| | | | |
| /** | | /** | |
|
| * Standalone Weekday strings. For example: "Sunday", "Monday", etc. | | * CLDR-style standalone wide weekday strings. For example: "Sunday", "
Monday", etc. | |
| */ | | */ | |
| UnicodeString* fStandaloneWeekdays; | | UnicodeString* fStandaloneWeekdays; | |
| int32_t fStandaloneWeekdaysCount; | | int32_t fStandaloneWeekdaysCount; | |
| | | | |
| /** | | /** | |
|
| * Standalone Short weekday strings. For example: "Sun", "Mon", etc. | | * CLDR-style standalone abbreviated (not short) weekday strings. For e
xample: "Sun", "Mon", etc. | |
| */ | | */ | |
| UnicodeString* fStandaloneShortWeekdays; | | UnicodeString* fStandaloneShortWeekdays; | |
| int32_t fStandaloneShortWeekdaysCount; | | int32_t fStandaloneShortWeekdaysCount; | |
| | | | |
| /** | | /** | |
|
| | | * CLDR-style standalone short weekday strings. For example: "Su", "Mo" | |
| | | , etc. | |
| | | */ | |
| | | UnicodeString* fStandaloneShorterWeekdays; | |
| | | int32_t fStandaloneShorterWeekdaysCount; | |
| | | | |
| | | /** | |
| * Standalone Narrow weekday strings. For example: "Sun", "Mon", etc. | | * Standalone Narrow weekday strings. For example: "Sun", "Mon", etc. | |
| */ | | */ | |
| UnicodeString* fStandaloneNarrowWeekdays; | | UnicodeString* fStandaloneNarrowWeekdays; | |
| int32_t fStandaloneNarrowWeekdaysCount; | | int32_t fStandaloneNarrowWeekdaysCount; | |
| | | | |
| /** | | /** | |
| * Ampm strings. For example: "AM" and "PM". | | * Ampm strings. For example: "AM" and "PM". | |
| */ | | */ | |
| UnicodeString* fAmPms; | | UnicodeString* fAmPms; | |
| int32_t fAmPmsCount; | | int32_t fAmPmsCount; | |
| | | | |
| skipping to change at line 721 | | skipping to change at line 744 | |
| int32_t fZoneStringsRowCount; | | int32_t fZoneStringsRowCount; | |
| int32_t fZoneStringsColCount; | | int32_t fZoneStringsColCount; | |
| | | | |
| Locale fZSFLocale; // Locale used for getting
ZoneStringFormat | | Locale fZSFLocale; // Locale used for getting
ZoneStringFormat | |
| | | | |
| /** | | /** | |
| * Localized date-time pattern characters. For example: use 'u' as 'y'. | | * Localized date-time pattern characters. For example: use 'u' as 'y'. | |
| */ | | */ | |
| UnicodeString fLocalPatternChars; | | UnicodeString fLocalPatternChars; | |
| | | | |
|
| #ifndef U_HIDE_INTERNAL_API | | | |
| /** | | /** | |
| * Capitalization transforms. For each usage type, the first array elem
ent indicates | | * Capitalization transforms. For each usage type, the first array elem
ent indicates | |
| * whether to titlecase for uiListOrMenu context, the second indicates
whether to | | * whether to titlecase for uiListOrMenu context, the second indicates
whether to | |
| * titlecase for stand-alone context. | | * titlecase for stand-alone context. | |
| */ | | */ | |
| UBool fCapitalization[kCapContextUsageTypeCount][2]; | | UBool fCapitalization[kCapContextUsageTypeCount][2]; | |
|
| #endif | | | |
| | | | |
| private: | | private: | |
| /** valid/actual locale information | | /** valid/actual locale information | |
| * these are always ICU locales, so the length should not be a problem | | * these are always ICU locales, so the length should not be a problem | |
| */ | | */ | |
| char validLocale[ULOC_FULLNAME_CAPACITY]; | | char validLocale[ULOC_FULLNAME_CAPACITY]; | |
| char actualLocale[ULOC_FULLNAME_CAPACITY]; | | char actualLocale[ULOC_FULLNAME_CAPACITY]; | |
| | | | |
| DateFormatSymbols(); // default constructor not implemented | | DateFormatSymbols(); // default constructor not implemented | |
| | | | |
| | | | |
End of changes. 18 change blocks. |
| 20 lines changed or deleted | | 48 lines changed or added | |
|
| normalizer2.h | | normalizer2.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
|
| * Copyright (C) 2009-2012, International Business Machines | | * Copyright (C) 2009-2013, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| * | | * | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * file name: normalizer2.h | | * file name: normalizer2.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * tab size: 8 (not used) | | * tab size: 8 (not used) | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 2009nov22 | | * created on: 2009nov22 | |
| * created by: Markus W. Scherer | | * created by: Markus W. Scherer | |
| | | | |
| skipping to change at line 86 | | skipping to change at line 86 | |
| * @stable ICU 4.4 | | * @stable ICU 4.4 | |
| */ | | */ | |
| class U_COMMON_API Normalizer2 : public UObject { | | class U_COMMON_API Normalizer2 : public UObject { | |
| public: | | public: | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
| * @stable ICU 4.4 | | * @stable ICU 4.4 | |
| */ | | */ | |
| ~Normalizer2(); | | ~Normalizer2(); | |
| | | | |
|
| #ifndef U_HIDE_DRAFT_API | | | |
| /** | | /** | |
| * Returns a Normalizer2 instance for Unicode NFC normalization. | | * Returns a Normalizer2 instance for Unicode NFC normalization. | |
| * Same as getInstance(NULL, "nfc", UNORM2_COMPOSE, errorCode). | | * Same as getInstance(NULL, "nfc", UNORM2_COMPOSE, errorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param errorCode Standard ICU error code. Its input value must | | * @param errorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function ret
urns | | * pass the U_SUCCESS() test, or else the function ret
urns | |
| * immediately. Check for U_FAILURE() on output or use
with | | * immediately. Check for U_FAILURE() on output or use
with | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| static const Normalizer2 * | | static const Normalizer2 * | |
| getNFCInstance(UErrorCode &errorCode); | | getNFCInstance(UErrorCode &errorCode); | |
| | | | |
| /** | | /** | |
| * Returns a Normalizer2 instance for Unicode NFD normalization. | | * Returns a Normalizer2 instance for Unicode NFD normalization. | |
| * Same as getInstance(NULL, "nfc", UNORM2_DECOMPOSE, errorCode). | | * Same as getInstance(NULL, "nfc", UNORM2_DECOMPOSE, errorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param errorCode Standard ICU error code. Its input value must | | * @param errorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function ret
urns | | * pass the U_SUCCESS() test, or else the function ret
urns | |
| * immediately. Check for U_FAILURE() on output or use
with | | * immediately. Check for U_FAILURE() on output or use
with | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| static const Normalizer2 * | | static const Normalizer2 * | |
| getNFDInstance(UErrorCode &errorCode); | | getNFDInstance(UErrorCode &errorCode); | |
| | | | |
| /** | | /** | |
| * Returns a Normalizer2 instance for Unicode NFKC normalization. | | * Returns a Normalizer2 instance for Unicode NFKC normalization. | |
| * Same as getInstance(NULL, "nfkc", UNORM2_COMPOSE, errorCode). | | * Same as getInstance(NULL, "nfkc", UNORM2_COMPOSE, errorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param errorCode Standard ICU error code. Its input value must | | * @param errorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function ret
urns | | * pass the U_SUCCESS() test, or else the function ret
urns | |
| * immediately. Check for U_FAILURE() on output or use
with | | * immediately. Check for U_FAILURE() on output or use
with | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| static const Normalizer2 * | | static const Normalizer2 * | |
| getNFKCInstance(UErrorCode &errorCode); | | getNFKCInstance(UErrorCode &errorCode); | |
| | | | |
| /** | | /** | |
| * Returns a Normalizer2 instance for Unicode NFKD normalization. | | * Returns a Normalizer2 instance for Unicode NFKD normalization. | |
| * Same as getInstance(NULL, "nfkc", UNORM2_DECOMPOSE, errorCode). | | * Same as getInstance(NULL, "nfkc", UNORM2_DECOMPOSE, errorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param errorCode Standard ICU error code. Its input value must | | * @param errorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function ret
urns | | * pass the U_SUCCESS() test, or else the function ret
urns | |
| * immediately. Check for U_FAILURE() on output or use
with | | * immediately. Check for U_FAILURE() on output or use
with | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| static const Normalizer2 * | | static const Normalizer2 * | |
| getNFKDInstance(UErrorCode &errorCode); | | getNFKDInstance(UErrorCode &errorCode); | |
| | | | |
| /** | | /** | |
| * Returns a Normalizer2 instance for Unicode NFKC_Casefold normalizati
on. | | * Returns a Normalizer2 instance for Unicode NFKC_Casefold normalizati
on. | |
| * Same as getInstance(NULL, "nfkc_cf", UNORM2_COMPOSE, errorCode). | | * Same as getInstance(NULL, "nfkc_cf", UNORM2_COMPOSE, errorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param errorCode Standard ICU error code. Its input value must | | * @param errorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function ret
urns | | * pass the U_SUCCESS() test, or else the function ret
urns | |
| * immediately. Check for U_FAILURE() on output or use
with | | * immediately. Check for U_FAILURE() on output or use
with | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| static const Normalizer2 * | | static const Normalizer2 * | |
| getNFKCCasefoldInstance(UErrorCode &errorCode); | | getNFKCCasefoldInstance(UErrorCode &errorCode); | |
|
| #endif /* U_HIDE_DRAFT_API */ | | | |
| | | | |
| /** | | /** | |
| * Returns a Normalizer2 instance which uses the specified data file | | * Returns a Normalizer2 instance which uses the specified data file | |
| * (packageName/name similar to ucnv_openPackage() and ures_open()/Reso
urceBundle) | | * (packageName/name similar to ucnv_openPackage() and ures_open()/Reso
urceBundle) | |
| * and which composes or decomposes text according to the specified mod
e. | | * and which composes or decomposes text according to the specified mod
e. | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * | | * | |
| * Use packageName=NULL for data files that are part of ICU's own data. | | * Use packageName=NULL for data files that are part of ICU's own data. | |
| * Use name="nfc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode stand
ard NFC/NFD. | | * Use name="nfc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode stand
ard NFC/NFD. | |
| * Use name="nfkc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode stan
dard NFKC/NFKD. | | * Use name="nfkc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode stan
dard NFKC/NFKD. | |
| | | | |
| skipping to change at line 293 | | skipping to change at line 291 | |
| * When used on a standard NFC Normalizer2 instance, | | * When used on a standard NFC Normalizer2 instance, | |
| * it returns the Decomposition_Mapping only if the Decomposition_Type
(dt) is Canonical (Can); | | * it returns the Decomposition_Mapping only if the Decomposition_Type
(dt) is Canonical (Can); | |
| * in this case, the result contains either one or two code points (=1.
.4 UChars). | | * in this case, the result contains either one or two code points (=1.
.4 UChars). | |
| * | | * | |
| * This function is independent of the mode of the Normalizer2. | | * This function is independent of the mode of the Normalizer2. | |
| * The default implementation returns FALSE. | | * The default implementation returns FALSE. | |
| * @param c code point | | * @param c code point | |
| * @param decomposition String object which will be set to c's | | * @param decomposition String object which will be set to c's | |
| * raw decomposition mapping, if there is one. | | * raw decomposition mapping, if there is one. | |
| * @return TRUE if c has a decomposition, otherwise FALSE | | * @return TRUE if c has a decomposition, otherwise FALSE | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| virtual UBool | | virtual UBool | |
| getRawDecomposition(UChar32 c, UnicodeString &decomposition) const; | | getRawDecomposition(UChar32 c, UnicodeString &decomposition) const; | |
| | | | |
| /** | | /** | |
| * Performs pairwise composition of a & b and returns the composite if
there is one. | | * Performs pairwise composition of a & b and returns the composite if
there is one. | |
| * | | * | |
| * Returns a composite code point c only if c has a two-way mapping to
a+b. | | * Returns a composite code point c only if c has a two-way mapping to
a+b. | |
| * In standard Unicode normalization, this means that | | * In standard Unicode normalization, this means that | |
| * c has a canonical decomposition to a+b | | * c has a canonical decomposition to a+b | |
| * and c does not have the Full_Composition_Exclusion property. | | * and c does not have the Full_Composition_Exclusion property. | |
| * | | * | |
| * This function is independent of the mode of the Normalizer2. | | * This function is independent of the mode of the Normalizer2. | |
| * The default implementation returns a negative value. | | * The default implementation returns a negative value. | |
| * @param a A (normalization starter) code point. | | * @param a A (normalization starter) code point. | |
| * @param b Another code point. | | * @param b Another code point. | |
| * @return The non-negative composite code point if there is one; other
wise a negative value. | | * @return The non-negative composite code point if there is one; other
wise a negative value. | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| virtual UChar32 | | virtual UChar32 | |
| composePair(UChar32 a, UChar32 b) const; | | composePair(UChar32 a, UChar32 b) const; | |
| | | | |
| /** | | /** | |
| * Gets the combining class of c. | | * Gets the combining class of c. | |
| * The default implementation returns 0 | | * The default implementation returns 0 | |
| * but all standard implementations return the Unicode Canonical_Combin
ing_Class value. | | * but all standard implementations return the Unicode Canonical_Combin
ing_Class value. | |
| * @param c code point | | * @param c code point | |
| * @return c's combining class | | * @return c's combining class | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| virtual uint8_t | | virtual uint8_t | |
| getCombiningClass(UChar32 c) const; | | getCombiningClass(UChar32 c) const; | |
| | | | |
| /** | | /** | |
| * Tests if the string is normalized. | | * Tests if the string is normalized. | |
| * Internally, in cases where the quickCheck() method would return "may
be" | | * Internally, in cases where the quickCheck() method would return "may
be" | |
| * (which is only possible for the two COMPOSE modes) this method | | * (which is only possible for the two COMPOSE modes) this method | |
| * resolves to "yes" or "no" to provide a definitive result, | | * resolves to "yes" or "no" to provide a definitive result, | |
| * at the cost of doing more work in those cases. | | * at the cost of doing more work in those cases. | |
| | | | |
| skipping to change at line 432 | | skipping to change at line 430 | |
| * In other words, a string containing this character can be normalized | | * In other words, a string containing this character can be normalized | |
| * by processing portions before this character and after this | | * by processing portions before this character and after this | |
| * character independently. | | * character independently. | |
| * This is used for iterative normalization. See the class documentatio
n for details. | | * This is used for iterative normalization. See the class documentatio
n for details. | |
| * Note that this operation may be significantly slower than hasBoundar
yBefore(). | | * Note that this operation may be significantly slower than hasBoundar
yBefore(). | |
| * @param c character to test | | * @param c character to test | |
| * @return TRUE if c is normalization-inert | | * @return TRUE if c is normalization-inert | |
| * @stable ICU 4.4 | | * @stable ICU 4.4 | |
| */ | | */ | |
| virtual UBool isInert(UChar32 c) const = 0; | | virtual UBool isInert(UChar32 c) const = 0; | |
|
| | | | |
| private: | | | |
| // No ICU "poor man's RTTI" for this class nor its subclasses. | | | |
| virtual UClassID getDynamicClassID() const; | | | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Normalization filtered by a UnicodeSet. | | * Normalization filtered by a UnicodeSet. | |
| * Normalizes portions of the text contained in the filter set and leaves | | * Normalizes portions of the text contained in the filter set and leaves | |
| * portions not contained in the filter set unchanged. | | * portions not contained in the filter set unchanged. | |
| * Filtering is done via UnicodeSet::span(..., USET_SPAN_SIMPLE). | | * Filtering is done via UnicodeSet::span(..., USET_SPAN_SIMPLE). | |
| * Not-in-the-filter text is treated as "is normalized" and "quick check ye
s". | | * Not-in-the-filter text is treated as "is normalized" and "quick check ye
s". | |
| * This class implements all of (and only) the Normalizer2 API. | | * This class implements all of (and only) the Normalizer2 API. | |
| * An instance of this class is unmodifiable/immutable but is constructed a
nd | | * An instance of this class is unmodifiable/immutable but is constructed a
nd | |
| | | | |
| skipping to change at line 547 | | skipping to change at line 541 | |
| | | | |
| /** | | /** | |
| * Gets the raw decomposition mapping of c. | | * Gets the raw decomposition mapping of c. | |
| * For details see the base class documentation. | | * For details see the base class documentation. | |
| * | | * | |
| * This function is independent of the mode of the Normalizer2. | | * This function is independent of the mode of the Normalizer2. | |
| * @param c code point | | * @param c code point | |
| * @param decomposition String object which will be set to c's | | * @param decomposition String object which will be set to c's | |
| * raw decomposition mapping, if there is one. | | * raw decomposition mapping, if there is one. | |
| * @return TRUE if c has a decomposition, otherwise FALSE | | * @return TRUE if c has a decomposition, otherwise FALSE | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| virtual UBool | | virtual UBool | |
| getRawDecomposition(UChar32 c, UnicodeString &decomposition) const; | | getRawDecomposition(UChar32 c, UnicodeString &decomposition) const; | |
| | | | |
| /** | | /** | |
| * Performs pairwise composition of a & b and returns the composite if
there is one. | | * Performs pairwise composition of a & b and returns the composite if
there is one. | |
| * For details see the base class documentation. | | * For details see the base class documentation. | |
| * | | * | |
| * This function is independent of the mode of the Normalizer2. | | * This function is independent of the mode of the Normalizer2. | |
| * @param a A (normalization starter) code point. | | * @param a A (normalization starter) code point. | |
| * @param b Another code point. | | * @param b Another code point. | |
| * @return The non-negative composite code point if there is one; other
wise a negative value. | | * @return The non-negative composite code point if there is one; other
wise a negative value. | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| virtual UChar32 | | virtual UChar32 | |
| composePair(UChar32 a, UChar32 b) const; | | composePair(UChar32 a, UChar32 b) const; | |
| | | | |
| /** | | /** | |
| * Gets the combining class of c. | | * Gets the combining class of c. | |
| * The default implementation returns 0 | | * The default implementation returns 0 | |
| * but all standard implementations return the Unicode Canonical_Combin
ing_Class value. | | * but all standard implementations return the Unicode Canonical_Combin
ing_Class value. | |
| * @param c code point | | * @param c code point | |
| * @return c's combining class | | * @return c's combining class | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| virtual uint8_t | | virtual uint8_t | |
| getCombiningClass(UChar32 c) const; | | getCombiningClass(UChar32 c) const; | |
| | | | |
| /** | | /** | |
| * Tests if the string is normalized. | | * Tests if the string is normalized. | |
| * For details see the Normalizer2 base class documentation. | | * For details see the Normalizer2 base class documentation. | |
| * @param s input string | | * @param s input string | |
| * @param errorCode Standard ICU error code. Its input value must | | * @param errorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function ret
urns | | * pass the U_SUCCESS() test, or else the function ret
urns | |
| | | | |
End of changes. 15 change blocks. |
| 18 lines changed or deleted | | 12 lines changed or added | |
|
| plurfmt.h | | plurfmt.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 2007-2012, International Business Machines Corporation and | | * Copyright (C) 2007-2013, 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 195 | | skipping to change at line 195 | |
| * @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. | |
| * @stable 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); | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for the plural type. | | * Creates a new <code>PluralFormat</code> for the plural type. | |
| * 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 type The plural type (e.g., cardinal or ordinal). | | * @param type The plural type (e.g., cardinal or ordinal). | |
| * @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 50 | | * @draft ICU 50 | |
| */ | | */ | |
| PluralFormat(const Locale& locale, UPluralType type, UErrorCode& status
); | | PluralFormat(const Locale& locale, UPluralType type, UErrorCode& status
); | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Creates a new cardinal-number <code>PluralFormat</code> for a given
pattern string. | | * Creates a new cardinal-number <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
. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| | | | |
| skipping to change at line 269 | | skipping to change at line 271 | |
| * 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. | |
| * @stable 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); | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
| * Creates a new <code>PluralFormat</code> for a plural type, a | | * Creates a new <code>PluralFormat</code> for a plural type, 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 type The plural type (e.g., cardinal or ordinal). | | * @param type The plural type (e.g., cardinal or ordinal). | |
| * @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 50 | | * @draft ICU 50 | |
| */ | | */ | |
| PluralFormat(const Locale& locale, | | PluralFormat(const Locale& locale, | |
| UPluralType type, | | UPluralType type, | |
| const UnicodeString& pattern, | | const UnicodeString& pattern, | |
| UErrorCode& status); | | UErrorCode& status); | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * copy constructor. | | * copy constructor. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| PluralFormat(const PluralFormat& other); | | PluralFormat(const PluralFormat& other); | |
| | | | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| | | | |
| skipping to change at line 385 | | skipping to change at line 389 | |
| * @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. | |
| * @stable 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; | |
| | | | |
|
| | | #ifndef U_HIDE_DEPRECATED_API | |
| /** | | /** | |
| * 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, UPlu
ralType type, UErrorCode& status)} | | * constructed from {@link #PluralFormat(const Locale& locale, UPlu
ralType type, UErrorCode& status)} | |
| * with UPLURAL_TYPE_CARDINAL. | | * with UPLURAL_TYPE_CARDINAL. | |
| * @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. | |
| * @deprecated ICU 50 This method clears the pattern and might create | | * @deprecated ICU 50 This method clears the pattern and might create | |
| * a different kind of PluralRules instance; | | * a different kind of PluralRules instance; | |
| * use one of the constructors to create a new instance ins
tead. | | * use one of the constructors to create a new instance ins
tead. | |
| */ | | */ | |
| void setLocale(const Locale& locale, UErrorCode& status); | | void setLocale(const Locale& locale, UErrorCode& status); | |
|
| | | #endif /* U_HIDE_DEPRECATED_API */ | |
| | | | |
| /** | | /** | |
| * 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
. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| | | | |
End of changes. 7 change blocks. |
| 1 lines changed or deleted | | 7 lines changed or added | |
|
| smpdtfmt.h | | smpdtfmt.h | |
| /* | | /* | |
|
| * Copyright (C) 1997-2012, International Business Machines Corporation and | | * Copyright (C) 1997-2013, International Business Machines Corporation and | |
| * others. All Rights Reserved. | | * others. All Rights Reserved. | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
| * File SMPDTFMT.H | | * File SMPDTFMT.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. | |
| * 07/09/97 helena Make ParsePosition into a class. | | * 07/09/97 helena Make ParsePosition into a class. | |
| | | | |
| skipping to change at line 62 | | skipping to change at line 62 | |
| * which is the standard milliseconds since 24:00 GMT, Jan 1, 1970. | | * which is the standard milliseconds since 24:00 GMT, Jan 1, 1970. | |
| * <P> | | * <P> | |
| * Clients are encouraged to create a date-time formatter using DateFormat:
:getInstance(), | | * Clients are encouraged to create a date-time formatter using DateFormat:
:getInstance(), | |
| * getDateInstance(), getDateInstance(), or getDateTimeInstance() rather th
an | | * getDateInstance(), getDateInstance(), or getDateTimeInstance() rather th
an | |
| * explicitly constructing an instance of SimpleDateFormat. This way, the
client | | * explicitly constructing an instance of SimpleDateFormat. This way, the
client | |
| * is guaranteed to get an appropriate formatting pattern for whatever loca
le the | | * is guaranteed to get an appropriate formatting pattern for whatever loca
le the | |
| * program is running in. However, if the client needs something more unus
ual than | | * program is running in. However, if the client needs something more unus
ual than | |
| * the default patterns in the locales, he can construct a SimpleDateFormat
directly | | * the default patterns in the locales, he can construct a SimpleDateFormat
directly | |
| * and give it an appropriate pattern (or use one of the factory methods on
DateFormat | | * and give it an appropriate pattern (or use one of the factory methods on
DateFormat | |
| * and modify the pattern after the fact with toPattern() and applyPattern(
). | | * and modify the pattern after the fact with toPattern() and applyPattern(
). | |
|
| * <P> | | * | |
| * Date/Time format syntax: | | * <p><strong>Date and Time Patterns:</strong></p> | |
| * <P> | | * | |
| * The date/time format is specified by means of a string time pattern. In | | * <p>Date and time formats are specified by <em>date and time pattern</em> | |
| this | | strings. | |
| * pattern, all ASCII letters are reserved as pattern letters, which are de | | * Within date and time pattern strings, all unquoted ASCII letters [A-Za-z | |
| fined | | ] are reserved | |
| * as the following: | | * as pattern letters representing calendar fields. <code>SimpleDateFormat< | |
| * <pre> | | /code> supports | |
| * \code | | * the date and time formatting algorithm and pattern letters defined by <a | |
| * Symbol Meaning Presentation Example | | href="http://www.unicode.org/reports/tr35/">UTS#35 | |
| * ------ ------- ------------ ------- | | * Unicode Locale Data Markup Language (LDML)</a>. The following pattern le | |
| * G era designator (Text) AD | | tters are | |
| * y year (Number) 1996 | | * currently available:</p> | |
| * Y year (week of year) (Number) 1997 | | * | |
| * u extended year (Number) 4601 | | * <table border="1"> | |
| * U cyclic year name (Text,NumFallback) ren-chen (29) | | * <tr> | |
| * Q Quarter (Text & Number) Q2 & 02 | | * <th>Field</th> | |
| * M month in year (Text & Number) July & 07 | | * <th style="text-align: center">Sym.</th> | |
| * d day in month (Number) 10 | | * <th style="text-align: center">No.</th> | |
| * h hour in am/pm (1~12) (Number) 12 | | * <th>Example</th> | |
| * H hour in day (0~23) (Number) 0 | | * <th>Description</th> | |
| * m minute in hour (Number) 30 | | * </tr> | |
| * s second in minute (Number) 55 | | * <tr> | |
| * S fractional second (Number) 978 | | * <th rowspan="3">era</th> | |
| * (maximum resolution of SSS; truncated if shorter, zero-padded i | | * <td style="text-align: center" rowspan="3">G</td> | |
| f longer) | | * <td style="text-align: center">1..3</td> | |
| * E day of week (Text) Tuesday | | * <td>AD</td> | |
| * e day of week (local 1~7) (Text & Number) Tues & 2 | | * <td rowspan="3">Era - Replaced with the Era string for the curre | |
| * D day in year (Number) 189 | | nt date. One to three letters for the | |
| * F day of week in month (Number) 2 (2nd Wed in July) | | * abbreviated form, four letters for the long form, five for the n | |
| * w week in year (Number) 27 | | arrow form.</td> | |
| * W week in month (Number) 2 | | * </tr> | |
| * a am/pm marker (Text) PM | | * <tr> | |
| * k hour in day (1~24) (Number) 24 | | * <td style="text-align: center">4</td> | |
| * K hour in am/pm (0~11) (Number) 0 | | * <td>Anno Domini</td> | |
| * z time zone (Text) PST | | * </tr> | |
| * zzzz time zone (Text) Pacific Standard Ti | | * <tr> | |
| me | | * <td style="text-align: center">5</td> | |
| * Z time zone (RFC 822) (Number) -0800 | | * <td>A</td> | |
| * ZZZZ time zone (RFC 822) (Text & Number) GMT-08:00 | | * </tr> | |
| * ZZZZZ time zone (ISO 8601) (Text & Number) -08:00 & Z | | * <tr> | |
| * v time zone (generic) (Text) PT | | * <th rowspan="6">year</th> | |
| * vvvv time zone (generic) (Text) Pacific Time | | * <td style="text-align: center">y</td> | |
| * V time zone (abreviation) (Text) PST | | * <td style="text-align: center">1..n</td> | |
| * VVVV time zone (location) (Text) United States Time | | * <td>1996</td> | |
| (Los Angeles) | | * <td>Year. Normally the length specifies the padding, but for two | |
| * g Julian day (Number) 2451334 | | letters it also specifies the maximum | |
| * A milliseconds in day (Number) 69540000 | | * length. Example:<div align="center"> | |
| * q stand alone quarter (Text & Number) Q2 & 02 | | * <center> | |
| * L stand alone month (Text & Number) July & 07 | | * <table border="1" cellpadding="2" cellspacing="0"> | |
| * c stand alone day of week (Text & Number) Tuesday & 2 | | * <tr> | |
| * ' escape for text (Delimiter) 'Date=' | | * <th>Year</th> | |
| * '' single quote (Literal) 'o''clock' | | * <th style="text-align: right">y</th> | |
| * \endcode | | * <th style="text-align: right">yy</th> | |
| * </pre> | | * <th style="text-align: right">yyy</th> | |
| * The count of pattern letters determine the format. | | * <th style="text-align: right">yyyy</th> | |
| * <P> | | * <th style="text-align: right">yyyyy</th> | |
| * (Text): 4 or more, use full form, <4, use short or abbreviated form i | | * </tr> | |
| f it | | * <tr> | |
| * exists. (e.g., "EEEE" produces "Monday", "EEE" produces "Mon") | | * <td>AD 1</td> | |
| * <P> | | * <td style="text-align: right">1</td> | |
| * (Number): the minimum number of digits. Shorter numbers are zero-padded | | * <td style="text-align: right">01</td> | |
| to | | * <td style="text-align: right">001</td> | |
| * this amount (e.g. if "m" produces "6", "mm" produces "06"). Year is hand | | * <td style="text-align: right">0001</td> | |
| led | | * <td style="text-align: right">00001</td> | |
| * specially; that is, if the count of 'y' is 2, the Year will be truncated | | * </tr> | |
| to 2 digits. | | * <tr> | |
| * (e.g., if "yyyy" produces "1997", "yy" produces "97".) | | * <td>AD 12</td> | |
| * Unlike other fields, fractional seconds are padded on the right with zer | | * <td style="text-align: right">12</td> | |
| o. | | * <td style="text-align: right">12</td> | |
| * <P> | | * <td style="text-align: right">012</td> | |
| * (Text & Number): 3 or over, use text, otherwise use number. (e.g., "M" | | * <td style="text-align: right">0012</td> | |
| produces "1", | | * <td style="text-align: right">00012</td> | |
| * "MM" produces "01", "MMM" produces "Jan", and "MMMM" produces "January". | | * </tr> | |
| ) | | * <tr> | |
| * <P> | | * <td>AD 123</td> | |
| * (Text,NumFallback): Behaves like Text if there is supporting data, like | | * <td style="text-align: right">123</td> | |
| * Number otherwise. | | * <td style="text-align: right">23</td> | |
| | | * <td style="text-align: right">123</td> | |
| | | * <td style="text-align: right">0123</td> | |
| | | * <td style="text-align: right">00123</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td>AD 1234</td> | |
| | | * <td style="text-align: right">1234</td> | |
| | | * <td style="text-align: right">34</td> | |
| | | * <td style="text-align: right">1234</td> | |
| | | * <td style="text-align: right">1234</td> | |
| | | * <td style="text-align: right">01234</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td>AD 12345</td> | |
| | | * <td style="text-align: right">12345</td> | |
| | | * <td style="text-align: right">45</td> | |
| | | * <td style="text-align: right">12345</td> | |
| | | * <td style="text-align: right">12345</td> | |
| | | * <td style="text-align: right">12345</td> | |
| | | * </tr> | |
| | | * </table> | |
| | | * </center></div> | |
| | | * </td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">Y</td> | |
| | | * <td style="text-align: center">1..n</td> | |
| | | * <td>1997</td> | |
| | | * <td>Year (in "Week of Year" based calendars). Normally the lengt | |
| | | h specifies the padding, | |
| | | * but for two letters it also specifies the maximum length. This y | |
| | | ear designation is used in ISO | |
| | | * year-week calendar as defined by ISO 8601, but can be used in no | |
| | | n-Gregorian based calendar systems | |
| | | * where week date processing is desired. May not always be the sam | |
| | | e value as calendar year.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">u</td> | |
| | | * <td style="text-align: center">1..n</td> | |
| | | * <td>4601</td> | |
| | | * <td>Extended year. This is a single number designating the year | |
| | | of this calendar system, encompassing | |
| | | * all supra-year fields. For example, for the Julian calendar syst | |
| | | em, year numbers are positive, with an | |
| | | * era of BCE or CE. An extended year value for the Julian calendar | |
| | | system assigns positive values to CE | |
| | | * years and negative values to BCE years, with 1 BCE being year 0. | |
| | | </td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center" rowspan="3">U</td> | |
| | | * <td style="text-align: center">1..3</td> | |
| | | * <td>甲子</td> | |
| | | * <td rowspan="3">Cyclic year name. Calendars such as the Chinese | |
| | | lunar calendar (and related calendars) | |
| | | * and the Hindu calendars use 60-year cycles of year names. Use on | |
| | | e through three letters for the abbreviated | |
| | | * name, four for the full name, or five for the narrow name (curre | |
| | | ntly the data only provides abbreviated names, | |
| | | * which will be used for all requested name widths). If the calend | |
| | | ar does not provide cyclic year name data, | |
| | | * or if the year value to be formatted is out of the range of year | |
| | | s for which cyclic name data is provided, | |
| | | * then numeric formatting is used (behaves like 'y').</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>(currently also 甲子)</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">5</td> | |
| | | * <td>(currently also 甲子)</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th rowspan="6">quarter</th> | |
| | | * <td rowspan="3" style="text-align: center">Q</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>02</td> | |
| | | * <td rowspan="3">Quarter - Use one or two for the numerical quart | |
| | | er, three for the abbreviation, or four | |
| | | * for the full name.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">3</td> | |
| | | * <td>Q2</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>2nd quarter</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="3" style="text-align: center">q</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>02</td> | |
| | | * <td rowspan="3"><b>Stand-Alone</b> Quarter - Use one or two for | |
| | | the numerical quarter, three for the abbreviation, | |
| | | * or four for the full name.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">3</td> | |
| | | * <td>Q2</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>2nd quarter</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th rowspan="8">month</th> | |
| | | * <td rowspan="4" style="text-align: center">M</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>09</td> | |
| | | * <td rowspan="4">Month - Use one or two for the numerical month, | |
| | | three for the abbreviation, four for | |
| | | * the full name, or five for the narrow name.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">3</td> | |
| | | * <td>Sept</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>September</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">5</td> | |
| | | * <td>S</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="4" style="text-align: center">L</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>09</td> | |
| | | * <td rowspan="4"><b>Stand-Alone</b> Month - Use one or two for th | |
| | | e numerical month, three for the abbreviation, | |
| | | * or four for the full name, or 5 for the narrow name.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">3</td> | |
| | | * <td>Sept</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>September</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">5</td> | |
| | | * <td>S</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th rowspan="2">week</th> | |
| | | * <td style="text-align: center">w</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>27</td> | |
| | | * <td>Week of Year.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">W</td> | |
| | | * <td style="text-align: center">1</td> | |
| | | * <td>3</td> | |
| | | * <td>Week of Month</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th rowspan="4">day</th> | |
| | | * <td style="text-align: center">d</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>1</td> | |
| | | * <td>Date - Day of the month</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">D</td> | |
| | | * <td style="text-align: center">1..3</td> | |
| | | * <td>345</td> | |
| | | * <td>Day of year</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">F</td> | |
| | | * <td style="text-align: center">1</td> | |
| | | * <td>2</td> | |
| | | * <td>Day of Week in Month. The example is for the 2nd Wed in July | |
| | | </td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">g</td> | |
| | | * <td style="text-align: center">1..n</td> | |
| | | * <td>2451334</td> | |
| | | * <td>Modified Julian day. This is different from the conventional | |
| | | Julian day number in two regards. | |
| | | * First, it demarcates days at local zone midnight, rather than no | |
| | | on GMT. Second, it is a local number; | |
| | | * that is, it depends on the local time zone. It can be thought of | |
| | | as a single number that encompasses | |
| | | * all the date-related fields.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th rowspan="14">week<br> | |
| | | * day</th> | |
| | | * <td rowspan="4" style="text-align: center">E</td> | |
| | | * <td style="text-align: center">1..3</td> | |
| | | * <td>Tues</td> | |
| | | * <td rowspan="4">Day of week - Use one through three letters for | |
| | | the short day, or four for the full name, | |
| | | * five for the narrow name, or six for the short name.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>Tuesday</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">5</td> | |
| | | * <td>T</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">6</td> | |
| | | * <td>Tu</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="5" style="text-align: center">e</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>2</td> | |
| | | * <td rowspan="5">Local day of week. Same as E except adds a numer | |
| | | ic value that will depend on the local | |
| | | * starting day of the week, using one or two letters. For this exa | |
| | | mple, Monday is the first day of the week.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">3</td> | |
| | | * <td>Tues</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>Tuesday</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">5</td> | |
| | | * <td>T</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">6</td> | |
| | | * <td>Tu</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="5" style="text-align: center">c</td> | |
| | | * <td style="text-align: center">1</td> | |
| | | * <td>2</td> | |
| | | * <td rowspan="5"><b>Stand-Alone</b> local day of week - Use one l | |
| | | etter for the local numeric value (same | |
| | | * as 'e'), three for the short day, four for the full name, five f | |
| | | or the narrow name, or six for | |
| | | * the short name.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">3</td> | |
| | | * <td>Tues</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>Tuesday</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">5</td> | |
| | | * <td>T</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">6</td> | |
| | | * <td>Tu</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th>period</th> | |
| | | * <td style="text-align: center">a</td> | |
| | | * <td style="text-align: center">1</td> | |
| | | * <td>AM</td> | |
| | | * <td>AM or PM</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th rowspan="4">hour</th> | |
| | | * <td style="text-align: center">h</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>11</td> | |
| | | * <td>Hour [1-12]. When used in skeleton data or in a skeleton pas | |
| | | sed in an API for flexible data pattern | |
| | | * generation, it should match the 12-hour-cycle format preferred b | |
| | | y the locale (h or K); it should not match | |
| | | * a 24-hour-cycle format (H or k). Use hh for zero padding.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">H</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>13</td> | |
| | | * <td>Hour [0-23]. When used in skeleton data or in a skeleton pas | |
| | | sed in an API for flexible data pattern | |
| | | * generation, it should match the 24-hour-cycle format preferred b | |
| | | y the locale (H or k); it should not match a | |
| | | * 12-hour-cycle format (h or K). Use HH for zero padding.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">K</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>0</td> | |
| | | * <td>Hour [0-11]. When used in a skeleton, only matches K or h, s | |
| | | ee above. Use KK for zero padding.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">k</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>24</td> | |
| | | * <td>Hour [1-24]. When used in a skeleton, only matches k or H, s | |
| | | ee above. Use kk for zero padding.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th>minute</th> | |
| | | * <td style="text-align: center">m</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>59</td> | |
| | | * <td>Minute. Use one or two for zero padding.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th rowspan="3">second</th> | |
| | | * <td style="text-align: center">s</td> | |
| | | * <td style="text-align: center">1..2</td> | |
| | | * <td>12</td> | |
| | | * <td>Second. Use one or two for zero padding.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">S</td> | |
| | | * <td style="text-align: center">1..n</td> | |
| | | * <td>3456</td> | |
| | | * <td>Fractional Second - truncates (like other time fields) to th | |
| | | e count of letters. | |
| | | * (example shows display using pattern SSSS for seconds value 12.3 | |
| | | 4567)</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">A</td> | |
| | | * <td style="text-align: center">1..n</td> | |
| | | * <td>69540000</td> | |
| | | * <td>Milliseconds in day. This field behaves <i>exactly</i> like | |
| | | a composite of all time-related fields, | |
| | | * not including the zone fields. As such, it also reflects discont | |
| | | inuities of those fields on DST transition | |
| | | * days. On a day of DST onset, it will jump forward. On a day of D | |
| | | ST cessation, it will jump backward. This | |
| | | * reflects the fact that is must be combined with the offset field | |
| | | to obtain a unique local time value.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <th rowspan="23">zone</th> | |
| | | * <td rowspan="2" style="text-align: center">z</td> | |
| | | * <td style="text-align: center">1..3</td> | |
| | | * <td>PDT</td> | |
| | | * <td>The <i>short specific non-location format</i>. | |
| | | * Where that is unavailable, falls back to the <i>short localized | |
| | | GMT format</i> ("O").</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>Pacific Daylight Time</td> | |
| | | * <td>The <i>long specific non-location format</i>. | |
| | | * Where that is unavailable, falls back to the <i>long localized G | |
| | | MT format</i> ("OOOO").</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="3" style="text-align: center">Z</td> | |
| | | * <td style="text-align: center">1..3</td> | |
| | | * <td>-0800</td> | |
| | | * <td>The <i>ISO8601 basic format</i> with hours, minutes and opti | |
| | | onal seconds fields. | |
| | | * The format is equivalent to RFC 822 zone format (when optional s | |
| | | econds field is absent). | |
| | | * This is equivalent to the "xxxx" specifier.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>GMT-8:00</td> | |
| | | * <td>The <i>long localized GMT format</i>. | |
| | | * This is equivalent to the "OOOO" specifier.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">5</td> | |
| | | * <td>-08:00<br> | |
| | | * -07:52:58</td> | |
| | | * <td>The <i>ISO8601 extended format</i> with hours, minutes and o | |
| | | ptional seconds fields. | |
| | | * The ISO8601 UTC indicator "Z" is used when local time offset is | |
| | | 0. | |
| | | * This is equivalent to the "XXXXX" specifier.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="2" style="text-align: center">O</td> | |
| | | * <td style="text-align: center">1</td> | |
| | | * <td>GMT-8</td> | |
| | | * <td>The <i>short localized GMT format</i>.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>GMT-08:00</td> | |
| | | * <td>The <i>long localized GMT format</i>.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="2" style="text-align: center">v</td> | |
| | | * <td style="text-align: center">1</td> | |
| | | * <td>PT</td> | |
| | | * <td>The <i>short generic non-location format</i>. | |
| | | * Where that is unavailable, falls back to the <i>generic location | |
| | | format</i> ("VVVV"), | |
| | | * then the <i>short localized GMT format</i> as the final fallback | |
| | | .</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>Pacific Time</td> | |
| | | * <td>The <i>long generic non-location format</i>. | |
| | | * Where that is unavailable, falls back to <i>generic location for | |
| | | mat</i> ("VVVV"). | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="4" style="text-align: center">V</td> | |
| | | * <td style="text-align: center">1</td> | |
| | | * <td>uslax</td> | |
| | | * <td>The short time zone ID. | |
| | | * Where that is unavailable, the special short time zone ID <i>unk | |
| | | </i> (Unknown Zone) is used.<br> | |
| | | * <i><b>Note</b>: This specifier was originally used for a variant | |
| | | of the short specific non-location format, | |
| | | * but it was deprecated in the later version of the LDML specifica | |
| | | tion. In CLDR 23/ICU 51, the definition of | |
| | | * the specifier was changed to designate a short time zone ID.</i> | |
| | | </td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">2</td> | |
| | | * <td>America/Los_Angeles</td> | |
| | | * <td>The long time zone ID.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">3</td> | |
| | | * <td>Los Angeles</td> | |
| | | * <td>The exemplar city (location) for the time zone. | |
| | | * Where that is unavailable, the localized exemplar city name for | |
| | | the special zone <i>Etc/Unknown</i> is used | |
| | | * as the fallback (for example, "Unknown City"). </td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>Los Angeles Time</td> | |
| | | * <td>The <i>generic location format</i>. | |
| | | * Where that is unavailable, falls back to the <i>long localized G | |
| | | MT format</i> ("OOOO"; | |
| | | * Note: Fallback is only necessary with a GMT-style Time Zone ID, | |
| | | like Etc/GMT-830.)<br> | |
| | | * This is especially useful when presenting possible timezone choi | |
| | | ces for user selection, | |
| | | * since the naming is more uniform than the "v" format.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="5" style="text-align: center">X</td> | |
| | | * <td style="text-align: center">1</td> | |
| | | * <td>-08<br> | |
| | | * +0530<br> | |
| | | * Z</td> | |
| | | * <td>The <i>ISO8601 basic format</i> with hours field and optiona | |
| | | l minutes field. | |
| | | * The ISO8601 UTC indicator "Z" is used when local time offset is | |
| | | 0.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">2</td> | |
| | | * <td>-0800<br> | |
| | | * Z</td> | |
| | | * <td>The <i>ISO8601 basic format</i> with hours and minutes field | |
| | | s. | |
| | | * The ISO8601 UTC indicator "Z" is used when local time offset is | |
| | | 0.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">3</td> | |
| | | * <td>-08:00<br> | |
| | | * Z</td> | |
| | | * <td>The <i>ISO8601 extended format</i> with hours and minutes fi | |
| | | elds. | |
| | | * The ISO8601 UTC indicator "Z" is used when local time offset is | |
| | | 0.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>-0800<br> | |
| | | * -075258<br> | |
| | | * Z</td> | |
| | | * <td>The <i>ISO8601 basic format</i> with hours, minutes and opti | |
| | | onal seconds fields. | |
| | | * (Note: The seconds field is not supported by the ISO8601 specifi | |
| | | cation.) | |
| | | * The ISO8601 UTC indicator "Z" is used when local time offset is | |
| | | 0.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">5</td> | |
| | | * <td>-08:00<br> | |
| | | * -07:52:58<br> | |
| | | * Z</td> | |
| | | * <td>The <i>ISO8601 extended format</i> with hours, minutes and o | |
| | | ptional seconds fields. | |
| | | * (Note: The seconds field is not supported by the ISO8601 specifi | |
| | | cation.) | |
| | | * The ISO8601 UTC indicator "Z" is used when local time offset is | |
| | | 0.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td rowspan="5" style="text-align: center">x</td> | |
| | | * <td style="text-align: center">1</td> | |
| | | * <td>-08<br> | |
| | | * +0530</td> | |
| | | * <td>The <i>ISO8601 basic format</i> with hours field and optiona | |
| | | l minutes field.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">2</td> | |
| | | * <td>-0800</td> | |
| | | * <td>The <i>ISO8601 basic format</i> with hours and minutes field | |
| | | s.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">3</td> | |
| | | * <td>-08:00</td> | |
| | | * <td>The <i>ISO8601 extended format</i> with hours and minutes fi | |
| | | elds.</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">4</td> | |
| | | * <td>-0800<br> | |
| | | * -075258</td> | |
| | | * <td>The <i>ISO8601 basic format</i> with hours, minutes and opti | |
| | | onal seconds fields. | |
| | | * (Note: The seconds field is not supported by the ISO8601 specifi | |
| | | cation.)</td> | |
| | | * </tr> | |
| | | * <tr> | |
| | | * <td style="text-align: center">5</td> | |
| | | * <td>-08:00<br> | |
| | | * -07:52:58</td> | |
| | | * <td>The <i>ISO8601 extended format</i> with hours, minutes and o | |
| | | ptional seconds fields. | |
| | | * (Note: The seconds field is not supported by the ISO8601 specifi | |
| | | cation.)</td> | |
| | | * </tr> | |
| | | * </table> | |
| | | * | |
| * <P> | | * <P> | |
| * Any characters in the pattern that are not in the ranges of ['a'..'z'] a
nd | | * Any characters in the pattern that are not in the ranges of ['a'..'z'] a
nd | |
| * ['A'..'Z'] will be treated as quoted text. For instance, characters | | * ['A'..'Z'] will be treated as quoted text. For instance, characters | |
| * like ':', '.', ' ', '#' and '@' will appear in the resulting time text | | * like ':', '.', ' ', '#' and '@' will appear in the resulting time text | |
| * even they are not embraced within single quotes. | | * even they are not embraced within single quotes. | |
| * <P> | | * <P> | |
| * A pattern containing any invalid pattern letter will result in a failing | | * A pattern containing any invalid pattern letter will result in a failing | |
| * UErrorCode result during formatting or parsing. | | * UErrorCode result during formatting or parsing. | |
| * <P> | | * <P> | |
| * Examples using the US locale: | | * Examples using the US locale: | |
| | | | |
| skipping to change at line 776 | | skipping to change at line 1252 | |
| * Set the calendar to be used by this date format. Initially, the defa
ult | | * Set the calendar to be used by this date format. Initially, the defa
ult | |
| * calendar for the specified or default locale is used. The caller sh
ould | | * calendar for the specified or default locale is used. The caller sh
ould | |
| * not delete the Calendar object after it is adopted by this call. | | * not delete the Calendar object after it is adopted by this call. | |
| * Adopting a new calendar will change to the default symbols. | | * Adopting a new calendar will change to the default symbols. | |
| * | | * | |
| * @param calendarToAdopt Calendar object to be adopted. | | * @param calendarToAdopt Calendar object to be adopted. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| virtual void adoptCalendar(Calendar* calendarToAdopt); | | virtual void adoptCalendar(Calendar* calendarToAdopt); | |
| | | | |
|
| /* Cannot use #ifndef U_HIDE_INTERNAL_API for the following draft metho
d since it is virtual */ | | /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method s
ince it is virtual */ | |
| /** | | /** | |
| * Set a particular UDisplayContext value in the formatter, such as | | * Set a particular UDisplayContext value in the formatter, such as | |
| * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. | | * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. | |
| * @param value The UDisplayContext value to set. | | * @param value The UDisplayContext value to set. | |
| * @param status Input/output status. If at entry this indicates a fail
ure | | * @param status Input/output status. If at entry this indicates a fail
ure | |
| * status, the function will do nothing; otherwise this w
ill be | | * status, the function will do nothing; otherwise this w
ill be | |
| * updated with any new status from the function. | | * updated with any new status from the function. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| virtual void setContext(UDisplayContext value, UErrorCode& status); | | virtual void setContext(UDisplayContext value, UErrorCode& status); | |
| | | | |
|
| /* Cannot use #ifndef U_HIDE_INTERNAL_API for the following draft metho
d since it is virtual */ | | /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method s
ince it is virtual */ | |
| /** | | /** | |
| * Get the formatter's UDisplayContext value for the specified UDisplay
ContextType, | | * Get the formatter's UDisplayContext value for the specified UDisplay
ContextType, | |
| * such as UDISPCTX_TYPE_CAPITALIZATION. | | * such as UDISPCTX_TYPE_CAPITALIZATION. | |
| * @param type The UDisplayContextType whose value to return | | * @param type The UDisplayContextType whose value to return | |
| * @param status Input/output status. If at entry this indicates a fail
ure | | * @param status Input/output status. If at entry this indicates a fail
ure | |
| * status, the function will do nothing; otherwise this w
ill be | | * status, the function will do nothing; otherwise this w
ill be | |
| * updated with any new status from the function. | | * updated with any new status from the function. | |
| * @return The UDisplayContextValue for the specified type. | | * @return The UDisplayContextValue for the specified type. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| virtual UDisplayContext getContext(UDisplayContextType type, UErrorCode
& status) const; | | virtual UDisplayContext getContext(UDisplayContextType type, UErrorCode
& status) const; | |
| | | | |
| /* Cannot use #ifndef U_HIDE_INTERNAL_API for the following methods sin
ce they are virtual */ | | /* Cannot use #ifndef U_HIDE_INTERNAL_API for the following methods sin
ce they are virtual */ | |
| /** | | /** | |
| * Sets the TimeZoneFormat to be used by this date/time formatter. | | * Sets the TimeZoneFormat to be used by this date/time formatter. | |
| * The caller should not delete the TimeZoneFormat object after | | * The caller should not delete the TimeZoneFormat object after | |
| * it is adopted by this call. | | * it is adopted by this call. | |
| * @param timeZoneFormatToAdopt The TimeZoneFormat object to be adopted
. | | * @param timeZoneFormatToAdopt The TimeZoneFormat object to be adopted
. | |
| * @internal ICU 49 technology preview | | * @internal ICU 49 technology preview | |
| | | | |
End of changes. 6 change blocks. |
| 84 lines changed or deleted | | 630 lines changed or added | |
|
| tzfmt.h | | tzfmt.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 2011-2012, International Business Machines Corporation and
* | | * Copyright (C) 2011-2013, International Business Machines Corporation and
* | |
| * others. All Rights Reserved.
* | | * others. All Rights Reserved.
* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| */ | | */ | |
| #ifndef __TZFMT_H | | #ifndef __TZFMT_H | |
| #define __TZFMT_H | | #define __TZFMT_H | |
| | | | |
| /** | | /** | |
| * \file | | * \file | |
| * \brief C++ API: TimeZoneFormat | | * \brief C++ API: TimeZoneFormat | |
| */ | | */ | |
| | | | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| | | | |
| #if !UCONFIG_NO_FORMATTING | | #if !UCONFIG_NO_FORMATTING | |
|
| #ifndef U_HIDE_INTERNAL_API | | #ifndef U_HIDE_DRAFT_API | |
| | | | |
| #include "unicode/format.h" | | #include "unicode/format.h" | |
| #include "unicode/timezone.h" | | #include "unicode/timezone.h" | |
| #include "unicode/tznames.h" | | #include "unicode/tznames.h" | |
| | | | |
| U_CDECL_BEGIN | | U_CDECL_BEGIN | |
| /** | | /** | |
| * Constants for time zone display format style used by format/parse APIs | | * Constants for time zone display format style used by format/parse APIs | |
| * in TimeZoneFormat. | | * in TimeZoneFormat. | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 57 | |
| * Specific long format, such as "Eastern Standard Time". | | * Specific long format, such as "Eastern Standard Time". | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UTZFMT_STYLE_SPECIFIC_LONG, | | UTZFMT_STYLE_SPECIFIC_LONG, | |
| /** | | /** | |
| * Specific short format, such as "EST", "PDT". | | * Specific short format, such as "EST", "PDT". | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UTZFMT_STYLE_SPECIFIC_SHORT, | | UTZFMT_STYLE_SPECIFIC_SHORT, | |
| /** | | /** | |
|
| * RFC822 format, such as "-0500" | | | |
| * @draft ICU 50 | | | |
| */ | | | |
| UTZFMT_STYLE_RFC822, | | | |
| /** | | | |
| * Localized GMT offset format, such as "GMT-05:00", "UTC+0100" | | * Localized GMT offset format, such as "GMT-05:00", "UTC+0100" | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UTZFMT_STYLE_LOCALIZED_GMT, | | UTZFMT_STYLE_LOCALIZED_GMT, | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
|
| * ISO 8601 format (extended), such as "-05:00", "Z"(UTC) | | * Short localized GMT offset format, such as "GMT-5", "UTC+1:30" | |
| * @draft ICU 50 | | * This style is equivalent to the LDML date format pattern "O". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_LOCALIZED_GMT_SHORT, | |
| | | /** | |
| | | * Short ISO 8601 local time difference (basic format) or the UTC indic | |
| | | ator. | |
| | | * For example, "-05", "+0530", and "Z"(UTC). | |
| | | * This style is equivalent to the LDML date format pattern "X". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_BASIC_SHORT, | |
| | | /** | |
| | | * Short ISO 8601 locale time difference (basic format). | |
| | | * For example, "-05" and "+0530". | |
| | | * This style is equivalent to the LDML date format pattern "x". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_BASIC_LOCAL_SHORT, | |
| | | /** | |
| | | * Fixed width ISO 8601 local time difference (basic format) or the UTC | |
| | | indicator. | |
| | | * For example, "-0500", "+0530", and "Z"(UTC). | |
| | | * This style is equivalent to the LDML date format pattern "XX". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_BASIC_FIXED, | |
| | | /** | |
| | | * Fixed width ISO 8601 local time difference (basic format). | |
| | | * For example, "-0500" and "+0530". | |
| | | * This style is equivalent to the LDML date format pattern "xx". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_BASIC_LOCAL_FIXED, | |
| | | /** | |
| | | * ISO 8601 local time difference (basic format) with optional seconds | |
| | | field, or the UTC indicator. | |
| | | * For example, "-0500", "+052538", and "Z"(UTC). | |
| | | * This style is equivalent to the LDML date format pattern "XXXX". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_BASIC_FULL, | |
| | | /** | |
| | | * ISO 8601 local time difference (basic format) with optional seconds | |
| | | field. | |
| | | * For example, "-0500" and "+052538". | |
| | | * This style is equivalent to the LDML date format pattern "xxxx". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_BASIC_LOCAL_FULL, | |
| | | /** | |
| | | * Fixed width ISO 8601 local time difference (extended format) or the | |
| | | UTC indicator. | |
| | | * For example, "-05:00", "+05:30", and "Z"(UTC). | |
| | | * This style is equivalent to the LDML date format pattern "XXX". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_EXTENDED_FIXED, | |
| | | /** | |
| | | * Fixed width ISO 8601 local time difference (extended format). | |
| | | * For example, "-05:00" and "+05:30". | |
| | | * This style is equivalent to the LDML date format pattern "xxx" and " | |
| | | ZZZZZ". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_EXTENDED_LOCAL_FIXED, | |
| | | /** | |
| | | * ISO 8601 local time difference (extended format) with optional secon | |
| | | ds field, or the UTC indicator. | |
| | | * For example, "-05:00", "+05:25:38", and "Z"(UTC). | |
| | | * This style is equivalent to the LDML date format pattern "XXXXX". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_EXTENDED_FULL, | |
| | | /** | |
| | | * ISO 8601 local time difference (extended format) with optional secon | |
| | | ds field. | |
| | | * For example, "-05:00" and "+05:25:38". | |
| | | * This style is equivalent to the LDML date format pattern "xxxxx". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ISO_EXTENDED_LOCAL_FULL, | |
| | | /** | |
| | | * Time Zone ID, such as "America/Los_Angeles". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ZONE_ID, | |
| | | /** | |
| | | * Short Time Zone ID (BCP 47 Unicode location extension, time zone typ | |
| | | e value), such as "uslax". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_STYLE_ZONE_ID_SHORT, | |
| | | /** | |
| | | * Exemplar location, such as "Los Angeles" and "Paris". | |
| | | * @draft ICU 51 | |
| */ | | */ | |
|
| UTZFMT_STYLE_ISO8601 | | UTZFMT_STYLE_EXEMPLAR_LOCATION | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| } UTimeZoneFormatStyle; | | } UTimeZoneFormatStyle; | |
| | | | |
| /** | | /** | |
| * Constants for GMT offset pattern types. | | * Constants for GMT offset pattern types. | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| typedef enum UTimeZoneFormatGMTOffsetPatternType { | | typedef enum UTimeZoneFormatGMTOffsetPatternType { | |
| /** | | /** | |
|
| * Positive offset with hour and minute fields | | * Positive offset with hours and minutes fields | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UTZFMT_PAT_POSITIVE_HM, | | UTZFMT_PAT_POSITIVE_HM, | |
| /** | | /** | |
|
| * Positive offset with hour, minute and second fields | | * Positive offset with hours, minutes and seconds fields | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UTZFMT_PAT_POSITIVE_HMS, | | UTZFMT_PAT_POSITIVE_HMS, | |
| /** | | /** | |
|
| * Negative offset with hour and minute fields | | * Negative offset with hours and minutes fields | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UTZFMT_PAT_NEGATIVE_HM, | | UTZFMT_PAT_NEGATIVE_HM, | |
| /** | | /** | |
|
| * Negative offset with hour, minute and second fields | | * Negative offset with hours, minutes and seconds fields | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
|
| UTZFMT_PAT_NEGATIVE_HMS | | UTZFMT_PAT_NEGATIVE_HMS, | |
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Positive offset with hours field | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_PAT_POSITIVE_H, | |
| | | /** | |
| | | * Negative offset with hours field | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZFMT_PAT_NEGATIVE_H, | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| | | #ifndef U_HIDE_INTERNAL_API | |
| | | /** | |
| | | * Number of UTimeZoneFormatGMTOffsetPatternType types. | |
| | | * @internal | |
| | | */ | |
| | | UTZFMT_PAT_COUNT | |
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| } UTimeZoneFormatGMTOffsetPatternType; | | } UTimeZoneFormatGMTOffsetPatternType; | |
| | | | |
| /** | | /** | |
| * Constants for time types used by TimeZoneFormat APIs for | | * Constants for time types used by TimeZoneFormat APIs for | |
| * receiving time type (standard time, daylight time or unknown). | | * receiving time type (standard time, daylight time or unknown). | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| typedef enum UTimeZoneFormatTimeType { | | typedef enum UTimeZoneFormatTimeType { | |
| /** | | /** | |
| * Unknown | | * Unknown | |
| | | | |
| skipping to change at line 336 | | skipping to change at line 439 | |
| /** | | /** | |
| * Sets the default parse options. | | * Sets the default parse options. | |
| * <p><b>Note</b>: By default, an instance of <code>TimeZoneFormat</cod
e> | | * <p><b>Note</b>: By default, an instance of <code>TimeZoneFormat</cod
e> | |
| * created by {@link #createInstance} has no parse options set (UTZFMT_
PARSE_OPTION_NONE). | | * created by {@link #createInstance} has no parse options set (UTZFMT_
PARSE_OPTION_NONE). | |
| * To specify multipe options, use bitwise flags of UTimeZoneFormatPars
eOption. | | * To specify multipe options, use bitwise flags of UTimeZoneFormatPars
eOption. | |
| * @see #UTimeZoneFormatParseOption | | * @see #UTimeZoneFormatParseOption | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| void setDefaultParseOptions(uint32_t flags); | | void setDefaultParseOptions(uint32_t flags); | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
|
| * Returns the RFC822 style time zone string for the given offset. | | * Returns the ISO 8601 basic time zone string for the given offset. | |
| * For example, "-0800". | | * For example, "-08", "-0830" and "Z" | |
| * @param offset The offset from GMT(UTC) in milliseconds. | | * | |
| * @param result Recevies the RFC822 style GMT(UTC) offset format. | | * @param offset the offset from GMT(UTC) in milliseconds. | |
| * @return A reference to the result. | | * @param useUtcIndicator true if ISO 8601 UTC indicator "Z" is used wh | |
| | | en the offset is 0. | |
| | | * @param isShort true if shortest form is used. | |
| | | * @param ignoreSeconds true if non-zero offset seconds is appended. | |
| | | * @param result Receives the ISO format string. | |
| * @param status Receives the status | | * @param status Receives the status | |
|
| * @see #parseOffsetRFC822 | | * @return the ISO 8601 basic format. | |
| * @draft ICU 50 | | * @see #formatOffsetISO8601Extended | |
| | | * @see #parseOffsetISO8601 | |
| | | * @draft ICU 51 | |
| */ | | */ | |
|
| UnicodeString& formatOffsetRFC822(int32_t offset, UnicodeString& result | | UnicodeString& formatOffsetISO8601Basic(int32_t offset, UBool useUtcInd | |
| , UErrorCode& status) const; | | icator, UBool isShort, UBool ignoreSeconds, | |
| | | UnicodeString& result, UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
|
| * Returns the ISO 8601 style time zone string for the given offset. | | * Returns the ISO 8601 extended time zone string for the given offset. | |
| * For example, "-08:00" and "Z". | | * For example, "-08:00", "-08:30" and "Z" | |
| * @param offset The offset from GMT(UTC) in milliseconds. | | * | |
| * @param result Receives the ISO 8601 style GMT(UTC) offset format. | | * @param offset the offset from GMT(UTC) in milliseconds. | |
| | | * @param useUtcIndicator true if ISO 8601 UTC indicator "Z" is used wh | |
| | | en the offset is 0. | |
| | | * @param isShort true if shortest form is used. | |
| | | * @param ignoreSeconds true if non-zero offset seconds is appended. | |
| | | * @param result Receives the ISO format string. | |
| * @param status Receives the status | | * @param status Receives the status | |
|
| * @return A reference to the result. | | * @return the ISO 8601 basic format. | |
| | | * @see #formatOffsetISO8601Extended | |
| * @see #parseOffsetISO8601 | | * @see #parseOffsetISO8601 | |
|
| * @draft ICU 50 | | * @draft ICU 51 | |
| */ | | */ | |
|
| UnicodeString& formatOffsetISO8601(int32_t offset, UnicodeString& resul | | UnicodeString& formatOffsetISO8601Extended(int32_t offset, UBool useUtc | |
| t, UErrorCode& status) const; | | Indicator, UBool isShort, UBool ignoreSeconds, | |
| | | UnicodeString& result, UErrorCode& status) const; | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Returns the localized GMT(UTC) offset format for the given offset. | | * Returns the localized GMT(UTC) offset format for the given offset. | |
| * The localized GMT offset is defined by; | | * The localized GMT offset is defined by; | |
| * <ul> | | * <ul> | |
| * <li>GMT format pattern (e.g. "GMT {0}" - see {@link #getGMTPattern}) | | * <li>GMT format pattern (e.g. "GMT {0}" - see {@link #getGMTPattern}) | |
| * <li>Offset time pattern (e.g. "+HH:mm" - see {@link #getGMTOffsetPat
tern}) | | * <li>Offset time pattern (e.g. "+HH:mm" - see {@link #getGMTOffsetPat
tern}) | |
| * <li>Offset digits (e.g. "0123456789" - see {@link #getGMTOffsetDigit
s}) | | * <li>Offset digits (e.g. "0123456789" - see {@link #getGMTOffsetDigit
s}) | |
| * <li>GMT zero format (e.g. "GMT" - see {@link #getGMTZeroFormat}) | | * <li>GMT zero format (e.g. "GMT" - see {@link #getGMTZeroFormat}) | |
| * </ul> | | * </ul> | |
|
| | | * This format always uses 2 digit hours and minutes. When the given of | |
| | | fset has non-zero | |
| | | * seconds, 2 digit seconds field will be appended. For example, | |
| | | * GMT+05:00 and GMT+05:28:06. | |
| * @param offset the offset from GMT(UTC) in milliseconds. | | * @param offset the offset from GMT(UTC) in milliseconds. | |
| * @param status Receives the status | | * @param status Receives the status | |
| * @param result Receives the localized GMT format string. | | * @param result Receives the localized GMT format string. | |
| * @return A reference to the result. | | * @return A reference to the result. | |
| * @see #parseOffsetLocalizedGMT | | * @see #parseOffsetLocalizedGMT | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UnicodeString& formatOffsetLocalizedGMT(int32_t offset, UnicodeString&
result, UErrorCode& status) const; | | UnicodeString& formatOffsetLocalizedGMT(int32_t offset, UnicodeString&
result, UErrorCode& status) const; | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Returns the short localized GMT(UTC) offset format for the given off | |
| | | set. | |
| | | * The short localized GMT offset is defined by; | |
| | | * <ul> | |
| | | * <li>GMT format pattern (e.g. "GMT {0}" - see {@link #getGMTPattern}) | |
| | | * <li>Offset time pattern (e.g. "+HH:mm" - see {@link #getGMTOffsetPat | |
| | | tern}) | |
| | | * <li>Offset digits (e.g. "0123456789" - see {@link #getGMTOffsetDigit | |
| | | s}) | |
| | | * <li>GMT zero format (e.g. "GMT" - see {@link #getGMTZeroFormat}) | |
| | | * </ul> | |
| | | * This format uses the shortest representation of offset. The hours fi | |
| | | eld does not | |
| | | * have leading zero and lower fields with zero will be truncated. For | |
| | | example, | |
| | | * GMT+5 and GMT+530. | |
| | | * @param offset the offset from GMT(UTC) in milliseconds. | |
| | | * @param status Receives the status | |
| | | * @param result Receives the short localized GMT format string. | |
| | | * @return A reference to the result. | |
| | | * @see #parseOffsetShortLocalizedGMT | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UnicodeString& formatOffsetShortLocalizedGMT(int32_t offset, UnicodeStr | |
| | | ing& result, UErrorCode& status) const; | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| using Format::format; | | using Format::format; | |
| | | | |
| /** | | /** | |
| * Returns the display name of the time zone at the given date for the
style. | | * Returns the display name of the time zone at the given date for the
style. | |
| * @param style The style (e.g. <code>UTZFMT_STYLE_GENERIC_LONG</code>,
<code>UTZFMT_STYLE_LOCALIZED_GMT</code>...) | | * @param style The style (e.g. <code>UTZFMT_STYLE_GENERIC_LONG</code>,
<code>UTZFMT_STYLE_LOCALIZED_GMT</code>...) | |
| * @param tz The time zone. | | * @param tz The time zone. | |
| * @param date The date. | | * @param date The date. | |
| * @param name Receives the display name. | | * @param name Receives the display name. | |
| * @param timeType the output argument for receiving the time type (sta
ndard/daylight/unknown) | | * @param timeType the output argument for receiving the time type (sta
ndard/daylight/unknown) | |
| * used for the display name, or NULL if the information is not necessa
ry. | | * used for the display name, or NULL if the information is not necessa
ry. | |
| * @return A reference to the result | | * @return A reference to the result | |
| * @see #UTimeZoneFormatStyle | | * @see #UTimeZoneFormatStyle | |
| * @see #UTimeZoneFormatTimeType | | * @see #UTimeZoneFormatTimeType | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| virtual UnicodeString& format(UTimeZoneFormatStyle style, const TimeZon
e& tz, UDate date, | | virtual UnicodeString& format(UTimeZoneFormatStyle style, const TimeZon
e& tz, UDate date, | |
| UnicodeString& name, UTimeZoneFormatTimeType* timeType = NULL) cons
t; | | UnicodeString& name, UTimeZoneFormatTimeType* timeType = NULL) cons
t; | |
| | | | |
| /** | | /** | |
|
| * Returns offset from GMT(UTC) in milliseconds for the given RFC822 | | | |
| * style time zone string. When the given string is not an RFC822 time | | | |
| zone | | | |
| * string, this method sets the current position as the error index | | | |
| * to <code>ParsePosition pos</code> and returns 0. | | | |
| * @param text The text contains RFC822 style time zone string (e.g. "- | | | |
| 0800") | | | |
| * at the position. | | | |
| * @param pos The ParsePosition object. | | | |
| * @return The offset from GMT(UTC) in milliseconds for the given RFC82 | | | |
| 2 style | | | |
| * time zone string. | | | |
| * @see #formatOffsetRFC822 | | | |
| * @draft ICU 50 | | | |
| */ | | | |
| int32_t parseOffsetRFC822(const UnicodeString& text, ParsePosition& pos | | | |
| ) const; | | | |
| | | | |
| /** | | | |
| * Returns offset from GMT(UTC) in milliseconds for the given ISO 8601 | | * Returns offset from GMT(UTC) in milliseconds for the given ISO 8601 | |
| * style time zone string. When the given string is not an ISO 8601 tim
e zone | | * style time zone string. When the given string is not an ISO 8601 tim
e zone | |
| * string, this method sets the current position as the error index | | * string, this method sets the current position as the error index | |
| * to <code>ParsePosition pos</code> and returns 0. | | * to <code>ParsePosition pos</code> and returns 0. | |
| * @param text The text contains ISO8601 style time zone string (e.g. "
-08:00", "Z") | | * @param text The text contains ISO8601 style time zone string (e.g. "
-08:00", "Z") | |
| * at the position. | | * at the position. | |
| * @param pos The ParsePosition object. | | * @param pos The ParsePosition object. | |
| * @return The offset from GMT(UTC) in milliseconds for the given ISO 8
601 style | | * @return The offset from GMT(UTC) in milliseconds for the given ISO 8
601 style | |
| * time zone string. | | * time zone string. | |
|
| * @see #formatOffsetISO8601 | | * @see #formatOffsetISO8601Basic | |
| | | * @see #formatOffsetISO8601Extended | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| int32_t parseOffsetISO8601(const UnicodeString& text, ParsePosition& po
s) const; | | int32_t parseOffsetISO8601(const UnicodeString& text, ParsePosition& po
s) const; | |
| | | | |
| /** | | /** | |
| * Returns offset from GMT(UTC) in milliseconds for the given localized
GMT | | * Returns offset from GMT(UTC) in milliseconds for the given localized
GMT | |
| * offset format string. When the given string cannot be parsed, this m
ethod | | * offset format string. When the given string cannot be parsed, this m
ethod | |
| * sets the current position as the error index to <code>ParsePosition
pos</code> | | * sets the current position as the error index to <code>ParsePosition
pos</code> | |
| * and returns 0. | | * and returns 0. | |
| * @param text The text contains a localized GMT offset string at the p
osition. | | * @param text The text contains a localized GMT offset string at the p
osition. | |
| * @param pos The ParsePosition object. | | * @param pos The ParsePosition object. | |
| * @return The offset from GMT(UTC) in milliseconds for the given local
ized GMT | | * @return The offset from GMT(UTC) in milliseconds for the given local
ized GMT | |
| * offset format string. | | * offset format string. | |
| * @see #formatOffsetLocalizedGMT | | * @see #formatOffsetLocalizedGMT | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| int32_t parseOffsetLocalizedGMT(const UnicodeString& text, ParsePositio
n& pos) const; | | int32_t parseOffsetLocalizedGMT(const UnicodeString& text, ParsePositio
n& pos) const; | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Returns offset from GMT(UTC) in milliseconds for the given short loc | |
| | | alized GMT | |
| | | * offset format string. When the given string cannot be parsed, this m | |
| | | ethod | |
| | | * sets the current position as the error index to <code>ParsePosition | |
| | | pos</code> | |
| | | * and returns 0. | |
| | | * @param text The text contains a short localized GMT offset string at | |
| | | the position. | |
| | | * @param pos The ParsePosition object. | |
| | | * @return The offset from GMT(UTC) in milliseconds for the given short | |
| | | localized GMT | |
| | | * offset format string. | |
| | | * @see #formatOffsetShortLocalizedGMT | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | int32_t parseOffsetShortLocalizedGMT(const UnicodeString& text, ParsePo | |
| | | sition& pos) const; | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Returns a <code>TimeZone</code> by parsing the time zone string acco
rding to | | * Returns a <code>TimeZone</code> by parsing the time zone string acco
rding to | |
| * the given parse position, the specified format style and parse optio
ns. | | * the given parse position, the specified format style and parse optio
ns. | |
| * | | * | |
| * @param text The text contains a time zone string at the position. | | * @param text The text contains a time zone string at the position. | |
| * @param style The format style | | * @param style The format style | |
| * @param pos The position. | | * @param pos The position. | |
| * @param parseOptions The parse options repesented by bitwise flags of
UTimeZoneFormatParseOption. | | * @param parseOptions The parse options repesented by bitwise flags of
UTimeZoneFormatParseOption. | |
| * @param timeType The output argument for receiving the time type (sta
ndard/daylight/unknown), | | * @param timeType The output argument for receiving the time type (sta
ndard/daylight/unknown), | |
| * or NULL if the information is not necessary. | | * or NULL if the information is not necessary. | |
| | | | |
| skipping to change at line 547 | | skipping to change at line 692 | |
| /* TimeZoneNames object used by this formatter */ | | /* TimeZoneNames object used by this formatter */ | |
| TimeZoneNames* fTimeZoneNames; | | TimeZoneNames* fTimeZoneNames; | |
| | | | |
| /* TimeZoneGenericNames object used by this formatter - lazily instanti
ated */ | | /* TimeZoneGenericNames object used by this formatter - lazily instanti
ated */ | |
| TimeZoneGenericNames* fTimeZoneGenericNames; | | TimeZoneGenericNames* fTimeZoneGenericNames; | |
| | | | |
| /* Localized GMT format pattern - e.g. "GMT{0}" */ | | /* Localized GMT format pattern - e.g. "GMT{0}" */ | |
| UnicodeString fGMTPattern; | | UnicodeString fGMTPattern; | |
| | | | |
| /* Array of offset patterns used by Localized GMT format - e.g. "+HH:mm
" */ | | /* Array of offset patterns used by Localized GMT format - e.g. "+HH:mm
" */ | |
|
| UnicodeString fGMTOffsetPatterns[UTZFMT_PAT_NEGATIVE_HMS + 1]; | | UnicodeString fGMTOffsetPatterns[UTZFMT_PAT_COUNT]; | |
| | | | |
| /* Localized decimal digits used by Localized GMT format */ | | /* Localized decimal digits used by Localized GMT format */ | |
| UChar32 fGMTOffsetDigits[10]; | | UChar32 fGMTOffsetDigits[10]; | |
| | | | |
| /* Localized GMT zero format - e.g. "GMT" */ | | /* Localized GMT zero format - e.g. "GMT" */ | |
| UnicodeString fGMTZeroFormat; | | UnicodeString fGMTZeroFormat; | |
| | | | |
| /* Bit flags representing parse options */ | | /* Bit flags representing parse options */ | |
| uint32_t fDefParseOptionFlags; | | uint32_t fDefParseOptionFlags; | |
| | | | |
| /* Constant parts of GMT format pattern, populated from localized GMT f
ormat pattern*/ | | /* Constant parts of GMT format pattern, populated from localized GMT f
ormat pattern*/ | |
| UnicodeString fGMTPatternPrefix; /* Substring before {0} */ | | UnicodeString fGMTPatternPrefix; /* Substring before {0} */ | |
| UnicodeString fGMTPatternSuffix; /* Substring after {0} */ | | UnicodeString fGMTPatternSuffix; /* Substring after {0} */ | |
| | | | |
| /* Compiled offset patterns generated from fGMTOffsetPatterns[] */ | | /* Compiled offset patterns generated from fGMTOffsetPatterns[] */ | |
|
| UVector* fGMTOffsetPatternItems[UTZFMT_PAT_NEGATIVE_HMS + 1]; | | UVector* fGMTOffsetPatternItems[UTZFMT_PAT_COUNT]; | |
| | | | |
| | | UBool fAbuttingOffsetHoursAndMinutes; | |
| | | | |
| /** | | /** | |
| * Returns the time zone's specific format string. | | * Returns the time zone's specific format string. | |
| * @param tz the time zone | | * @param tz the time zone | |
| * @param stdType the name type used for standard time | | * @param stdType the name type used for standard time | |
| * @param dstType the name type used for daylight time | | * @param dstType the name type used for daylight time | |
| * @param date the date | | * @param date the date | |
| * @param name receives the time zone's specific format name string | | * @param name receives the time zone's specific format name string | |
| * @param timeType when null, actual time type is set | | * @param timeType when null, actual time type is set | |
| * @return a reference to name. | | * @return a reference to name. | |
| | | | |
| skipping to change at line 596 | | skipping to change at line 743 | |
| UnicodeString& formatGeneric(const TimeZone& tz, int32_t genType, UDate
date, UnicodeString& name) const; | | UnicodeString& formatGeneric(const TimeZone& tz, int32_t genType, UDate
date, UnicodeString& name) const; | |
| | | | |
| /** | | /** | |
| * Lazily create a TimeZoneGenericNames instance | | * Lazily create a TimeZoneGenericNames instance | |
| * @param status receives the status | | * @param status receives the status | |
| * @return the cached TimeZoneGenericNames. | | * @return the cached TimeZoneGenericNames. | |
| */ | | */ | |
| const TimeZoneGenericNames* getTimeZoneGenericNames(UErrorCode& status)
const; | | const TimeZoneGenericNames* getTimeZoneGenericNames(UErrorCode& status)
const; | |
| | | | |
| /** | | /** | |
|
| | | * Private method returning the time zone's exemplar location string. | |
| | | * This method will never return empty. | |
| | | * @param tz the time zone | |
| | | * @param name receives the time zone's exemplar location name | |
| | | * @return a reference to name. | |
| | | */ | |
| | | UnicodeString& formatExemplarLocation(const TimeZone& tz, UnicodeString | |
| | | & name) const; | |
| | | | |
| | | /** | |
| * Private enum specifying a combination of offset fields | | * Private enum specifying a combination of offset fields | |
| */ | | */ | |
| enum OffsetFields { | | enum OffsetFields { | |
| FIELDS_H, | | FIELDS_H, | |
| FIELDS_HM, | | FIELDS_HM, | |
| FIELDS_HMS | | FIELDS_HMS | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Parses the localized GMT pattern string and initialize | | * Parses the localized GMT pattern string and initialize | |
| | | | |
| skipping to change at line 624 | | skipping to change at line 780 | |
| * Parse the GMT offset pattern into runtime optimized format. | | * Parse the GMT offset pattern into runtime optimized format. | |
| * @param pattern the offset pattern string | | * @param pattern the offset pattern string | |
| * @param required the required set of fields, such as FIELDS_HM | | * @param required the required set of fields, such as FIELDS_HM | |
| * @param status U_ILLEGAL_ARGUMENT is set when the specified pattern d
oes not contain | | * @param status U_ILLEGAL_ARGUMENT is set when the specified pattern d
oes not contain | |
| * pattern letters for the required fields. | | * pattern letters for the required fields. | |
| * @return A list of GMTOffsetField objects, or NULL on error. | | * @return A list of GMTOffsetField objects, or NULL on error. | |
| */ | | */ | |
| static UVector* parseOffsetPattern(const UnicodeString& pattern, Offset
Fields required, UErrorCode& status); | | static UVector* parseOffsetPattern(const UnicodeString& pattern, Offset
Fields required, UErrorCode& status); | |
| | | | |
| /** | | /** | |
|
| * Appends second field to the offset pattern with hour/minute | | * Appends seconds field to the offset pattern with hour/minute | |
| * Note: This code will be obsoleted once we add hour-minute-second pat
tern data in CLDR. | | * Note: This code will be obsoleted once we add hour-minute-second pat
tern data in CLDR. | |
|
| * @param offsetHM the offset pattern including hour and minute fields | | * @param offsetHM the offset pattern including hours and minutes field | |
| * @param result the output offset pattern including hour, minute and s | | s | |
| econd fields | | * @param result the output offset pattern including hour, minute and s | |
| | | econds fields | |
| | | * @param status receives the status | |
| | | * @return a reference to result | |
| | | */ | |
| | | static UnicodeString& expandOffsetPattern(const UnicodeString& offsetHM | |
| | | , UnicodeString& result, UErrorCode& status); | |
| | | | |
| | | /** | |
| | | * Truncates minutes field to the offset pattern with hour/minute | |
| | | * Note: This code will be obsoleted once we add hour pattern data in C | |
| | | LDR. | |
| | | * @param offsetHM the offset pattern including hours and minutes field | |
| | | s | |
| | | * @param result the output offset pattern including only hours field | |
| | | * @param status receives the status | |
| * @return a reference to result | | * @return a reference to result | |
| */ | | */ | |
|
| static UnicodeString& expandOffsetPattern(const UnicodeString& offsetHM
, UnicodeString& result); | | static UnicodeString& truncateOffsetPattern(const UnicodeString& offset
HM, UnicodeString& result, UErrorCode& status); | |
| | | | |
| /** | | /** | |
| * Break input string into UChar32[]. Each array element represents | | * Break input string into UChar32[]. Each array element represents | |
| * a code point. This method is used for parsing localized digit | | * a code point. This method is used for parsing localized digit | |
| * characters and support characters in Unicode supplemental planes. | | * characters and support characters in Unicode supplemental planes. | |
| * @param str the string | | * @param str the string | |
| * @param codeArray receives the result | | * @param codeArray receives the result | |
| * @param capacity the capacity of codeArray | | * @param capacity the capacity of codeArray | |
| * @return TRUE when the specified code array is fully filled with code
points | | * @return TRUE when the specified code array is fully filled with code
points | |
| * (no under/overflow). | | * (no under/overflow). | |
| */ | | */ | |
| static UBool toCodePoints(const UnicodeString& str, UChar32* codeArray,
int32_t capacity); | | static UBool toCodePoints(const UnicodeString& str, UChar32* codeArray,
int32_t capacity); | |
| | | | |
| /** | | /** | |
|
| | | * Private method supprting all of ISO8601 formats | |
| | | * @param offset the offset from GMT(UTC) in milliseconds. | |
| | | * @param useUtcIndicator true if ISO 8601 UTC indicator "Z" is used wh | |
| | | en the offset is 0. | |
| | | * @param isShort true if shortest form is used. | |
| | | * @param ignoreSeconds true if non-zero offset seconds is appended. | |
| | | * @param result Receives the result | |
| | | * @param status Receives the status | |
| | | * @return the ISO 8601 basic format. | |
| | | */ | |
| | | UnicodeString& formatOffsetISO8601(int32_t offset, UBool isBasic, UBool | |
| | | useUtcIndicator, | |
| | | UBool isShort, UBool ignoreSeconds, UnicodeString& result, UErrorCo | |
| | | de& status) const; | |
| | | | |
| | | /** | |
| | | * Private method used for localized GMT formatting. | |
| | | * @param offset the zone's UTC offset | |
| | | * @param isShort true if the short localized GMT format is desired. | |
| | | * @param result receives the localized GMT format string | |
| | | * @param status receives the status | |
| | | */ | |
| | | UnicodeString& formatOffsetLocalizedGMT(int32_t offset, UBool isShort, | |
| | | UnicodeString& result, UErrorCode& status) const; | |
| | | | |
| | | /** | |
| * Returns offset from GMT(UTC) in milliseconds for the given ISO 8601
style | | * Returns offset from GMT(UTC) in milliseconds for the given ISO 8601
style | |
| * (extended format) time zone string. When the given string is not an
ISO 8601 time | | * (extended format) time zone string. When the given string is not an
ISO 8601 time | |
| * zone string, this method sets the current position as the error inde
x | | * zone string, this method sets the current position as the error inde
x | |
| * to <code>ParsePosition pos</code> and returns 0. | | * to <code>ParsePosition pos</code> and returns 0. | |
| * @param text the text contains ISO 8601 style time zone string (e.g.
"-08:00", "Z") | | * @param text the text contains ISO 8601 style time zone string (e.g.
"-08:00", "Z") | |
| * at the position. | | * at the position. | |
| * @param pos the position, non-negative error index will be set on fai
lure. | | * @param pos the position, non-negative error index will be set on fai
lure. | |
| * @param extendedOnly TRUE if parsing the text as ISO 8601 extended of
fset format (e.g. "-08:00"), | | * @param extendedOnly TRUE if parsing the text as ISO 8601 extended of
fset format (e.g. "-08:00"), | |
| * or FALSE to evaluate the text as basic format. | | * or FALSE to evaluate the text as basic format. | |
| * @param hasDigitOffset receiving if the parsed zone string contains o
ffset digits. | | * @param hasDigitOffset receiving if the parsed zone string contains o
ffset digits. | |
| | | | |
| skipping to change at line 677 | | skipping to change at line 866 | |
| */ | | */ | |
| void appendOffsetDigits(UnicodeString& buf, int32_t n, uint8_t minDigit
s) const; | | void appendOffsetDigits(UnicodeString& buf, int32_t n, uint8_t minDigit
s) const; | |
| | | | |
| /** | | /** | |
| * Returns offset from GMT(UTC) in milliseconds for the given localized
GMT | | * Returns offset from GMT(UTC) in milliseconds for the given localized
GMT | |
| * offset format string. When the given string cannot be parsed, this m
ethod | | * offset format string. When the given string cannot be parsed, this m
ethod | |
| * sets the current position as the error index to <code>ParsePosition
pos</code> | | * sets the current position as the error index to <code>ParsePosition
pos</code> | |
| * and returns 0. | | * and returns 0. | |
| * @param text the text contains a localized GMT offset string at the p
osition. | | * @param text the text contains a localized GMT offset string at the p
osition. | |
| * @param pos the position, non-negative error index will be set on fai
lure. | | * @param pos the position, non-negative error index will be set on fai
lure. | |
|
| | | * @param isShort true if this parser to try the short format first | |
| * @param hasDigitOffset receiving if the parsed zone string contains o
ffset digits. | | * @param hasDigitOffset receiving if the parsed zone string contains o
ffset digits. | |
| * @return the offset from GMT(UTC) in milliseconds for the given local
ized GMT | | * @return the offset from GMT(UTC) in milliseconds for the given local
ized GMT | |
| * offset format string. | | * offset format string. | |
| */ | | */ | |
| int32_t parseOffsetLocalizedGMT(const UnicodeString& text, ParsePositio
n& pos, | | int32_t parseOffsetLocalizedGMT(const UnicodeString& text, ParsePositio
n& pos, | |
|
| UBool* hasDigitOffset) const; | | UBool isShort, UBool* hasDigitOffset) const; | |
| | | | |
| | | /** | |
| | | * Parse localized GMT format generated by the patter used by this form | |
| | | atter, except | |
| | | * GMT Zero format. | |
| | | * @param text the input text | |
| | | * @param start the start index | |
| | | * @param isShort true if the short localized format is parsed. | |
| | | * @param parsedLen receives the parsed length | |
| | | * @return the parsed offset in milliseconds | |
| | | */ | |
| | | int32_t parseOffsetLocalizedGMTPattern(const UnicodeString& text, int32 | |
| | | _t start, | |
| | | UBool isShort, int32_t& parsedLen) const; | |
| | | | |
| /** | | /** | |
| * Parses localized GMT offset fields into offset. | | * Parses localized GMT offset fields into offset. | |
| * @param text the input text | | * @param text the input text | |
| * @param start the start index | | * @param start the start index | |
|
| * @param minimumHourWidth true if the parser allows hour field width t
o be 1 | | * @param isShort true if this is a short format - currently not used | |
| * @param parsedLen the parsed length, or 0 on failure. | | * @param parsedLen the parsed length, or 0 on failure. | |
| * @return the parsed offset in milliseconds. | | * @return the parsed offset in milliseconds. | |
| */ | | */ | |
|
| int32_t parseOffsetFields(const UnicodeString& text, int32_t start, UBo | | int32_t parseOffsetFields(const UnicodeString& text, int32_t start, UBo | |
| ol minimumHourWidth, | | ol isShort, int32_t& parsedLen) const; | |
| int32_t& parsedLen) const; | | | |
| | | /** | |
| | | * Parse localized GMT offset fields with the given pattern. | |
| | | * @param text the input text | |
| | | * @param start the start index | |
| | | * @param pattenItems the pattern (already itemized) | |
| | | * @param forceSingleHourDigit true if hours field is parsed as a singl | |
| | | e digit | |
| | | * @param hour receives the hour offset field | |
| | | * @param min receives the minute offset field | |
| | | * @param sec receives the second offset field | |
| | | * @return the parsed length | |
| | | */ | |
| | | int32_t parseOffsetFieldsWithPattern(const UnicodeString& text, int32_t | |
| | | start, | |
| | | UVector* patternItems, UBool forceSingleHourDigit, int32_t& hour, i | |
| | | nt32_t& min, int32_t& sec) const; | |
| | | | |
| /** | | /** | |
| * Parses abutting localized GMT offset fields (such as 0800) into offs
et. | | * Parses abutting localized GMT offset fields (such as 0800) into offs
et. | |
| * @param text the input text | | * @param text the input text | |
| * @param start the start index | | * @param start the start index | |
| * @param parsedLen the parsed length, or 0 on failure | | * @param parsedLen the parsed length, or 0 on failure | |
| * @return the parsed offset in milliseconds. | | * @return the parsed offset in milliseconds. | |
| */ | | */ | |
| int32_t parseAbuttingOffsetFields(const UnicodeString& text, int32_t st
art, int32_t& parsedLen) const; | | int32_t parseAbuttingOffsetFields(const UnicodeString& text, int32_t st
art, int32_t& parsedLen) const; | |
| | | | |
| | | | |
| skipping to change at line 773 | | skipping to change at line 988 | |
| | | | |
| /** | | /** | |
| * Parses offset represented by contiguous ASCII digits. | | * Parses offset represented by contiguous ASCII digits. | |
| * <p> | | * <p> | |
| * Note: This method expects the input position is already at the start
of | | * Note: This method expects the input position is already at the start
of | |
| * ASCII digits and does not parse sign (+/-). | | * ASCII digits and does not parse sign (+/-). | |
| * @param text The text contains a sequence of ASCII digits | | * @param text The text contains a sequence of ASCII digits | |
| * @param pos The parse position | | * @param pos The parse position | |
| * @param minFields The minimum Fields to be parsed | | * @param minFields The minimum Fields to be parsed | |
| * @param maxFields The maximum Fields to be parsed | | * @param maxFields The maximum Fields to be parsed | |
|
| * @param fixedHourWidth true if hour field must be width of 2 | | * @param fixedHourWidth true if hours field must be width of 2 | |
| * @return Parsed offset, 0 or positive number. | | * @return Parsed offset, 0 or positive number. | |
| */ | | */ | |
| static int32_t parseAbuttingAsciiOffsetFields(const UnicodeString& text
, ParsePosition& pos, | | static int32_t parseAbuttingAsciiOffsetFields(const UnicodeString& text
, ParsePosition& pos, | |
| OffsetFields minFields, OffsetFields maxFields, UBool fixedHourWidt
h); | | OffsetFields minFields, OffsetFields maxFields, UBool fixedHourWidt
h); | |
| | | | |
| /** | | /** | |
| * Parses offset represented by ASCII digits and separators. | | * Parses offset represented by ASCII digits and separators. | |
| * <p> | | * <p> | |
| * Note: This method expects the input position is already at the start
of | | * Note: This method expects the input position is already at the start
of | |
| * ASCII digits and does not parse sign (+/-). | | * ASCII digits and does not parse sign (+/-). | |
| * @param text The text | | * @param text The text | |
| * @param pos The parse position | | * @param pos The parse position | |
| * @param sep The separator character | | * @param sep The separator character | |
| * @param minFields The minimum Fields to be parsed | | * @param minFields The minimum Fields to be parsed | |
| * @param maxFields The maximum Fields to be parsed | | * @param maxFields The maximum Fields to be parsed | |
|
| * @param fixedHourWidth true if hour field must be width of 2 | | | |
| * @return Parsed offset, 0 or positive number. | | * @return Parsed offset, 0 or positive number. | |
| */ | | */ | |
| static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParseP
osition& pos, UChar sep, | | static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParseP
osition& pos, UChar sep, | |
|
| OffsetFields minFields, OffsetFields maxFields, UBool fixedHourWidt
h); | | OffsetFields minFields, OffsetFields maxFields); | |
| | | | |
| /** | | /** | |
| * Unquotes the message format style pattern. | | * Unquotes the message format style pattern. | |
| * @param pattern the pattern | | * @param pattern the pattern | |
| * @param result receive the unquoted pattern. | | * @param result receive the unquoted pattern. | |
| * @return A reference to result. | | * @return A reference to result. | |
| */ | | */ | |
| static UnicodeString& unquote(const UnicodeString& pattern, UnicodeStri
ng& result); | | static UnicodeString& unquote(const UnicodeString& pattern, UnicodeStri
ng& result); | |
| | | | |
| /** | | /** | |
| * Initialize localized GMT format offset hour/min/sec patterns. | | * Initialize localized GMT format offset hour/min/sec patterns. | |
| * This method parses patterns into optimized run-time format. | | * This method parses patterns into optimized run-time format. | |
| * @param status receives the status. | | * @param status receives the status. | |
| */ | | */ | |
| void initGMTOffsetPatterns(UErrorCode& status); | | void initGMTOffsetPatterns(UErrorCode& status); | |
| | | | |
| /** | | /** | |
|
| | | * Check if there are any GMT format offset patterns without | |
| | | * any separators between hours field and minutes field and update | |
| | | * fAbuttingOffsetHoursAndMinutes field. This method must be called | |
| | | * after all patterns are parsed into pattern items. | |
| | | */ | |
| | | void checkAbuttingHoursAndMinutes(); | |
| | | | |
| | | /** | |
| * Creates an instance of TimeZone for the given offset | | * Creates an instance of TimeZone for the given offset | |
| * @param offset the offset | | * @param offset the offset | |
| * @return A TimeZone with the given offset | | * @return A TimeZone with the given offset | |
| */ | | */ | |
| TimeZone* createTimeZoneForOffset(int32_t offset) const; | | TimeZone* createTimeZoneForOffset(int32_t offset) const; | |
| | | | |
| /** | | /** | |
| * Returns the time type for the given name type | | * Returns the time type for the given name type | |
| * @param nameType the name type | | * @param nameType the name type | |
| * @return the time type (unknown/standard/daylight) | | * @return the time type (unknown/standard/daylight) | |
| */ | | */ | |
| static UTimeZoneFormatTimeType getTimeType(UTimeZoneNameType nameType); | | static UTimeZoneFormatTimeType getTimeType(UTimeZoneNameType nameType); | |
| | | | |
|
| /* | | /** | |
| * Returns the time zone ID of a match at the specified index within | | * Returns the time zone ID of a match at the specified index within | |
| * the MatchInfoCollection. | | * the MatchInfoCollection. | |
| * @param matches the collection of matches | | * @param matches the collection of matches | |
| * @param idx the index withing matches | | * @param idx the index withing matches | |
| * @param tzID receives the resolved time zone ID | | * @param tzID receives the resolved time zone ID | |
| * @return a reference to tzID. | | * @return a reference to tzID. | |
| */ | | */ | |
| UnicodeString& getTimeZoneID(const TimeZoneNames::MatchInfoCollection*
matches, int32_t idx, UnicodeString& tzID) const; | | UnicodeString& getTimeZoneID(const TimeZoneNames::MatchInfoCollection*
matches, int32_t idx, UnicodeString& tzID) const; | |
|
| | | | |
| | | /** | |
| | | * Parse a zone ID. | |
| | | * @param text the text contains a time zone ID string at the position. | |
| | | * @param pos the position | |
| | | * @param tzID receives the zone ID | |
| | | * @return a reference to tzID | |
| | | */ | |
| | | UnicodeString& parseZoneID(const UnicodeString& text, ParsePosition& po | |
| | | s, UnicodeString& tzID) const; | |
| | | | |
| | | /** | |
| | | * Parse a short zone ID. | |
| | | * @param text the text contains a short time zone ID string at the pos | |
| | | ition. | |
| | | * @param pos the position | |
| | | * @param tzID receives the short zone ID | |
| | | * @return a reference to tzID | |
| | | */ | |
| | | UnicodeString& parseShortZoneID(const UnicodeString& text, ParsePositio | |
| | | n& pos, UnicodeString& tzID) const; | |
| | | | |
| | | /** | |
| | | * Parse an exemplar location string. | |
| | | * @param text the text contains an exemplar location string at the pos | |
| | | ition. | |
| | | * @param pos the position. | |
| | | * @param tzID receives the time zone ID | |
| | | * @return a reference to tzID | |
| | | */ | |
| | | UnicodeString& parseExemplarLocation(const UnicodeString& text, ParsePo | |
| | | sition& pos, UnicodeString& tzID) const; | |
| }; | | }; | |
| | | | |
| U_NAMESPACE_END | | U_NAMESPACE_END | |
| | | | |
|
| #endif /* U_HIDE_INTERNAL_API */ | | #endif /* ndef U_HIDE_DRAFT_API */ | |
| #endif | | #endif /* !UCONFIG_NO_FORMATTING */ | |
| #endif | | #endif | |
| | | | |
End of changes. 42 change blocks. |
| 70 lines changed or deleted | | 358 lines changed or added | |
|
| tznames.h | | tznames.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 2011-2012, International Business Machines Corporation and
* | | * Copyright (C) 2011-2013, International Business Machines Corporation and
* | |
| * others. All Rights Reserved.
* | | * others. All Rights Reserved.
* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| */ | | */ | |
| #ifndef __TZNAMES_H | | #ifndef __TZNAMES_H | |
| #define __TZNAMES_H | | #define __TZNAMES_H | |
| | | | |
| /** | | /** | |
| * \file | | * \file | |
| * \brief C++ API: TimeZoneNames | | * \brief C++ API: TimeZoneNames | |
| */ | | */ | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| | | | |
| #if !UCONFIG_NO_FORMATTING | | #if !UCONFIG_NO_FORMATTING | |
|
| #ifndef U_HIDE_INTERNAL_API | | #ifndef U_HIDE_DRAFT_API | |
| | | | |
| #include "unicode/uloc.h" | | #include "unicode/uloc.h" | |
| #include "unicode/unistr.h" | | #include "unicode/unistr.h" | |
| | | | |
| U_CDECL_BEGIN | | U_CDECL_BEGIN | |
| | | | |
| /** | | /** | |
| * Constants for time zone display name types. | | * Constants for time zone display name types. | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| | | | |
| skipping to change at line 63 | | skipping to change at line 63 | |
| UTZNM_SHORT_GENERIC = 0x08, | | UTZNM_SHORT_GENERIC = 0x08, | |
| /** | | /** | |
| * Short display name for standard time, such as "EST". | | * Short display name for standard time, such as "EST". | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UTZNM_SHORT_STANDARD = 0x10, | | UTZNM_SHORT_STANDARD = 0x10, | |
| /** | | /** | |
| * Short display name for daylight saving time, such as "EDT". | | * Short display name for daylight saving time, such as "EDT". | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
|
| UTZNM_SHORT_DAYLIGHT = 0x20 | | UTZNM_SHORT_DAYLIGHT = 0x20, | |
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Exemplar location name, such as "Los Angeles". | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UTZNM_EXEMPLAR_LOCATION = 0x40 | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| } UTimeZoneNameType; | | } UTimeZoneNameType; | |
| | | | |
| U_CDECL_END | | U_CDECL_END | |
| | | | |
| U_NAMESPACE_BEGIN | | U_NAMESPACE_BEGIN | |
| | | | |
| class UVector; | | class UVector; | |
| struct MatchInfo; | | struct MatchInfo; | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 121 | |
| * For example, time zone "Europe/London" has English long name for standar
d time "Greenwich Mean Time", which is also | | * For example, time zone "Europe/London" has English long name for standar
d time "Greenwich Mean Time", which is also | |
| * shared with other time zones. However, the long name for daylight saving
time is "British Summer Time", which is only | | * shared with other time zones. However, the long name for daylight saving
time is "British Summer Time", which is only | |
| * used for "Europe/London". | | * used for "Europe/London". | |
| * | | * | |
| * <p> | | * <p> | |
| * {@link #getTimeZoneDisplayName} is designed for accessing a name only us
ed by a single time zone. | | * {@link #getTimeZoneDisplayName} is designed for accessing a name only us
ed by a single time zone. | |
| * But is not necessarily mean that a subclass implementation use the same
model with CLDR. A subclass implementation | | * But is not necessarily mean that a subclass implementation use the same
model with CLDR. A subclass implementation | |
| * may provide time zone names only through {@link #getTimeZoneDisplayName}
, or only through {@link #getMetaZoneDisplayName}, | | * may provide time zone names only through {@link #getTimeZoneDisplayName}
, or only through {@link #getMetaZoneDisplayName}, | |
| * or both. | | * or both. | |
| * | | * | |
|
| | | * <p> | |
| | | * The default <code>TimeZoneNames</code> implementation returned by {@link | |
| | | #createInstance} | |
| | | * uses the locale data imported from CLDR. In CLDR, set of meta zone IDs a | |
| | | nd mappings between zone IDs and meta zone | |
| | | * IDs are shared by all locales. Therefore, the behavior of {@link #getAva | |
| | | ilableMetaZoneIDs}, | |
| | | * {@link #getMetaZoneID}, and {@link #getReferenceZoneID} won't be changed | |
| | | no matter | |
| | | * what locale is used for getting an instance of <code>TimeZoneNames</code | |
| | | >. | |
| | | * | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| class U_I18N_API TimeZoneNames : public UObject { | | class U_I18N_API TimeZoneNames : public UObject { | |
| public: | | public: | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| virtual ~TimeZoneNames(); | | virtual ~TimeZoneNames(); | |
| | | | |
| | | | |
| skipping to change at line 190 | | skipping to change at line 204 | |
| * @param mzID Receives the meta zone ID for the given time zone ID at
the given date. If the time zone does not have a | | * @param mzID Receives the meta zone ID for the given time zone ID at
the given date. If the time zone does not have a | |
| * corresponding meta zone at the given date or the implementa
tion does not support meta zones, "bogus" state | | * corresponding meta zone at the given date or the implementa
tion does not support meta zones, "bogus" state | |
| * is set. | | * is set. | |
| * @return A reference to the result. | | * @return A reference to the result. | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| virtual UnicodeString& getMetaZoneID(const UnicodeString& tzID, UDate d
ate, UnicodeString& mzID) const = 0; | | virtual UnicodeString& getMetaZoneID(const UnicodeString& tzID, UDate d
ate, UnicodeString& mzID) const = 0; | |
| | | | |
| /** | | /** | |
| * Returns the reference zone ID for the given meta zone ID for the reg
ion. | | * Returns the reference zone ID for the given meta zone ID for the reg
ion. | |
|
| | | * | |
| | | * Note: Each meta zone must have a reference zone associated with a sp | |
| | | ecial region "001" (world). | |
| | | * Some meta zones may have region specific reference zone IDs other th | |
| | | an the special region | |
| | | * "001". When a meta zone does not have any region specific reference | |
| | | zone IDs, this method | |
| | | * return the reference zone ID for the special region "001" (world). | |
| | | * | |
| * @param mzID The meta zone ID. | | * @param mzID The meta zone ID. | |
| * @param region The region. | | * @param region The region. | |
| * @param tzID Receives the reference zone ID ("golden zone" in the LDM
L specification) for the given time zone ID for the | | * @param tzID Receives the reference zone ID ("golden zone" in the LDM
L specification) for the given time zone ID for the | |
| * region. If the meta zone is unknown or the implementation d
oes not support meta zones, "bogus" state | | * region. If the meta zone is unknown or the implementation d
oes not support meta zones, "bogus" state | |
| * is set. | | * is set. | |
| * @return A reference to the result. | | * @return A reference to the result. | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| virtual UnicodeString& getReferenceZoneID(const UnicodeString& mzID, co
nst char* region, UnicodeString& tzID) const = 0; | | virtual UnicodeString& getReferenceZoneID(const UnicodeString& mzID, co
nst char* region, UnicodeString& tzID) const = 0; | |
| | | | |
| | | | |
| skipping to change at line 280 | | skipping to change at line 300 | |
| * Constructor. | | * Constructor. | |
| * @internal | | * @internal | |
| */ | | */ | |
| MatchInfoCollection(); | | MatchInfoCollection(); | |
| /** | | /** | |
| * Destructor. | | * Destructor. | |
| * @internal | | * @internal | |
| */ | | */ | |
| virtual ~MatchInfoCollection(); | | virtual ~MatchInfoCollection(); | |
| | | | |
|
| | | #ifndef U_HIDE_INTERNAL_API | |
| /** | | /** | |
| * Adds a zone match. | | * Adds a zone match. | |
| * @param nameType The name type. | | * @param nameType The name type. | |
| * @param matchLength The match length. | | * @param matchLength The match length. | |
| * @param tzID The time zone ID. | | * @param tzID The time zone ID. | |
| * @param status Receives the status | | * @param status Receives the status | |
| * @internal | | * @internal | |
| */ | | */ | |
| void addZone(UTimeZoneNameType nameType, int32_t matchLength, | | void addZone(UTimeZoneNameType nameType, int32_t matchLength, | |
| const UnicodeString& tzID, UErrorCode& status); | | const UnicodeString& tzID, UErrorCode& status); | |
| | | | |
| skipping to change at line 345 | | skipping to change at line 366 | |
| UBool getTimeZoneIDAt(int32_t idx, UnicodeString& tzID) const; | | UBool getTimeZoneIDAt(int32_t idx, UnicodeString& tzID) const; | |
| | | | |
| /** | | /** | |
| * Gets the metazone ID of a match at the specified index. | | * Gets the metazone ID of a match at the specified index. | |
| * @param idx The index | | * @param idx The index | |
| * @param mzID Receives the metazone ID | | * @param mzID Receives the metazone ID | |
| * @return TRUE if the meta zone ID was set to mzID. | | * @return TRUE if the meta zone ID was set to mzID. | |
| * @internal | | * @internal | |
| */ | | */ | |
| UBool getMetaZoneIDAt(int32_t idx, UnicodeString& mzID) const; | | UBool getMetaZoneIDAt(int32_t idx, UnicodeString& mzID) const; | |
|
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| | | | |
| private: | | private: | |
| UVector* fMatches; // vector of MatchEntry | | UVector* fMatches; // vector of MatchEntry | |
| | | | |
| UVector* matches(UErrorCode& status); | | UVector* matches(UErrorCode& status); | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Finds time zone name prefix matches for the input text at the | | * Finds time zone name prefix matches for the input text at the | |
| * given offset and returns a collection of the matches. | | * given offset and returns a collection of the matches. | |
| | | | |
| skipping to change at line 366 | | skipping to change at line 388 | |
| * @param start The starting offset within the text. | | * @param start The starting offset within the text. | |
| * @param types The set of name types represented by bitwise flags of U
TimeZoneNameType enums, | | * @param types The set of name types represented by bitwise flags of U
TimeZoneNameType enums, | |
| * or UTZNM_UNKNOWN for all name types. | | * or UTZNM_UNKNOWN for all name types. | |
| * @param status Receives the status. | | * @param status Receives the status. | |
| * @return A collection of matches (owned by the caller), or NULL if no
matches are found. | | * @return A collection of matches (owned by the caller), or NULL if no
matches are found. | |
| * @see UTimeZoneNameType | | * @see UTimeZoneNameType | |
| * @see MatchInfoCollection | | * @see MatchInfoCollection | |
| * @internal | | * @internal | |
| */ | | */ | |
| virtual MatchInfoCollection* find(const UnicodeString& text, int32_t st
art, uint32_t types, UErrorCode& status) const = 0; | | virtual MatchInfoCollection* find(const UnicodeString& text, int32_t st
art, uint32_t types, UErrorCode& status) const = 0; | |
|
| | | | |
| private: | | | |
| // No ICU "poor man's RTTI" for this class nor its subclasses. | | | |
| virtual UClassID getDynamicClassID() const; | | | |
| }; | | }; | |
| | | | |
| U_NAMESPACE_END | | U_NAMESPACE_END | |
| | | | |
|
| #endif /* U_HIDE_INTERNAL_API */ | | #endif /* U_HIDE_DRAFT_API */ | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 8 lines changed or deleted | | 34 lines changed or added | |
|
| udat.h | | udat.h | |
| /* | | /* | |
| **************************************************************************
***** | | **************************************************************************
***** | |
|
| * Copyright (C) 1996-2012, International Business Machines | | * Copyright (C) 1996-2013, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| **************************************************************************
***** | | **************************************************************************
***** | |
| */ | | */ | |
| | | | |
| #ifndef UDAT_H | | #ifndef UDAT_H | |
| #define UDAT_H | | #define UDAT_H | |
| | | | |
| #include "unicode/utypes.h" | | #include "unicode/utypes.h" | |
| | | | |
| #if !UCONFIG_NO_FORMATTING | | #if !UCONFIG_NO_FORMATTING | |
| | | | |
| skipping to change at line 171 | | skipping to change at line 171 | |
| | | | |
| UDAT_LONG_RELATIVE = UDAT_LONG | UDAT_RELATIVE, | | UDAT_LONG_RELATIVE = UDAT_LONG | UDAT_RELATIVE, | |
| | | | |
| UDAT_MEDIUM_RELATIVE = UDAT_MEDIUM | UDAT_RELATIVE, | | UDAT_MEDIUM_RELATIVE = UDAT_MEDIUM | UDAT_RELATIVE, | |
| | | | |
| UDAT_SHORT_RELATIVE = UDAT_SHORT | UDAT_RELATIVE, | | UDAT_SHORT_RELATIVE = UDAT_SHORT | UDAT_RELATIVE, | |
| | | | |
| /** No style */ | | /** No style */ | |
| UDAT_NONE = -1, | | UDAT_NONE = -1, | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
| * Use the pattern given in the parameter to udat_open | | * Use the pattern given in the parameter to udat_open | |
| * @see udat_open | | * @see udat_open | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UDAT_PATTERN = -2, | | UDAT_PATTERN = -2, | |
| | | | |
| /** @internal alias to UDAT_PATTERN */ | | /** @internal alias to UDAT_PATTERN */ | |
| UDAT_IGNORE = UDAT_PATTERN | | UDAT_IGNORE = UDAT_PATTERN | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| } UDateFormatStyle; | | } UDateFormatStyle; | |
| | | | |
| // Skeletons for dates. | | // Skeletons for dates. | |
| | | | |
| /** | | /** | |
| * Constant for date skeleton with year. | | * Constant for date skeleton with year. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_YEAR "y" | | #define UDAT_YEAR "y" | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
| * Constant for date skeleton with quarter. | | * Constant for date skeleton with quarter. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_QUARTER "QQQQ" | | #define UDAT_QUARTER "QQQQ" | |
| /** | | /** | |
| * Constant for date skeleton with abbreviated quarter. | | * Constant for date skeleton with abbreviated quarter. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_ABBR_QUARTER "QQQ" | | #define UDAT_ABBR_QUARTER "QQQ" | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| /** | | /** | |
| * Constant for date skeleton with year and quarter. | | * Constant for date skeleton with year and quarter. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_YEAR_QUARTER "yQQQQ" | | #define UDAT_YEAR_QUARTER "yQQQQ" | |
| /** | | /** | |
| * Constant for date skeleton with year and abbreviated quarter. | | * Constant for date skeleton with year and abbreviated quarter. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_YEAR_ABBR_QUARTER "yQQQ" | | #define UDAT_YEAR_ABBR_QUARTER "yQQQ" | |
| | | | |
| skipping to change at line 262 | | skipping to change at line 266 | |
| * Used in combinations date + time, date + time + zone, or time + zone. | | * Used in combinations date + time, date + time + zone, or time + zone. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd" | | #define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd" | |
| /** | | /** | |
| * Constant for date skeleton with year, numeric month, and day. | | * Constant for date skeleton with year, numeric month, and day. | |
| * Used in combinations date + time, date + time + zone, or time + zone. | | * Used in combinations date + time, date + time + zone, or time + zone. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_YEAR_NUM_MONTH_DAY "yMd" | | #define UDAT_YEAR_NUM_MONTH_DAY "yMd" | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
| * Constant for date skeleton with weekday. | | * Constant for date skeleton with weekday. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_WEEKDAY "EEEE" | | #define UDAT_WEEKDAY "EEEE" | |
| /** | | /** | |
| * Constant for date skeleton with abbreviated weekday. | | * Constant for date skeleton with abbreviated weekday. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_ABBR_WEEKDAY "E" | | #define UDAT_ABBR_WEEKDAY "E" | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| /** | | /** | |
| * Constant for date skeleton with year, month, weekday, and day. | | * Constant for date skeleton with year, month, weekday, and day. | |
| * Used in combinations date + time, date + time + zone, or time + zone. | | * Used in combinations date + time, date + time + zone, or time + zone. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd" | | #define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd" | |
| /** | | /** | |
| * Constant for date skeleton with year, abbreviated month, weekday, and da
y. | | * Constant for date skeleton with year, abbreviated month, weekday, and da
y. | |
| * Used in combinations date + time, date + time + zone, or time + zone. | | * Used in combinations date + time, date + time + zone, or time + zone. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| | | | |
| skipping to change at line 334 | | skipping to change at line 340 | |
| */ | | */ | |
| #define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd" | | #define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd" | |
| | | | |
| // Skeletons for times. | | // Skeletons for times. | |
| | | | |
| /** | | /** | |
| * Constant for date skeleton with hour, with the locale's preferred hour f
ormat (12 or 24). | | * Constant for date skeleton with hour, with the locale's preferred hour f
ormat (12 or 24). | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_HOUR "j" | | #define UDAT_HOUR "j" | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
| * Constant for date skeleton with hour in 24-hour presentation. | | * Constant for date skeleton with hour in 24-hour presentation. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_HOUR24 "H" | | #define UDAT_HOUR24 "H" | |
| /** | | /** | |
| * Constant for date skeleton with minute. | | * Constant for date skeleton with minute. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_MINUTE "m" | | #define UDAT_MINUTE "m" | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| /** | | /** | |
| * Constant for date skeleton with hour and minute, with the locale's prefe
rred hour format (12 or 24). | | * Constant for date skeleton with hour and minute, with the locale's prefe
rred hour format (12 or 24). | |
| * Used in combinations date + time, date + time + zone, or time + zone. | | * Used in combinations date + time, date + time + zone, or time + zone. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_HOUR_MINUTE "jm" | | #define UDAT_HOUR_MINUTE "jm" | |
| /** | | /** | |
| * Constant for date skeleton with hour and minute in 24-hour presentation. | | * Constant for date skeleton with hour and minute in 24-hour presentation. | |
| * Used in combinations date + time, date + time + zone, or time + zone. | | * Used in combinations date + time, date + time + zone, or time + zone. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_HOUR24_MINUTE "Hm" | | #define UDAT_HOUR24_MINUTE "Hm" | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
| * Constant for date skeleton with second. | | * Constant for date skeleton with second. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_SECOND "s" | | #define UDAT_SECOND "s" | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| /** | | /** | |
| * Constant for date skeleton with hour, minute, and second, | | * Constant for date skeleton with hour, minute, and second, | |
| * with the locale's preferred hour format (12 or 24). | | * with the locale's preferred hour format (12 or 24). | |
| * Used in combinations date + time, date + time + zone, or time + zone. | | * Used in combinations date + time, date + time + zone, or time + zone. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_HOUR_MINUTE_SECOND "jms" | | #define UDAT_HOUR_MINUTE_SECOND "jms" | |
| /** | | /** | |
| * Constant for date skeleton with hour, minute, and second in | | * Constant for date skeleton with hour, minute, and second in | |
| * 24-hour presentation. | | * 24-hour presentation. | |
| | | | |
| skipping to change at line 384 | | skipping to change at line 394 | |
| #define UDAT_HOUR24_MINUTE_SECOND "Hms" | | #define UDAT_HOUR24_MINUTE_SECOND "Hms" | |
| /** | | /** | |
| * Constant for date skeleton with minute and second. | | * Constant for date skeleton with minute and second. | |
| * Used in combinations date + time, date + time + zone, or time + zone. | | * Used in combinations date + time, date + time + zone, or time + zone. | |
| * @stable ICU 4.0 | | * @stable ICU 4.0 | |
| */ | | */ | |
| #define UDAT_MINUTE_SECOND "ms" | | #define UDAT_MINUTE_SECOND "ms" | |
| | | | |
| // Skeletons for time zones. | | // Skeletons for time zones. | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
| * Constant for <i>generic location format</i>, such as Los Angeles Time; | | * Constant for <i>generic location format</i>, such as Los Angeles Time; | |
| * used in combinations date + time + zone, or time + zone. | | * used in combinations date + time + zone, or time + zone. | |
| * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | | * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | |
| * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | | * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_LOCATION_TZ "VVVV" | | #define UDAT_LOCATION_TZ "VVVV" | |
| /** | | /** | |
| * Constant for <i>generic non-location format</i>, such as Pacific Time; | | * Constant for <i>generic non-location format</i>, such as Pacific Time; | |
| * used in combinations date + time + zone, or time + zone. | | * used in combinations date + time + zone, or time + zone. | |
| * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | | * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | |
| * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | | * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_GENERIC_TZ "vvvv" | | #define UDAT_GENERIC_TZ "vvvv" | |
| /** | | /** | |
| * Constant for <i>generic non-location format</i>, abbreviated if possible
, such as PT; | | * Constant for <i>generic non-location format</i>, abbreviated if possible
, such as PT; | |
| * used in combinations date + time + zone, or time + zone. | | * used in combinations date + time + zone, or time + zone. | |
| * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | | * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | |
| * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | | * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_ABBR_GENERIC_TZ "v" | | #define UDAT_ABBR_GENERIC_TZ "v" | |
| /** | | /** | |
| * Constant for <i>specific non-location format</i>, such as Pacific Daylig
ht Time; | | * Constant for <i>specific non-location format</i>, such as Pacific Daylig
ht Time; | |
| * used in combinations date + time + zone, or time + zone. | | * used in combinations date + time + zone, or time + zone. | |
| * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | | * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | |
| * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | | * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_SPECIFIC_TZ "zzzz" | | #define UDAT_SPECIFIC_TZ "zzzz" | |
| /** | | /** | |
| * Constant for <i>specific non-location format</i>, abbreviated if possibl
e, such as PDT; | | * Constant for <i>specific non-location format</i>, abbreviated if possibl
e, such as PDT; | |
| * used in combinations date + time + zone, or time + zone. | | * used in combinations date + time + zone, or time + zone. | |
| * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | | * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | |
| * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | | * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_ABBR_SPECIFIC_TZ "z" | | #define UDAT_ABBR_SPECIFIC_TZ "z" | |
| /** | | /** | |
| * Constant for <i>localized GMT/UTC format</i>, such as GMT+8:00 or HPG-8:
00; | | * Constant for <i>localized GMT/UTC format</i>, such as GMT+8:00 or HPG-8:
00; | |
| * used in combinations date + time + zone, or time + zone. | | * used in combinations date + time + zone, or time + zone. | |
| * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | | * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDM
L Date Format Patterns</a> | |
| * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | | * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML
Time Zone Fallback</a> | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
| #define UDAT_ABBR_UTC_TZ "ZZZZ" | | #define UDAT_ABBR_UTC_TZ "ZZZZ" | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| // deprecated skeleton constants | | // deprecated skeleton constants | |
| | | | |
|
| | | #ifndef U_HIDE_DEPRECATED_API | |
| /** | | /** | |
| * Constant for date skeleton with standalone month. | | * Constant for date skeleton with standalone month. | |
| * @deprecated ICU 50 Use UDAT_MONTH instead. | | * @deprecated ICU 50 Use UDAT_MONTH instead. | |
| */ | | */ | |
| #define UDAT_STANDALONE_MONTH "LLLL" | | #define UDAT_STANDALONE_MONTH "LLLL" | |
| /** | | /** | |
| * Constant for date skeleton with standalone abbreviated month. | | * Constant for date skeleton with standalone abbreviated month. | |
| * @deprecated ICU 50 Use UDAT_ABBR_MONTH instead. | | * @deprecated ICU 50 Use UDAT_ABBR_MONTH instead. | |
| */ | | */ | |
| #define UDAT_ABBR_STANDALONE_MONTH "LLL" | | #define UDAT_ABBR_STANDALONE_MONTH "LLL" | |
| | | | |
| skipping to change at line 466 | | skipping to change at line 479 | |
| /** | | /** | |
| * Constant for date skeleton with hour and generic timezone. | | * Constant for date skeleton with hour and generic timezone. | |
| * @deprecated ICU 50 Use instead UDAT_HOUR UDAT_ABBR_GENERIC_TZ or some ot
her timezone presentation. | | * @deprecated ICU 50 Use instead UDAT_HOUR UDAT_ABBR_GENERIC_TZ or some ot
her timezone presentation. | |
| */ | | */ | |
| #define UDAT_HOUR_GENERIC_TZ "jv" | | #define UDAT_HOUR_GENERIC_TZ "jv" | |
| /** | | /** | |
| * Constant for date skeleton with hour and timezone. | | * Constant for date skeleton with hour and timezone. | |
| * @deprecated ICU 50 Use instead UDAT_HOUR UDAT_ABBR_SPECIFIC_TZ or some o
ther timezone presentation. | | * @deprecated ICU 50 Use instead UDAT_HOUR UDAT_ABBR_SPECIFIC_TZ or some o
ther timezone presentation. | |
| */ | | */ | |
| #define UDAT_HOUR_TZ "jz" | | #define UDAT_HOUR_TZ "jz" | |
|
| | | #endif /* U_HIDE_DEPRECATED_API */ | |
| | | | |
| /** | | /** | |
| * FieldPosition and UFieldPosition selectors for format fields | | * FieldPosition and UFieldPosition selectors for format fields | |
| * defined by DateFormat and UDateFormat. | | * defined by DateFormat and UDateFormat. | |
| * @stable ICU 3.0 | | * @stable ICU 3.0 | |
| */ | | */ | |
| typedef enum UDateFormatField { | | typedef enum UDateFormatField { | |
| /** | | /** | |
| * FieldPosition and UFieldPosition selector for 'G' field alignment, | | * FieldPosition and UFieldPosition selector for 'G' field alignment, | |
| * corresponding to the UCAL_ERA field. | | * corresponding to the UCAL_ERA field. | |
| | | | |
| skipping to change at line 711 | | skipping to change at line 725 | |
| * corresponding to the UCAL_ZONE_OFFSET field. | | * corresponding to the UCAL_ZONE_OFFSET field. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| UDAT_TIMEZONE_SPECIAL_FIELD = 29, | | UDAT_TIMEZONE_SPECIAL_FIELD = 29, | |
| | | | |
| /** | | /** | |
| * FieldPosition selector for "U" field alignment, | | * FieldPosition selector for "U" field alignment, | |
| * corresponding to cyclic year names. This is implemented | | * corresponding to cyclic year names. This is implemented | |
| * using the {@link #UCAL_YEAR} field. This displays | | * using the {@link #UCAL_YEAR} field. This displays | |
| * the cyclic year name, if available. | | * the cyclic year name, if available. | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| UDAT_YEAR_NAME_FIELD = 30, | | UDAT_YEAR_NAME_FIELD = 30, | |
| | | | |
|
| /** | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * FieldPosition selector for 'O' field alignment, | |
| | | * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSETfields. | |
| | | * This displays the localized GMT format. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, | |
| | | | |
| | | /** | |
| | | * FieldPosition selector for 'X' field alignment, | |
| | | * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSETfields. | |
| | | * This displays the ISO 8601 local time offset format or UTC indicator | |
| | | ("Z"). | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UDAT_TIMEZONE_ISO_FIELD = 32, | |
| | | | |
| | | /** | |
| | | * FieldPosition selector for 'x' field alignment, | |
| | | * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSETfields. | |
| | | * This displays the ISO 8601 local time offset format. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| | | /** | |
| * Number of FieldPosition and UFieldPosition selectors for | | * Number of FieldPosition and UFieldPosition selectors for | |
| * DateFormat and UDateFormat. | | * DateFormat and UDateFormat. | |
| * Valid selectors range from 0 to UDAT_FIELD_COUNT-1. | | * Valid selectors range from 0 to UDAT_FIELD_COUNT-1. | |
| * This value is subject to change if new fields are defined | | * This value is subject to change if new fields are defined | |
| * in the future. | | * in the future. | |
| * @stable ICU 3.0 | | * @stable ICU 3.0 | |
| */ | | */ | |
|
| UDAT_FIELD_COUNT = 31 | | UDAT_FIELD_COUNT = 34 | |
| | | | |
| } UDateFormatField; | | } UDateFormatField; | |
| | | | |
| /** | | /** | |
| * Maps from a UDateFormatField to the corresponding UCalendarDateFields. | | * Maps from a UDateFormatField to the corresponding UCalendarDateFields. | |
| * Note: since the mapping is many-to-one, there is no inverse mapping. | | * Note: since the mapping is many-to-one, there is no inverse mapping. | |
| * @param field the UDateFormatField. | | * @param field the UDateFormatField. | |
| * @return the UCalendarDateField. This will be UCAL_FIELD_COUNT in case | | * @return the UCalendarDateField. This will be UCAL_FIELD_COUNT in case | |
| * of error (e.g., the input field is UDAT_FIELD_COUNT). | | * of error (e.g., the input field is UDAT_FIELD_COUNT). | |
| * @stable ICU 4.4 | | * @stable ICU 4.4 | |
| | | | |
| skipping to change at line 1076 | | skipping to change at line 1116 | |
| * The possible types of date format symbols | | * The possible types of date format symbols | |
| * @stable ICU 2.6 | | * @stable ICU 2.6 | |
| */ | | */ | |
| typedef enum UDateFormatSymbolType { | | typedef enum UDateFormatSymbolType { | |
| /** The era names, for example AD */ | | /** The era names, for example AD */ | |
| UDAT_ERAS, | | UDAT_ERAS, | |
| /** The month names, for example February */ | | /** The month names, for example February */ | |
| UDAT_MONTHS, | | UDAT_MONTHS, | |
| /** The short month names, for example Feb. */ | | /** The short month names, for example Feb. */ | |
| UDAT_SHORT_MONTHS, | | UDAT_SHORT_MONTHS, | |
|
| /** The weekday names, for example Monday */ | | /** The CLDR-style format "wide" weekday names, for example Monday */ | |
| UDAT_WEEKDAYS, | | UDAT_WEEKDAYS, | |
|
| /** The short weekday names, for example Mon. */ | | /** | |
| | | * The CLDR-style format "abbreviated" (not "short") weekday names, for | |
| | | example "Mon." | |
| | | * For the CLDR-style format "short" weekday names, use UDAT_SHORTER_WE | |
| | | EKDAYS. | |
| | | */ | |
| UDAT_SHORT_WEEKDAYS, | | UDAT_SHORT_WEEKDAYS, | |
| /** The AM/PM names, for example AM */ | | /** The AM/PM names, for example AM */ | |
| UDAT_AM_PMS, | | UDAT_AM_PMS, | |
| /** The localized characters */ | | /** The localized characters */ | |
| UDAT_LOCALIZED_CHARS, | | UDAT_LOCALIZED_CHARS, | |
| /** The long era names, for example Anno Domini */ | | /** The long era names, for example Anno Domini */ | |
| UDAT_ERA_NAMES, | | UDAT_ERA_NAMES, | |
| /** The narrow month names, for example F */ | | /** The narrow month names, for example F */ | |
| UDAT_NARROW_MONTHS, | | UDAT_NARROW_MONTHS, | |
|
| /** The narrow weekday names, for example N */ | | /** The CLDR-style format "narrow" weekday names, for example "M" */ | |
| UDAT_NARROW_WEEKDAYS, | | UDAT_NARROW_WEEKDAYS, | |
| /** Standalone context versions of months */ | | /** Standalone context versions of months */ | |
| UDAT_STANDALONE_MONTHS, | | UDAT_STANDALONE_MONTHS, | |
| UDAT_STANDALONE_SHORT_MONTHS, | | UDAT_STANDALONE_SHORT_MONTHS, | |
| UDAT_STANDALONE_NARROW_MONTHS, | | UDAT_STANDALONE_NARROW_MONTHS, | |
|
| /** Standalone context versions of weekdays */ | | /** The CLDR-style stand-alone "wide" weekday names */ | |
| UDAT_STANDALONE_WEEKDAYS, | | UDAT_STANDALONE_WEEKDAYS, | |
|
| | | /** | |
| | | * The CLDR-style stand-alone "abbreviated" (not "short") weekday names | |
| | | . | |
| | | * For the CLDR-style stand-alone "short" weekday names, use UDAT_STAND | |
| | | ALONE_SHORTER_WEEKDAYS. | |
| | | */ | |
| UDAT_STANDALONE_SHORT_WEEKDAYS, | | UDAT_STANDALONE_SHORT_WEEKDAYS, | |
|
| | | /** The CLDR-style stand-alone "narrow" weekday names */ | |
| UDAT_STANDALONE_NARROW_WEEKDAYS, | | UDAT_STANDALONE_NARROW_WEEKDAYS, | |
| /** The quarters, for example 1st Quarter */ | | /** The quarters, for example 1st Quarter */ | |
| UDAT_QUARTERS, | | UDAT_QUARTERS, | |
| /** The short quarter names, for example Q1 */ | | /** The short quarter names, for example Q1 */ | |
| UDAT_SHORT_QUARTERS, | | UDAT_SHORT_QUARTERS, | |
| /** Standalone context versions of quarters */ | | /** Standalone context versions of quarters */ | |
| UDAT_STANDALONE_QUARTERS, | | UDAT_STANDALONE_QUARTERS, | |
|
| UDAT_STANDALONE_SHORT_QUARTERS | | UDAT_STANDALONE_SHORT_QUARTERS, | |
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * The CLDR-style short weekday names, e.g. "Su", Mo", etc. | |
| | | * These are named "SHORTER" to contrast with the constants using _SHOR | |
| | | T_ | |
| | | * above, which actually get the CLDR-style *abbreviated* versions of t | |
| | | he | |
| | | * corresponding names. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UDAT_SHORTER_WEEKDAYS, | |
| | | /** | |
| | | * Standalone version of UDAT_SHORTER_WEEKDAYS. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | UDAT_STANDALONE_SHORTER_WEEKDAYS | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| } UDateFormatSymbolType; | | } UDateFormatSymbolType; | |
| | | | |
| struct UDateFormatSymbols; | | struct UDateFormatSymbols; | |
| /** Date format symbols. | | /** Date format symbols. | |
| * For usage in C programs. | | * For usage in C programs. | |
| * @stable ICU 2.6 | | * @stable ICU 2.6 | |
| */ | | */ | |
| typedef struct UDateFormatSymbols UDateFormatSymbols; | | typedef struct UDateFormatSymbols UDateFormatSymbols; | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 1192 | | skipping to change at line 1254 | |
| * @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); | |
| | | | |
|
| #ifndef U_HIDE_INTERNAL_API | | #ifndef U_HIDE_DRAFT_API | |
| /** | | /** | |
| * Set a particular UDisplayContext value in the formatter, such as | | * Set a particular UDisplayContext value in the formatter, such as | |
| * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. | | * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. | |
| * @param fmt The formatter for which to set a UDisplayContext value. | | * @param fmt The formatter for which to set a UDisplayContext value. | |
| * @param value The UDisplayContext value to set. | | * @param value The UDisplayContext value to set. | |
| * @param status A pointer to an UErrorCode to receive any errors | | * @param status A pointer to an UErrorCode to receive any errors | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
|
| U_INTERNAL void U_EXPORT2 | | U_DRAFT void U_EXPORT2 | |
| udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status
); | | udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status
); | |
| | | | |
| /** | | /** | |
| * Get the formatter's UDisplayContext value for the specified UDisplayCont
extType, | | * Get the formatter's UDisplayContext value for the specified UDisplayCont
extType, | |
| * such as UDISPCTX_TYPE_CAPITALIZATION. | | * such as UDISPCTX_TYPE_CAPITALIZATION. | |
| * @param fmt The formatter to query. | | * @param fmt The formatter to query. | |
| * @param type The UDisplayContextType whose value to return | | * @param type The UDisplayContextType whose value to return | |
| * @param status A pointer to an UErrorCode to receive any errors | | * @param status A pointer to an UErrorCode to receive any errors | |
| * @return The UDisplayContextValue for the specified type. | | * @return The UDisplayContextValue for the specified type. | |
|
| * @internal ICU 50 technology preview | | * @draft ICU 51 | |
| */ | | */ | |
|
| U_INTERNAL UDisplayContext U_EXPORT2 | | U_DRAFT UDisplayContext U_EXPORT2 | |
| udat_getContext(UDateFormat* fmt, UDisplayContextType type, UErrorCode* sta
tus); | | udat_getContext(UDateFormat* fmt, UDisplayContextType type, UErrorCode* sta
tus); | |
| | | | |
|
| #endif /* U_HIDE_INTERNAL_API */ | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| #ifndef U_HIDE_INTERNAL_API | | #ifndef U_HIDE_INTERNAL_API | |
| /** | | /** | |
| * Extract the date pattern from a UDateFormat set for relative date formatt
ing. | | * Extract the date pattern from a UDateFormat set for relative date formatt
ing. | |
| * The pattern will follow the pattern syntax rules. | | * The pattern will follow the pattern syntax rules. | |
| * @param fmt The formatter to query. | | * @param fmt The formatter to query. | |
| * @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 a UErrorCode to receive any errors | | * @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. | | * @return The total buffer size needed; if greater than resultLength, the o
utput was truncated. | |
| | | | |
| skipping to change at line 1272 | | skipping to change at line 1334 | |
| * @see udat_toPatternRelativeDate, udat_toPatternRelativeTime | | * @see udat_toPatternRelativeDate, udat_toPatternRelativeTime | |
| * @internal ICU 4.2 technology preview | | * @internal ICU 4.2 technology preview | |
| */ | | */ | |
| U_INTERNAL void U_EXPORT2 | | U_INTERNAL void U_EXPORT2 | |
| udat_applyPatternRelative(UDateFormat *format, | | udat_applyPatternRelative(UDateFormat *format, | |
| const UChar *datePattern, | | const UChar *datePattern, | |
| int32_t datePatternLength, | | int32_t datePatternLength, | |
| const UChar *timePattern, | | const UChar *timePattern, | |
| int32_t timePatternLength, | | int32_t timePatternLength, | |
| UErrorCode *status); | | UErrorCode *status); | |
|
| #endif /* U_HIDE_INTERNAL_API */ | | | |
| | | | |
| /** | | /** | |
| * @internal | | * @internal | |
| * @see udat_open | | * @see udat_open | |
| */ | | */ | |
| typedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle time
Style, | | typedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle time
Style, | |
| UDateFormatStyle dateS
tyle, | | UDateFormatStyle dateS
tyle, | |
| const char *loca
le, | | const char *loca
le, | |
| const UChar *tzID
, | | const UChar *tzID
, | |
| int32_t tzIDL
ength, | | int32_t tzIDL
ength, | |
| | | | |
| skipping to change at line 1300 | | skipping to change at line 1361 | |
| */ | | */ | |
| U_INTERNAL void U_EXPORT2 | | U_INTERNAL void U_EXPORT2 | |
| udat_registerOpener(UDateFormatOpener opener, UErrorCode *status); | | udat_registerOpener(UDateFormatOpener opener, UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Un-Register a provider factory | | * Un-Register a provider factory | |
| * @internal ICU 49 | | * @internal ICU 49 | |
| */ | | */ | |
| U_INTERNAL UDateFormatOpener U_EXPORT2 | | U_INTERNAL UDateFormatOpener U_EXPORT2 | |
| udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status); | | udat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status); | |
|
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| | | | |
| #endif /* #if !UCONFIG_NO_FORMATTING */ | | #endif /* #if !UCONFIG_NO_FORMATTING */ | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 46 change blocks. |
| 30 lines changed or deleted | | 99 lines changed or added | |
|
| unistr.h | | unistr.h | |
| /* | | /* | |
| ********************************************************************** | | ********************************************************************** | |
|
| * Copyright (C) 1998-2012, International Business Machines | | * Copyright (C) 1998-2013, 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 57 | | skipping to change at line 57 | |
| #endif | | #endif | |
| | | | |
| #ifndef USTRING_H | | #ifndef USTRING_H | |
| /** | | /** | |
| * \ingroup ustring_ustrlen | | * \ingroup ustring_ustrlen | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| u_strlen(const UChar *s); | | u_strlen(const UChar *s); | |
| #endif | | #endif | |
| | | | |
|
| | | #ifndef U_HIDE_INTERNAL_API | |
| /** | | /** | |
| * \def U_STRING_CASE_MAPPER_DEFINED | | * \def U_STRING_CASE_MAPPER_DEFINED | |
| * @internal | | * @internal | |
| */ | | */ | |
| | | | |
| #ifndef U_STRING_CASE_MAPPER_DEFINED | | #ifndef U_STRING_CASE_MAPPER_DEFINED | |
| #define U_STRING_CASE_MAPPER_DEFINED | | #define U_STRING_CASE_MAPPER_DEFINED | |
| | | | |
| /** | | /** | |
| * Internal string case mapping function type. | | * Internal string case mapping function type. | |
| * @internal | | * @internal | |
| */ | | */ | |
| typedef int32_t U_CALLCONV | | typedef int32_t U_CALLCONV | |
| UStringCaseMapper(const UCaseMap *csm, | | UStringCaseMapper(const UCaseMap *csm, | |
| UChar *dest, int32_t destCapacity, | | UChar *dest, int32_t destCapacity, | |
| const UChar *src, int32_t srcLength, | | const UChar *src, int32_t srcLength, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| #endif | | #endif | |
|
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| | | | |
| U_NAMESPACE_BEGIN | | U_NAMESPACE_BEGIN | |
| | | | |
| class BreakIterator; // unicode/brkiter.h | | class BreakIterator; // unicode/brkiter.h | |
| class Locale; // unicode/locid.h | | class Locale; // unicode/locid.h | |
| class StringCharacterIterator; | | class StringCharacterIterator; | |
| class UnicodeStringAppendable; // unicode/appendable.h | | class UnicodeStringAppendable; // unicode/appendable.h | |
| | | | |
| /* The <iostream> include has been moved to unicode/ustream.h */ | | /* The <iostream> include has been moved to unicode/ustream.h */ | |
| | | | |
| | | | |
| skipping to change at line 145 | | skipping to change at line 147 | |
| * The string parameter must be a C string literal. | | * The string parameter must be a C string literal. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| #define UNICODE_STRING_SIMPLE(cs) UNICODE_STRING(cs, -1) | | #define UNICODE_STRING_SIMPLE(cs) UNICODE_STRING(cs, -1) | |
| | | | |
| /** | | /** | |
| * \def UNISTR_FROM_CHAR_EXPLICIT | | * \def UNISTR_FROM_CHAR_EXPLICIT | |
| * This can be defined to be empty or "explicit". | | * This can be defined to be empty or "explicit". | |
| * If explicit, then the UnicodeString(UChar) and UnicodeString(UChar32) | | * If explicit, then the UnicodeString(UChar) and UnicodeString(UChar32) | |
| * constructors are marked as explicit, preventing their inadvertent use. | | * constructors are marked as explicit, preventing their inadvertent use. | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| #ifndef UNISTR_FROM_CHAR_EXPLICIT | | #ifndef UNISTR_FROM_CHAR_EXPLICIT | |
| # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
|| defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) | | # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
|| defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) | |
| // Auto-"explicit" in ICU library code. | | // Auto-"explicit" in ICU library code. | |
| # define UNISTR_FROM_CHAR_EXPLICIT explicit | | # define UNISTR_FROM_CHAR_EXPLICIT explicit | |
| # else | | # else | |
| // Empty by default for source code compatibility. | | // Empty by default for source code compatibility. | |
| # define UNISTR_FROM_CHAR_EXPLICIT | | # define UNISTR_FROM_CHAR_EXPLICIT | |
| # endif | | # endif | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * \def UNISTR_FROM_STRING_EXPLICIT | | * \def UNISTR_FROM_STRING_EXPLICIT | |
| * This can be defined to be empty or "explicit". | | * This can be defined to be empty or "explicit". | |
| * If explicit, then the UnicodeString(const char *) and UnicodeString(cons
t UChar *) | | * If explicit, then the UnicodeString(const char *) and UnicodeString(cons
t UChar *) | |
| * constructors are marked as explicit, preventing their inadvertent use. | | * constructors are marked as explicit, preventing their inadvertent use. | |
| * | | * | |
| * In particular, this helps prevent accidentally depending on ICU conversi
on code | | * In particular, this helps prevent accidentally depending on ICU conversi
on code | |
| * by passing a string literal into an API with a const UnicodeString & par
ameter. | | * by passing a string literal into an API with a const UnicodeString & par
ameter. | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
| #ifndef UNISTR_FROM_STRING_EXPLICIT | | #ifndef UNISTR_FROM_STRING_EXPLICIT | |
| # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
|| defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) | | # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
|| defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) | |
| // Auto-"explicit" in ICU library code. | | // Auto-"explicit" in ICU library code. | |
| # define UNISTR_FROM_STRING_EXPLICIT explicit | | # define UNISTR_FROM_STRING_EXPLICIT explicit | |
| # else | | # else | |
| // Empty by default for source code compatibility. | | // Empty by default for source code compatibility. | |
| # define UNISTR_FROM_STRING_EXPLICIT | | # define UNISTR_FROM_STRING_EXPLICIT | |
| # endif | | # endif | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 2847 | | skipping to change at line 2849 | |
| */ | | */ | |
| inline const UChar *getTerminatedBuffer(); | | inline const UChar *getTerminatedBuffer(); | |
| | | | |
| //======================================== | | //======================================== | |
| // Constructors | | // Constructors | |
| //======================================== | | //======================================== | |
| | | | |
| /** Construct an empty UnicodeString. | | /** Construct an empty UnicodeString. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
|
| UnicodeString(); | | inline UnicodeString(); | |
| | | | |
| /** | | /** | |
| * Construct a UnicodeString with capacity to hold <TT>capacity</TT> UCha
rs | | * Construct a UnicodeString with capacity to hold <TT>capacity</TT> UCha
rs | |
| * @param capacity the number of UChars this UnicodeString should hold | | * @param capacity the number of UChars this UnicodeString should hold | |
| * before a resize is necessary; if count is greater than 0 and count | | * before a resize is necessary; if count is greater than 0 and count | |
| * code points c take up more space than capacity, then capacity is adjus
ted | | * code points c take up more space than capacity, then capacity is adjus
ted | |
| * accordingly. | | * accordingly. | |
| * @param c is used to initially fill the string | | * @param c is used to initially fill the string | |
| * @param count specifies how many code points c are to be written in the | | * @param count specifies how many code points c are to be written in the | |
| * string | | * string | |
| | | | |
| skipping to change at line 3199 | | skipping to change at line 3201 | |
| * @see u_unescapeAt() | | * @see u_unescapeAt() | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| UnicodeString unescape() const; | | UnicodeString unescape() const; | |
| | | | |
| /** | | /** | |
| * Unescape a single escape sequence and return the represented | | * Unescape a single escape sequence and return the represented | |
| * character. See unescape() for a listing of the recognized escape | | * character. See unescape() for a listing of the recognized escape | |
| * sequences. The character at offset-1 is assumed (without | | * sequences. The character at offset-1 is assumed (without | |
| * checking) to be a backslash. If the escape sequence is | | * checking) to be a backslash. If the escape sequence is | |
|
| * ill-formed, or the offset is out of range, (UChar32)0xFFFFFFFF is | | * ill-formed, or the offset is out of range, U_SENTINEL=-1 is | |
| * returned. | | * returned. | |
| * | | * | |
| * @param offset an input output parameter. On input, it is the | | * @param offset an input output parameter. On input, it is the | |
| * offset into this string where the escape sequence is located, | | * offset into this string where the escape sequence is located, | |
| * after the initial backslash. On output, it is advanced after the | | * after the initial backslash. On output, it is advanced after the | |
| * last character parsed. On error, it is not advanced at all. | | * last character parsed. On error, it is not advanced at all. | |
| * @return the character represented by the escape sequence at | | * @return the character represented by the escape sequence at | |
|
| * offset, or (UChar32)0xFFFFFFFF on error. | | * offset, or U_SENTINEL=-1 on error. | |
| * @see UnicodeString#unescape() | | * @see UnicodeString#unescape() | |
| * @see u_unescape() | | * @see u_unescape() | |
| * @see u_unescapeAt() | | * @see u_unescapeAt() | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| UChar32 unescapeAt(int32_t &offset) const; | | UChar32 unescapeAt(int32_t &offset) const; | |
| | | | |
| /** | | /** | |
| * ICU "poor man's RTTI", returns a UClassID for this class. | | * ICU "poor man's RTTI", returns a UClassID for this class. | |
| * | | * | |
| | | | |
| skipping to change at line 3598 | | skipping to change at line 3600 | |
| | | | |
| inline UChar* | | inline UChar* | |
| UnicodeString::getArrayStart() | | UnicodeString::getArrayStart() | |
| { return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.
fArray; } | | { return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.
fArray; } | |
| | | | |
| inline const UChar* | | inline const UChar* | |
| UnicodeString::getArrayStart() const | | UnicodeString::getArrayStart() const | |
| { return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.
fArray; } | | { return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.
fArray; } | |
| | | | |
| //======================================== | | //======================================== | |
|
| | | // Default constructor | |
| | | //======================================== | |
| | | | |
| | | inline | |
| | | UnicodeString::UnicodeString() | |
| | | : fShortLength(0), | |
| | | fFlags(kShortString) | |
| | | {} | |
| | | | |
| | | //======================================== | |
| // Read-only implementation methods | | // Read-only implementation methods | |
| //======================================== | | //======================================== | |
| inline int32_t | | inline int32_t | |
| UnicodeString::length() const | | UnicodeString::length() const | |
| { return fShortLength>=0 ? fShortLength : fUnion.fFields.fLength; } | | { return fShortLength>=0 ? fShortLength : fUnion.fFields.fLength; } | |
| | | | |
| inline int32_t | | inline int32_t | |
| UnicodeString::getCapacity() const | | UnicodeString::getCapacity() const | |
| { return (fFlags&kUsingStackBuffer) ? US_STACKBUF_SIZE : fUnion.fFields.fCa
pacity; } | | { return (fFlags&kUsingStackBuffer) ? US_STACKBUF_SIZE : fUnion.fFields.fCa
pacity; } | |
| | | | |
| | | | |
End of changes. 9 change blocks. |
| 6 lines changed or deleted | | 18 lines changed or added | |
|
| unorm2.h | | unorm2.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
|
| * Copyright (C) 2009-2012, International Business Machines | | * Copyright (C) 2009-2013, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| * | | * | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * file name: unorm2.h | | * file name: unorm2.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * tab size: 8 (not used) | | * tab size: 8 (not used) | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 2009dec15 | | * created on: 2009dec15 | |
| * created by: Markus W. Scherer | | * created by: Markus W. Scherer | |
| | | | |
| skipping to change at line 121 | | skipping to change at line 121 | |
| | | | |
| /** | | /** | |
| * Opaque C service object type for the new normalization API. | | * Opaque C service object type for the new normalization API. | |
| * @stable ICU 4.4 | | * @stable ICU 4.4 | |
| */ | | */ | |
| struct UNormalizer2; | | struct UNormalizer2; | |
| typedef struct UNormalizer2 UNormalizer2; /**< C typedef for struct UNorma
lizer2. @stable ICU 4.4 */ | | typedef struct UNormalizer2 UNormalizer2; /**< C typedef for struct UNorma
lizer2. @stable ICU 4.4 */ | |
| | | | |
| #if !UCONFIG_NO_NORMALIZATION | | #if !UCONFIG_NO_NORMALIZATION | |
| | | | |
|
| #ifndef U_HIDE_DRAFT_API | | | |
| /** | | /** | |
| * Returns a UNormalizer2 instance for Unicode NFC normalization. | | * Returns a UNormalizer2 instance for Unicode NFC normalization. | |
| * Same as unorm2_getInstance(NULL, "nfc", UNORM2_COMPOSE, pErrorCode). | | * Same as unorm2_getInstance(NULL, "nfc", UNORM2_COMPOSE, pErrorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param pErrorCode Standard ICU error code. Its input value must | | * @param pErrorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function returns | | * pass the U_SUCCESS() test, or else the function returns | |
| * immediately. Check for U_FAILURE() on output or use wit
h | | * immediately. Check for U_FAILURE() on output or use wit
h | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
|
| U_DRAFT const UNormalizer2 * U_EXPORT2 | | U_STABLE const UNormalizer2 * U_EXPORT2 | |
| unorm2_getNFCInstance(UErrorCode *pErrorCode); | | unorm2_getNFCInstance(UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
| * Returns a UNormalizer2 instance for Unicode NFD normalization. | | * Returns a UNormalizer2 instance for Unicode NFD normalization. | |
| * Same as unorm2_getInstance(NULL, "nfc", UNORM2_DECOMPOSE, pErrorCode). | | * Same as unorm2_getInstance(NULL, "nfc", UNORM2_DECOMPOSE, pErrorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param pErrorCode Standard ICU error code. Its input value must | | * @param pErrorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function returns | | * pass the U_SUCCESS() test, or else the function returns | |
| * immediately. Check for U_FAILURE() on output or use wit
h | | * immediately. Check for U_FAILURE() on output or use wit
h | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
|
| U_DRAFT const UNormalizer2 * U_EXPORT2 | | U_STABLE const UNormalizer2 * U_EXPORT2 | |
| unorm2_getNFDInstance(UErrorCode *pErrorCode); | | unorm2_getNFDInstance(UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
| * Returns a UNormalizer2 instance for Unicode NFKC normalization. | | * Returns a UNormalizer2 instance for Unicode NFKC normalization. | |
| * Same as unorm2_getInstance(NULL, "nfkc", UNORM2_COMPOSE, pErrorCode). | | * Same as unorm2_getInstance(NULL, "nfkc", UNORM2_COMPOSE, pErrorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param pErrorCode Standard ICU error code. Its input value must | | * @param pErrorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function returns | | * pass the U_SUCCESS() test, or else the function returns | |
| * immediately. Check for U_FAILURE() on output or use wit
h | | * immediately. Check for U_FAILURE() on output or use wit
h | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
|
| U_DRAFT const UNormalizer2 * U_EXPORT2 | | U_STABLE const UNormalizer2 * U_EXPORT2 | |
| unorm2_getNFKCInstance(UErrorCode *pErrorCode); | | unorm2_getNFKCInstance(UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
| * Returns a UNormalizer2 instance for Unicode NFKD normalization. | | * Returns a UNormalizer2 instance for Unicode NFKD normalization. | |
| * Same as unorm2_getInstance(NULL, "nfkc", UNORM2_DECOMPOSE, pErrorCode). | | * Same as unorm2_getInstance(NULL, "nfkc", UNORM2_DECOMPOSE, pErrorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param pErrorCode Standard ICU error code. Its input value must | | * @param pErrorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function returns | | * pass the U_SUCCESS() test, or else the function returns | |
| * immediately. Check for U_FAILURE() on output or use wit
h | | * immediately. Check for U_FAILURE() on output or use wit
h | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
|
| U_DRAFT const UNormalizer2 * U_EXPORT2 | | U_STABLE const UNormalizer2 * U_EXPORT2 | |
| unorm2_getNFKDInstance(UErrorCode *pErrorCode); | | unorm2_getNFKDInstance(UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
| * Returns a UNormalizer2 instance for Unicode NFKC_Casefold normalization. | | * Returns a UNormalizer2 instance for Unicode NFKC_Casefold normalization. | |
| * Same as unorm2_getInstance(NULL, "nfkc_cf", UNORM2_COMPOSE, pErrorCode). | | * Same as unorm2_getInstance(NULL, "nfkc_cf", UNORM2_COMPOSE, pErrorCode). | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * @param pErrorCode Standard ICU error code. Its input value must | | * @param pErrorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function returns | | * pass the U_SUCCESS() test, or else the function returns | |
| * immediately. Check for U_FAILURE() on output or use wit
h | | * immediately. Check for U_FAILURE() on output or use wit
h | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the requested Normalizer2, if successful | | * @return the requested Normalizer2, if successful | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
|
| U_DRAFT const UNormalizer2 * U_EXPORT2 | | U_STABLE const UNormalizer2 * U_EXPORT2 | |
| unorm2_getNFKCCasefoldInstance(UErrorCode *pErrorCode); | | unorm2_getNFKCCasefoldInstance(UErrorCode *pErrorCode); | |
|
| #endif /* U_HIDE_DRAFT_API */ | | | |
| | | | |
| /** | | /** | |
| * Returns a UNormalizer2 instance which uses the specified data file | | * Returns a UNormalizer2 instance which uses the specified data file | |
| * (packageName/name similar to ucnv_openPackage() and ures_open()/Resource
Bundle) | | * (packageName/name similar to ucnv_openPackage() and ures_open()/Resource
Bundle) | |
| * and which composes or decomposes text according to the specified mode. | | * and which composes or decomposes text according to the specified mode. | |
| * Returns an unmodifiable singleton instance. Do not delete it. | | * Returns an unmodifiable singleton instance. Do not delete it. | |
| * | | * | |
| * Use packageName=NULL for data files that are part of ICU's own data. | | * Use packageName=NULL for data files that are part of ICU's own data. | |
| * Use name="nfc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode standard
NFC/NFD. | | * Use name="nfc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode standard
NFC/NFD. | |
| * Use name="nfkc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode standard
NFKC/NFKD. | | * Use name="nfkc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode standard
NFKC/NFKD. | |
| | | | |
| skipping to change at line 358 | | skipping to change at line 356 | |
| * immediately. Check for U_FAILURE() on output or use wi
th | | * immediately. Check for U_FAILURE() on output or use wi
th | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the non-negative length of c's decomposition, if there is one; o
therwise a negative value | | * @return the non-negative length of c's decomposition, if there is one; o
therwise a negative value | |
| * @stable ICU 4.6 | | * @stable ICU 4.6 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| unorm2_getDecomposition(const UNormalizer2 *norm2, | | unorm2_getDecomposition(const UNormalizer2 *norm2, | |
| UChar32 c, UChar *decomposition, int32_t capacity, | | UChar32 c, UChar *decomposition, int32_t capacity, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
|
| #ifndef U_HIDE_DRAFT_API | | | |
| /** | | /** | |
| * Gets the raw decomposition mapping of c. | | * Gets the raw decomposition mapping of c. | |
| * | | * | |
| * This is similar to the unorm2_getDecomposition() function but returns th
e | | * This is similar to the unorm2_getDecomposition() function but returns th
e | |
| * raw decomposition mapping as specified in UnicodeData.txt or | | * raw decomposition mapping as specified in UnicodeData.txt or | |
| * (for custom data) in the mapping files processed by the gennorm2 tool. | | * (for custom data) in the mapping files processed by the gennorm2 tool. | |
| * By contrast, unorm2_getDecomposition() returns the processed, | | * By contrast, unorm2_getDecomposition() returns the processed, | |
| * recursively-decomposed version of this mapping. | | * recursively-decomposed version of this mapping. | |
| * | | * | |
| * When used on a standard NFKC Normalizer2 instance, | | * When used on a standard NFKC Normalizer2 instance, | |
| | | | |
| skipping to change at line 386 | | skipping to change at line 383 | |
| * @param norm2 UNormalizer2 instance | | * @param norm2 UNormalizer2 instance | |
| * @param c code point | | * @param c code point | |
| * @param decomposition String buffer which will be set to c's | | * @param decomposition String buffer which will be set to c's | |
| * raw decomposition mapping, if there is one. | | * raw decomposition mapping, if there is one. | |
| * @param capacity number of UChars that can be written to decomposition | | * @param capacity number of UChars that can be written to decomposition | |
| * @param pErrorCode Standard ICU error code. Its input value must | | * @param pErrorCode Standard ICU error code. Its input value must | |
| * pass the U_SUCCESS() test, or else the function return
s | | * pass the U_SUCCESS() test, or else the function return
s | |
| * immediately. Check for U_FAILURE() on output or use wi
th | | * immediately. Check for U_FAILURE() on output or use wi
th | |
| * function chaining. (See User Guide for details.) | | * function chaining. (See User Guide for details.) | |
| * @return the non-negative length of c's raw decomposition, if there is on
e; otherwise a negative value | | * @return the non-negative length of c's raw decomposition, if there is on
e; otherwise a negative value | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
|
| U_DRAFT int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| unorm2_getRawDecomposition(const UNormalizer2 *norm2, | | unorm2_getRawDecomposition(const UNormalizer2 *norm2, | |
| UChar32 c, UChar *decomposition, int32_t capacit
y, | | UChar32 c, UChar *decomposition, int32_t capacit
y, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
| * Performs pairwise composition of a & b and returns the composite if ther
e is one. | | * Performs pairwise composition of a & b and returns the composite if ther
e is one. | |
| * | | * | |
| * Returns a composite code point c only if c has a two-way mapping to a+b. | | * Returns a composite code point c only if c has a two-way mapping to a+b. | |
| * In standard Unicode normalization, this means that | | * In standard Unicode normalization, this means that | |
| * c has a canonical decomposition to a+b | | * c has a canonical decomposition to a+b | |
| * and c does not have the Full_Composition_Exclusion property. | | * and c does not have the Full_Composition_Exclusion property. | |
| * | | * | |
| * This function is independent of the mode of the UNormalizer2. | | * This function is independent of the mode of the UNormalizer2. | |
| * @param norm2 UNormalizer2 instance | | * @param norm2 UNormalizer2 instance | |
| * @param a A (normalization starter) code point. | | * @param a A (normalization starter) code point. | |
| * @param b Another code point. | | * @param b Another code point. | |
| * @return The non-negative composite code point if there is one; otherwise
a negative value. | | * @return The non-negative composite code point if there is one; otherwise
a negative value. | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
|
| U_DRAFT UChar32 U_EXPORT2 | | U_STABLE UChar32 U_EXPORT2 | |
| unorm2_composePair(const UNormalizer2 *norm2, UChar32 a, UChar32 b); | | unorm2_composePair(const UNormalizer2 *norm2, UChar32 a, UChar32 b); | |
| | | | |
| /** | | /** | |
| * Gets the combining class of c. | | * Gets the combining class of c. | |
| * The default implementation returns 0 | | * The default implementation returns 0 | |
| * but all standard implementations return the Unicode Canonical_Combining_
Class value. | | * but all standard implementations return the Unicode Canonical_Combining_
Class value. | |
| * @param norm2 UNormalizer2 instance | | * @param norm2 UNormalizer2 instance | |
| * @param c code point | | * @param c code point | |
| * @return c's combining class | | * @return c's combining class | |
|
| * @draft ICU 49 | | * @stable ICU 49 | |
| */ | | */ | |
|
| U_DRAFT uint8_t U_EXPORT2 | | U_STABLE uint8_t U_EXPORT2 | |
| unorm2_getCombiningClass(const UNormalizer2 *norm2, UChar32 c); | | unorm2_getCombiningClass(const UNormalizer2 *norm2, UChar32 c); | |
|
| #endif /* U_HIDE_DRAFT_API */ | | | |
| | | | |
| /** | | /** | |
| * Tests if the string is normalized. | | * Tests if the string is normalized. | |
| * Internally, in cases where the quickCheck() method would return "maybe" | | * Internally, in cases where the quickCheck() method would return "maybe" | |
| * (which is only possible for the two COMPOSE modes) this method | | * (which is only possible for the two COMPOSE modes) this method | |
| * resolves to "yes" or "no" to provide a definitive result, | | * resolves to "yes" or "no" to provide a definitive result, | |
| * at the cost of doing more work in those cases. | | * at the cost of doing more work in those cases. | |
| * @param norm2 UNormalizer2 instance | | * @param norm2 UNormalizer2 instance | |
| * @param s input string | | * @param s input string | |
| * @param length length of the string, or -1 if NUL-terminated | | * @param length length of the string, or -1 if NUL-terminated | |
| | | | |
End of changes. 21 change blocks. |
| 21 lines changed or deleted | | 17 lines changed or added | |
|
| unum.h | | unum.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 1997-2012, International Business Machines Corporation and
others. | | * Copyright (C) 1997-2013, International Business Machines Corporation and
others. | |
| * All Rights Reserved. | | * All Rights Reserved. | |
| * Modification History: | | * Modification History: | |
| * | | * | |
| * Date Name Description | | * Date Name Description | |
| * 06/24/99 helena Integrated Alan's NF enhancements and Java2 bug
fixes | | * 06/24/99 helena Integrated Alan's NF enhancements and Java2 bug
fixes | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| */ | | */ | |
| | | | |
| #ifndef _UNUM | | #ifndef _UNUM | |
| #define _UNUM | | #define _UNUM | |
| | | | |
| skipping to change at line 253 | | skipping to change at line 253 | |
| /** The possible number format pad positions. | | /** The possible number format pad positions. | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| typedef enum UNumberFormatPadPosition { | | typedef enum UNumberFormatPadPosition { | |
| UNUM_PAD_BEFORE_PREFIX, | | UNUM_PAD_BEFORE_PREFIX, | |
| UNUM_PAD_AFTER_PREFIX, | | UNUM_PAD_AFTER_PREFIX, | |
| UNUM_PAD_BEFORE_SUFFIX, | | UNUM_PAD_BEFORE_SUFFIX, | |
| UNUM_PAD_AFTER_SUFFIX | | UNUM_PAD_AFTER_SUFFIX | |
| } UNumberFormatPadPosition; | | } UNumberFormatPadPosition; | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Constants for specifying short or long format. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | typedef enum UNumberCompactStyle { | |
| | | /** @draft ICU 51 */ | |
| | | UNUM_SHORT, | |
| | | /** @draft ICU 51 */ | |
| | | UNUM_LONG | |
| | | /** @draft ICU 51 */ | |
| | | } UNumberCompactStyle; | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Constants for specifying currency spacing | | * Constants for specifying currency spacing | |
| * @stable ICU 4.8 | | * @stable ICU 4.8 | |
| */ | | */ | |
| enum UCurrencySpacing { | | enum UCurrencySpacing { | |
| /** @stable ICU 4.8 */ | | /** @stable ICU 4.8 */ | |
| UNUM_CURRENCY_MATCH, | | UNUM_CURRENCY_MATCH, | |
| /** @stable ICU 4.8 */ | | /** @stable ICU 4.8 */ | |
| UNUM_CURRENCY_SURROUNDING_MATCH, | | UNUM_CURRENCY_SURROUNDING_MATCH, | |
| /** @stable ICU 4.8 */ | | /** @stable ICU 4.8 */ | |
| | | | |
| skipping to change at line 782 | | skipping to change at line 796 | |
| * @stable ICU 3.0 | | * @stable ICU 3.0 | |
| */ | | */ | |
| UNUM_LENIENT_PARSE, | | UNUM_LENIENT_PARSE, | |
| #if UCONFIG_HAVE_PARSEALLINPUT | | #if UCONFIG_HAVE_PARSEALLINPUT | |
| /** Consume all input. (may use fastpath). Set to UNUM_YES (require fastp
ath), UNUM_NO (skip fastpath), or UNUM_MAYBE (heuristic). | | /** Consume all input. (may use fastpath). Set to UNUM_YES (require fastp
ath), UNUM_NO (skip fastpath), or UNUM_MAYBE (heuristic). | |
| * This is an internal ICU API. Do not use. | | * This is an internal ICU API. Do not use. | |
| * @internal | | * @internal | |
| */ | | */ | |
| UNUM_PARSE_ALL_INPUT, | | UNUM_PARSE_ALL_INPUT, | |
| #endif | | #endif | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Scale, which adjusts the position of the | |
| | | * decimal point when formatting. Amounts will be multiplied by 10 ^ (s | |
| | | cale) | |
| | | * before they are formatted. The default value for the scale is 0 ( no | |
| | | adjustment ). | |
| | | * | |
| | | * <p>Example: setting the scale to 3, 123 formats as "123,000" | |
| | | * <p>Example: setting the scale to -4, 123 formats as "0.0123" | |
| | | * | |
| | | * @draft ICU 51 */ | |
| | | UNUM_SCALE = UNUM_LENIENT_PARSE + 2, | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | #ifndef U_HIDE_INTERNAL_API | |
| /** Count of "regular" numeric attributes. | | /** Count of "regular" numeric attributes. | |
| * @internal */ | | * @internal */ | |
| UNUM_NUMERIC_ATTRIBUTE_COUNT, | | UNUM_NUMERIC_ATTRIBUTE_COUNT, | |
| | | | |
| /** One below the first bitfield-boolean item. | | /** One below the first bitfield-boolean item. | |
| * All items after this one are stored in boolean form. | | * All items after this one are stored in boolean form. | |
| * @internal */ | | * @internal */ | |
| UNUM_MAX_NONBOOLEAN_ATTRIBUTE = 0x0FFF, | | UNUM_MAX_NONBOOLEAN_ATTRIBUTE = 0x0FFF, | |
|
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| /** If 1, specifies that if setting the "max integer digits" attribute wo
uld truncate a value, set an error status rather than silently truncating. | | /** If 1, specifies that if setting the "max integer digits" attribute wo
uld truncate a value, set an error status rather than silently truncating. | |
| * For example, formatting the value 1234 with 4 max int digits would su
cceed, but formatting 12345 would fail. There is no effect on parsing. | | * For example, formatting the value 1234 with 4 max int digits would su
cceed, but formatting 12345 would fail. There is no effect on parsing. | |
| * Default: 0 (not set) | | * Default: 0 (not set) | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
|
| UNUM_FORMAT_FAIL_IF_MORE_THAN_MAX_DIGITS, | | UNUM_FORMAT_FAIL_IF_MORE_THAN_MAX_DIGITS = 0x1000, | |
| /** | | /** | |
| * if this attribute is set to 1, specifies that, if the pattern doesn't
contain an exponent, the exponent will not be parsed. If the pattern does c
ontain an exponent, this attribute has no effect. | | * if this attribute is set to 1, specifies that, if the pattern doesn't
contain an exponent, the exponent will not be parsed. If the pattern does c
ontain an exponent, this attribute has no effect. | |
| * Has no effect on formatting. | | * Has no effect on formatting. | |
| * Default: 0 (unset) | | * Default: 0 (unset) | |
| * @draft ICU 50 | | * @draft ICU 50 | |
| */ | | */ | |
| UNUM_PARSE_NO_EXPONENT, | | UNUM_PARSE_NO_EXPONENT, | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
|
| | | #ifndef U_HIDE_INTERNAL_API | |
| /** Limit of boolean attributes. | | /** Limit of boolean attributes. | |
| * @internal */ | | * @internal */ | |
| UNUM_LIMIT_BOOLEAN_ATTRIBUTE | | UNUM_LIMIT_BOOLEAN_ATTRIBUTE | |
|
| | | #endif /* U_HIDE_INTERNAL_API */ | |
| } UNumberFormatAttribute; | | } UNumberFormatAttribute; | |
| | | | |
| /** | | /** | |
| * Get a numeric attribute associated with a UNumberFormat. | | * Get a numeric attribute associated with a UNumberFormat. | |
| * An example of a numeric attribute is the number of integer digits a forma
tter will produce. | | * An example of a numeric attribute is the number of integer digits a forma
tter will produce. | |
| * @param fmt The formatter to query. | | * @param fmt The formatter to query. | |
| * @param attr The attribute to query; one of UNUM_PARSE_INT_ONLY, UNUM_GROU
PING_USED, | | * @param attr The attribute to query; one of UNUM_PARSE_INT_ONLY, UNUM_GROU
PING_USED, | |
| * UNUM_DECIMAL_ALWAYS_SHOWN, UNUM_MAX_INTEGER_DIGITS, UNUM_MIN_INTEGER_DIGI
TS, UNUM_INTEGER_DIGITS, | | * UNUM_DECIMAL_ALWAYS_SHOWN, UNUM_MAX_INTEGER_DIGITS, UNUM_MIN_INTEGER_DIGI
TS, UNUM_INTEGER_DIGITS, | |
| * UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS,
UNUM_MULTIPLIER, | | * UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS,
UNUM_MULTIPLIER, | |
|
| * UNUM_GROUPING_SIZE, UNUM_ROUNDING_MODE, UNUM_FORMAT_WIDTH, UNUM_PADDING_P | | * UNUM_GROUPING_SIZE, UNUM_ROUNDING_MODE, UNUM_FORMAT_WIDTH, UNUM_PADDING_P | |
| OSITION, UNUM_SECONDARY_GROUPING_SIZE. | | OSITION, UNUM_SECONDARY_GROUPING_SIZE, | |
| | | * UNUM_SCALE. | |
| * @return The value of attr. | | * @return The value of attr. | |
| * @see unum_setAttribute | | * @see unum_setAttribute | |
| * @see unum_getDoubleAttribute | | * @see unum_getDoubleAttribute | |
| * @see unum_setDoubleAttribute | | * @see unum_setDoubleAttribute | |
| * @see unum_getTextAttribute | | * @see unum_getTextAttribute | |
| * @see unum_setTextAttribute | | * @see unum_setTextAttribute | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| unum_getAttribute(const UNumberFormat* fmt, | | unum_getAttribute(const UNumberFormat* fmt, | |
| | | | |
| skipping to change at line 841 | | skipping to change at line 873 | |
| /** | | /** | |
| * Set a numeric attribute associated with a UNumberFormat. | | * Set a numeric attribute associated with a UNumberFormat. | |
| * An example of a numeric attribute is the number of integer digits a forma
tter will produce. If the | | * An example of a numeric attribute is the number of integer digits a forma
tter will produce. If the | |
| * formatter does not understand the attribute, the call is ignored. Rule-b
ased formatters only understand | | * formatter does not understand the attribute, the call is ignored. Rule-b
ased formatters only understand | |
| * the lenient-parse attribute. | | * the lenient-parse attribute. | |
| * @param fmt The formatter to set. | | * @param fmt The formatter to set. | |
| * @param attr The attribute to set; one of UNUM_PARSE_INT_ONLY, UNUM_GROUPI
NG_USED, | | * @param attr The attribute to set; one of UNUM_PARSE_INT_ONLY, UNUM_GROUPI
NG_USED, | |
| * UNUM_DECIMAL_ALWAYS_SHOWN, UNUM_MAX_INTEGER_DIGITS, UNUM_MIN_INTEGER_DIGI
TS, UNUM_INTEGER_DIGITS, | | * UNUM_DECIMAL_ALWAYS_SHOWN, UNUM_MAX_INTEGER_DIGITS, UNUM_MIN_INTEGER_DIGI
TS, UNUM_INTEGER_DIGITS, | |
| * UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS,
UNUM_MULTIPLIER, | | * UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS,
UNUM_MULTIPLIER, | |
| * UNUM_GROUPING_SIZE, UNUM_ROUNDING_MODE, UNUM_FORMAT_WIDTH, UNUM_PADDING_P
OSITION, UNUM_SECONDARY_GROUPING_SIZE, | | * UNUM_GROUPING_SIZE, UNUM_ROUNDING_MODE, UNUM_FORMAT_WIDTH, UNUM_PADDING_P
OSITION, UNUM_SECONDARY_GROUPING_SIZE, | |
|
| * or UNUM_LENIENT_PARSE. | | * UNUM_LENIENT_PARSE, or UNUM_SCALE. | |
| * @param newValue The new value of attr. | | * @param newValue The new value of attr. | |
| * @see unum_getAttribute | | * @see unum_getAttribute | |
| * @see unum_getDoubleAttribute | | * @see unum_getDoubleAttribute | |
| * @see unum_setDoubleAttribute | | * @see unum_setDoubleAttribute | |
| * @see unum_getTextAttribute | | * @see unum_getTextAttribute | |
| * @see unum_setTextAttribute | | * @see unum_setTextAttribute | |
| * @stable ICU 2.0 | | * @stable ICU 2.0 | |
| */ | | */ | |
| U_STABLE void U_EXPORT2 | | U_STABLE void U_EXPORT2 | |
| unum_setAttribute( UNumberFormat* fmt, | | unum_setAttribute( UNumberFormat* fmt, | |
| | | | |
End of changes. 11 change blocks. |
| 6 lines changed or deleted | | 40 lines changed or added | |
|
| urename.h | | urename.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 2002-2012, International Business Machines | | * Copyright (C) 2002-2013, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
| * file name: urename.h | | * file name: urename.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * tab size: 8 (not used) | | * tab size: 8 (not used) | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * Created by: Perl script tools/genren.pl written by Vladimir Weinstein | | * Created by: Perl script tools/genren.pl written by Vladimir Weinstein | |
| * | | * | |
| | | | |
| skipping to change at line 105 | | skipping to change at line 105 | |
| #define _MBCSData U_ICU_ENTRY_POINT_RENAME(_MBCSData) | | #define _MBCSData U_ICU_ENTRY_POINT_RENAME(_MBCSData) | |
| #define _SCSUData U_ICU_ENTRY_POINT_RENAME(_SCSUData) | | #define _SCSUData U_ICU_ENTRY_POINT_RENAME(_SCSUData) | |
| #define _UTF16BEData U_ICU_ENTRY_POINT_RENAME(_UTF16BEData) | | #define _UTF16BEData U_ICU_ENTRY_POINT_RENAME(_UTF16BEData) | |
| #define _UTF16Data U_ICU_ENTRY_POINT_RENAME(_UTF16Data) | | #define _UTF16Data U_ICU_ENTRY_POINT_RENAME(_UTF16Data) | |
| #define _UTF16LEData U_ICU_ENTRY_POINT_RENAME(_UTF16LEData) | | #define _UTF16LEData U_ICU_ENTRY_POINT_RENAME(_UTF16LEData) | |
| #define _UTF32BEData U_ICU_ENTRY_POINT_RENAME(_UTF32BEData) | | #define _UTF32BEData U_ICU_ENTRY_POINT_RENAME(_UTF32BEData) | |
| #define _UTF32Data U_ICU_ENTRY_POINT_RENAME(_UTF32Data) | | #define _UTF32Data U_ICU_ENTRY_POINT_RENAME(_UTF32Data) | |
| #define _UTF32LEData U_ICU_ENTRY_POINT_RENAME(_UTF32LEData) | | #define _UTF32LEData U_ICU_ENTRY_POINT_RENAME(_UTF32LEData) | |
| #define _UTF7Data U_ICU_ENTRY_POINT_RENAME(_UTF7Data) | | #define _UTF7Data U_ICU_ENTRY_POINT_RENAME(_UTF7Data) | |
| #define _UTF8Data U_ICU_ENTRY_POINT_RENAME(_UTF8Data) | | #define _UTF8Data U_ICU_ENTRY_POINT_RENAME(_UTF8Data) | |
|
| #define bms_close U_ICU_ENTRY_POINT_RENAME(bms_close) | | | |
| #define bms_empty U_ICU_ENTRY_POINT_RENAME(bms_empty) | | | |
| #define bms_getData U_ICU_ENTRY_POINT_RENAME(bms_getData) | | | |
| #define bms_open U_ICU_ENTRY_POINT_RENAME(bms_open) | | | |
| #define bms_search U_ICU_ENTRY_POINT_RENAME(bms_search) | | | |
| #define bms_setTargetString U_ICU_ENTRY_POINT_RENAME(bms_setTargetString) | | | |
| #define cmemory_cleanup U_ICU_ENTRY_POINT_RENAME(cmemory_cleanup) | | #define cmemory_cleanup U_ICU_ENTRY_POINT_RENAME(cmemory_cleanup) | |
| #define cmemory_inUse U_ICU_ENTRY_POINT_RENAME(cmemory_inUse) | | #define cmemory_inUse U_ICU_ENTRY_POINT_RENAME(cmemory_inUse) | |
| #define izrule_clone U_ICU_ENTRY_POINT_RENAME(izrule_clone) | | #define izrule_clone U_ICU_ENTRY_POINT_RENAME(izrule_clone) | |
| #define izrule_close U_ICU_ENTRY_POINT_RENAME(izrule_close) | | #define izrule_close U_ICU_ENTRY_POINT_RENAME(izrule_close) | |
| #define izrule_equals U_ICU_ENTRY_POINT_RENAME(izrule_equals) | | #define izrule_equals U_ICU_ENTRY_POINT_RENAME(izrule_equals) | |
| #define izrule_getDSTSavings U_ICU_ENTRY_POINT_RENAME(izrule_getDSTSavings) | | #define izrule_getDSTSavings U_ICU_ENTRY_POINT_RENAME(izrule_getDSTSavings) | |
| #define izrule_getDynamicClassID U_ICU_ENTRY_POINT_RENAME(izrule_getDynamic
ClassID) | | #define izrule_getDynamicClassID U_ICU_ENTRY_POINT_RENAME(izrule_getDynamic
ClassID) | |
| #define izrule_getFinalStart U_ICU_ENTRY_POINT_RENAME(izrule_getFinalStart) | | #define izrule_getFinalStart U_ICU_ENTRY_POINT_RENAME(izrule_getFinalStart) | |
| #define izrule_getFirstStart U_ICU_ENTRY_POINT_RENAME(izrule_getFirstStart) | | #define izrule_getFirstStart U_ICU_ENTRY_POINT_RENAME(izrule_getFirstStart) | |
| #define izrule_getName U_ICU_ENTRY_POINT_RENAME(izrule_getName) | | #define izrule_getName U_ICU_ENTRY_POINT_RENAME(izrule_getName) | |
| | | | |
| skipping to change at line 233 | | skipping to change at line 227 | |
| #define u_countChar32 U_ICU_ENTRY_POINT_RENAME(u_countChar32) | | #define u_countChar32 U_ICU_ENTRY_POINT_RENAME(u_countChar32) | |
| #define u_digit U_ICU_ENTRY_POINT_RENAME(u_digit) | | #define u_digit U_ICU_ENTRY_POINT_RENAME(u_digit) | |
| #define u_enumCharNames U_ICU_ENTRY_POINT_RENAME(u_enumCharNames) | | #define u_enumCharNames U_ICU_ENTRY_POINT_RENAME(u_enumCharNames) | |
| #define u_enumCharTypes U_ICU_ENTRY_POINT_RENAME(u_enumCharTypes) | | #define u_enumCharTypes U_ICU_ENTRY_POINT_RENAME(u_enumCharTypes) | |
| #define u_errorName U_ICU_ENTRY_POINT_RENAME(u_errorName) | | #define u_errorName U_ICU_ENTRY_POINT_RENAME(u_errorName) | |
| #define u_fadopt U_ICU_ENTRY_POINT_RENAME(u_fadopt) | | #define u_fadopt U_ICU_ENTRY_POINT_RENAME(u_fadopt) | |
| #define u_fclose U_ICU_ENTRY_POINT_RENAME(u_fclose) | | #define u_fclose U_ICU_ENTRY_POINT_RENAME(u_fclose) | |
| #define u_feof U_ICU_ENTRY_POINT_RENAME(u_feof) | | #define u_feof U_ICU_ENTRY_POINT_RENAME(u_feof) | |
| #define u_fflush U_ICU_ENTRY_POINT_RENAME(u_fflush) | | #define u_fflush U_ICU_ENTRY_POINT_RENAME(u_fflush) | |
| #define u_fgetConverter U_ICU_ENTRY_POINT_RENAME(u_fgetConverter) | | #define u_fgetConverter U_ICU_ENTRY_POINT_RENAME(u_fgetConverter) | |
|
| | | #define u_fgetNumberFormat U_ICU_ENTRY_POINT_RENAME(u_fgetNumberFormat) | |
| #define u_fgetc U_ICU_ENTRY_POINT_RENAME(u_fgetc) | | #define u_fgetc U_ICU_ENTRY_POINT_RENAME(u_fgetc) | |
| #define u_fgetcodepage U_ICU_ENTRY_POINT_RENAME(u_fgetcodepage) | | #define u_fgetcodepage U_ICU_ENTRY_POINT_RENAME(u_fgetcodepage) | |
| #define u_fgetcx U_ICU_ENTRY_POINT_RENAME(u_fgetcx) | | #define u_fgetcx U_ICU_ENTRY_POINT_RENAME(u_fgetcx) | |
| #define u_fgetfile U_ICU_ENTRY_POINT_RENAME(u_fgetfile) | | #define u_fgetfile U_ICU_ENTRY_POINT_RENAME(u_fgetfile) | |
| #define u_fgetlocale U_ICU_ENTRY_POINT_RENAME(u_fgetlocale) | | #define u_fgetlocale U_ICU_ENTRY_POINT_RENAME(u_fgetlocale) | |
| #define u_fgets U_ICU_ENTRY_POINT_RENAME(u_fgets) | | #define u_fgets U_ICU_ENTRY_POINT_RENAME(u_fgets) | |
| #define u_file_read U_ICU_ENTRY_POINT_RENAME(u_file_read) | | #define u_file_read U_ICU_ENTRY_POINT_RENAME(u_file_read) | |
| #define u_file_write U_ICU_ENTRY_POINT_RENAME(u_file_write) | | #define u_file_write U_ICU_ENTRY_POINT_RENAME(u_file_write) | |
| #define u_file_write_flush U_ICU_ENTRY_POINT_RENAME(u_file_write_flush) | | #define u_file_write_flush U_ICU_ENTRY_POINT_RENAME(u_file_write_flush) | |
| #define u_finit U_ICU_ENTRY_POINT_RENAME(u_finit) | | #define u_finit U_ICU_ENTRY_POINT_RENAME(u_finit) | |
| | | | |
| skipping to change at line 520 | | skipping to change at line 515 | |
| #define ucal_getDefaultTimeZone U_ICU_ENTRY_POINT_RENAME(ucal_getDefaultTim
eZone) | | #define ucal_getDefaultTimeZone U_ICU_ENTRY_POINT_RENAME(ucal_getDefaultTim
eZone) | |
| #define ucal_getFieldDifference U_ICU_ENTRY_POINT_RENAME(ucal_getFieldDiffe
rence) | | #define ucal_getFieldDifference U_ICU_ENTRY_POINT_RENAME(ucal_getFieldDiffe
rence) | |
| #define ucal_getGregorianChange U_ICU_ENTRY_POINT_RENAME(ucal_getGregorianC
hange) | | #define ucal_getGregorianChange U_ICU_ENTRY_POINT_RENAME(ucal_getGregorianC
hange) | |
| #define ucal_getKeywordValuesForLocale U_ICU_ENTRY_POINT_RENAME(ucal_getKey
wordValuesForLocale) | | #define ucal_getKeywordValuesForLocale U_ICU_ENTRY_POINT_RENAME(ucal_getKey
wordValuesForLocale) | |
| #define ucal_getLimit U_ICU_ENTRY_POINT_RENAME(ucal_getLimit) | | #define ucal_getLimit U_ICU_ENTRY_POINT_RENAME(ucal_getLimit) | |
| #define ucal_getLocaleByType U_ICU_ENTRY_POINT_RENAME(ucal_getLocaleByType) | | #define ucal_getLocaleByType U_ICU_ENTRY_POINT_RENAME(ucal_getLocaleByType) | |
| #define ucal_getMillis U_ICU_ENTRY_POINT_RENAME(ucal_getMillis) | | #define ucal_getMillis U_ICU_ENTRY_POINT_RENAME(ucal_getMillis) | |
| #define ucal_getNow U_ICU_ENTRY_POINT_RENAME(ucal_getNow) | | #define ucal_getNow U_ICU_ENTRY_POINT_RENAME(ucal_getNow) | |
| #define ucal_getTZDataVersion U_ICU_ENTRY_POINT_RENAME(ucal_getTZDataVersio
n) | | #define ucal_getTZDataVersion U_ICU_ENTRY_POINT_RENAME(ucal_getTZDataVersio
n) | |
| #define ucal_getTimeZoneDisplayName U_ICU_ENTRY_POINT_RENAME(ucal_getTimeZo
neDisplayName) | | #define ucal_getTimeZoneDisplayName U_ICU_ENTRY_POINT_RENAME(ucal_getTimeZo
neDisplayName) | |
|
| | | #define ucal_getTimeZoneID U_ICU_ENTRY_POINT_RENAME(ucal_getTimeZoneID) | |
| #define ucal_getTimeZoneTransitionDate U_ICU_ENTRY_POINT_RENAME(ucal_getTim
eZoneTransitionDate) | | #define ucal_getTimeZoneTransitionDate U_ICU_ENTRY_POINT_RENAME(ucal_getTim
eZoneTransitionDate) | |
| #define ucal_getType U_ICU_ENTRY_POINT_RENAME(ucal_getType) | | #define ucal_getType U_ICU_ENTRY_POINT_RENAME(ucal_getType) | |
| #define ucal_getWeekendTransition U_ICU_ENTRY_POINT_RENAME(ucal_getWeekendT
ransition) | | #define ucal_getWeekendTransition U_ICU_ENTRY_POINT_RENAME(ucal_getWeekendT
ransition) | |
| #define ucal_inDaylightTime U_ICU_ENTRY_POINT_RENAME(ucal_inDaylightTime) | | #define ucal_inDaylightTime U_ICU_ENTRY_POINT_RENAME(ucal_inDaylightTime) | |
| #define ucal_isSet U_ICU_ENTRY_POINT_RENAME(ucal_isSet) | | #define ucal_isSet U_ICU_ENTRY_POINT_RENAME(ucal_isSet) | |
| #define ucal_isWeekend U_ICU_ENTRY_POINT_RENAME(ucal_isWeekend) | | #define ucal_isWeekend U_ICU_ENTRY_POINT_RENAME(ucal_isWeekend) | |
| #define ucal_open U_ICU_ENTRY_POINT_RENAME(ucal_open) | | #define ucal_open U_ICU_ENTRY_POINT_RENAME(ucal_open) | |
| #define ucal_openCountryTimeZones U_ICU_ENTRY_POINT_RENAME(ucal_openCountry
TimeZones) | | #define ucal_openCountryTimeZones U_ICU_ENTRY_POINT_RENAME(ucal_openCountry
TimeZones) | |
| #define ucal_openTimeZoneIDEnumeration U_ICU_ENTRY_POINT_RENAME(ucal_openTi
meZoneIDEnumeration) | | #define ucal_openTimeZoneIDEnumeration U_ICU_ENTRY_POINT_RENAME(ucal_openTi
meZoneIDEnumeration) | |
| #define ucal_openTimeZones U_ICU_ENTRY_POINT_RENAME(ucal_openTimeZones) | | #define ucal_openTimeZones U_ICU_ENTRY_POINT_RENAME(ucal_openTimeZones) | |
| | | | |
| skipping to change at line 572 | | skipping to change at line 568 | |
| #define ucasemap_mapUTF8 U_ICU_ENTRY_POINT_RENAME(ucasemap_mapUTF8) | | #define ucasemap_mapUTF8 U_ICU_ENTRY_POINT_RENAME(ucasemap_mapUTF8) | |
| #define ucasemap_open U_ICU_ENTRY_POINT_RENAME(ucasemap_open) | | #define ucasemap_open U_ICU_ENTRY_POINT_RENAME(ucasemap_open) | |
| #define ucasemap_setBreakIterator U_ICU_ENTRY_POINT_RENAME(ucasemap_setBrea
kIterator) | | #define ucasemap_setBreakIterator U_ICU_ENTRY_POINT_RENAME(ucasemap_setBrea
kIterator) | |
| #define ucasemap_setLocale U_ICU_ENTRY_POINT_RENAME(ucasemap_setLocale) | | #define ucasemap_setLocale U_ICU_ENTRY_POINT_RENAME(ucasemap_setLocale) | |
| #define ucasemap_setOptions U_ICU_ENTRY_POINT_RENAME(ucasemap_setOptions) | | #define ucasemap_setOptions U_ICU_ENTRY_POINT_RENAME(ucasemap_setOptions) | |
| #define ucasemap_toTitle U_ICU_ENTRY_POINT_RENAME(ucasemap_toTitle) | | #define ucasemap_toTitle U_ICU_ENTRY_POINT_RENAME(ucasemap_toTitle) | |
| #define ucasemap_utf8FoldCase U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8FoldCas
e) | | #define ucasemap_utf8FoldCase U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8FoldCas
e) | |
| #define ucasemap_utf8ToLower U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8ToLower) | | #define ucasemap_utf8ToLower U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8ToLower) | |
| #define ucasemap_utf8ToTitle U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8ToTitle) | | #define ucasemap_utf8ToTitle U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8ToTitle) | |
| #define ucasemap_utf8ToUpper U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8ToUpper) | | #define ucasemap_utf8ToUpper U_ICU_ENTRY_POINT_RENAME(ucasemap_utf8ToUpper) | |
|
| #define ucd_close U_ICU_ENTRY_POINT_RENAME(ucd_close) | | | |
| #define ucd_flushCache U_ICU_ENTRY_POINT_RENAME(ucd_flushCache) | | | |
| #define ucd_freeCache U_ICU_ENTRY_POINT_RENAME(ucd_freeCache) | | | |
| #define ucd_getCollator U_ICU_ENTRY_POINT_RENAME(ucd_getCollator) | | | |
| #define ucd_open U_ICU_ENTRY_POINT_RENAME(ucd_open) | | | |
| #define uchar_addPropertyStarts U_ICU_ENTRY_POINT_RENAME(uchar_addPropertyS
tarts) | | #define uchar_addPropertyStarts U_ICU_ENTRY_POINT_RENAME(uchar_addPropertyS
tarts) | |
| #define uchar_swapNames U_ICU_ENTRY_POINT_RENAME(uchar_swapNames) | | #define uchar_swapNames U_ICU_ENTRY_POINT_RENAME(uchar_swapNames) | |
| #define ucln_cleanupOne U_ICU_ENTRY_POINT_RENAME(ucln_cleanupOne) | | #define ucln_cleanupOne U_ICU_ENTRY_POINT_RENAME(ucln_cleanupOne) | |
| #define ucln_common_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_common_re
gisterCleanup) | | #define ucln_common_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_common_re
gisterCleanup) | |
| #define ucln_i18n_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_i18n_regist
erCleanup) | | #define ucln_i18n_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_i18n_regist
erCleanup) | |
| #define ucln_io_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_io_registerCl
eanup) | | #define ucln_io_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_io_registerCl
eanup) | |
| #define ucln_lib_cleanup U_ICU_ENTRY_POINT_RENAME(ucln_lib_cleanup) | | #define ucln_lib_cleanup U_ICU_ENTRY_POINT_RENAME(ucln_lib_cleanup) | |
| #define ucln_mutexedInit U_ICU_ENTRY_POINT_RENAME(ucln_mutexedInit) | | #define ucln_mutexedInit U_ICU_ENTRY_POINT_RENAME(ucln_mutexedInit) | |
| #define ucln_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_registerCleanup) | | #define ucln_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_registerCleanup) | |
| #define ucnv_MBCSFromUChar32 U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSFromUChar32) | | #define ucnv_MBCSFromUChar32 U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSFromUChar32) | |
| | | | |
| skipping to change at line 938 | | skipping to change at line 929 | |
| #define ufmt_ptou U_ICU_ENTRY_POINT_RENAME(ufmt_ptou) | | #define ufmt_ptou U_ICU_ENTRY_POINT_RENAME(ufmt_ptou) | |
| #define ufmt_uto64 U_ICU_ENTRY_POINT_RENAME(ufmt_uto64) | | #define ufmt_uto64 U_ICU_ENTRY_POINT_RENAME(ufmt_uto64) | |
| #define ufmt_utop U_ICU_ENTRY_POINT_RENAME(ufmt_utop) | | #define ufmt_utop U_ICU_ENTRY_POINT_RENAME(ufmt_utop) | |
| #define ugender_getInstance U_ICU_ENTRY_POINT_RENAME(ugender_getInstance) | | #define ugender_getInstance U_ICU_ENTRY_POINT_RENAME(ugender_getInstance) | |
| #define ugender_getListGender U_ICU_ENTRY_POINT_RENAME(ugender_getListGende
r) | | #define ugender_getListGender U_ICU_ENTRY_POINT_RENAME(ugender_getListGende
r) | |
| #define uhash_close U_ICU_ENTRY_POINT_RENAME(uhash_close) | | #define uhash_close U_ICU_ENTRY_POINT_RENAME(uhash_close) | |
| #define uhash_compareCaselessUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_c
ompareCaselessUnicodeString) | | #define uhash_compareCaselessUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_c
ompareCaselessUnicodeString) | |
| #define uhash_compareChars U_ICU_ENTRY_POINT_RENAME(uhash_compareChars) | | #define uhash_compareChars U_ICU_ENTRY_POINT_RENAME(uhash_compareChars) | |
| #define uhash_compareIChars U_ICU_ENTRY_POINT_RENAME(uhash_compareIChars) | | #define uhash_compareIChars U_ICU_ENTRY_POINT_RENAME(uhash_compareIChars) | |
| #define uhash_compareLong U_ICU_ENTRY_POINT_RENAME(uhash_compareLong) | | #define uhash_compareLong U_ICU_ENTRY_POINT_RENAME(uhash_compareLong) | |
|
| | | #define uhash_compareScriptSet U_ICU_ENTRY_POINT_RENAME(uhash_compareScript
Set) | |
| #define uhash_compareUChars U_ICU_ENTRY_POINT_RENAME(uhash_compareUChars) | | #define uhash_compareUChars U_ICU_ENTRY_POINT_RENAME(uhash_compareUChars) | |
| #define uhash_compareUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_compareUn
icodeString) | | #define uhash_compareUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_compareUn
icodeString) | |
| #define uhash_count U_ICU_ENTRY_POINT_RENAME(uhash_count) | | #define uhash_count U_ICU_ENTRY_POINT_RENAME(uhash_count) | |
| #define uhash_deleteHashtable U_ICU_ENTRY_POINT_RENAME(uhash_deleteHashtabl
e) | | #define uhash_deleteHashtable U_ICU_ENTRY_POINT_RENAME(uhash_deleteHashtabl
e) | |
|
| | | #define uhash_deleteScriptSet U_ICU_ENTRY_POINT_RENAME(uhash_deleteScriptSe
t) | |
| #define uhash_equals U_ICU_ENTRY_POINT_RENAME(uhash_equals) | | #define uhash_equals U_ICU_ENTRY_POINT_RENAME(uhash_equals) | |
|
| | | #define uhash_equalsScriptSet U_ICU_ENTRY_POINT_RENAME(uhash_equalsScriptSe
t) | |
| #define uhash_find U_ICU_ENTRY_POINT_RENAME(uhash_find) | | #define uhash_find U_ICU_ENTRY_POINT_RENAME(uhash_find) | |
| #define uhash_get U_ICU_ENTRY_POINT_RENAME(uhash_get) | | #define uhash_get U_ICU_ENTRY_POINT_RENAME(uhash_get) | |
| #define uhash_geti U_ICU_ENTRY_POINT_RENAME(uhash_geti) | | #define uhash_geti U_ICU_ENTRY_POINT_RENAME(uhash_geti) | |
| #define uhash_hashCaselessUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_hash
CaselessUnicodeString) | | #define uhash_hashCaselessUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_hash
CaselessUnicodeString) | |
| #define uhash_hashChars U_ICU_ENTRY_POINT_RENAME(uhash_hashChars) | | #define uhash_hashChars U_ICU_ENTRY_POINT_RENAME(uhash_hashChars) | |
| #define uhash_hashIChars U_ICU_ENTRY_POINT_RENAME(uhash_hashIChars) | | #define uhash_hashIChars U_ICU_ENTRY_POINT_RENAME(uhash_hashIChars) | |
| #define uhash_hashLong U_ICU_ENTRY_POINT_RENAME(uhash_hashLong) | | #define uhash_hashLong U_ICU_ENTRY_POINT_RENAME(uhash_hashLong) | |
|
| | | #define uhash_hashScriptSet U_ICU_ENTRY_POINT_RENAME(uhash_hashScriptSet) | |
| #define uhash_hashUChars U_ICU_ENTRY_POINT_RENAME(uhash_hashUChars) | | #define uhash_hashUChars U_ICU_ENTRY_POINT_RENAME(uhash_hashUChars) | |
| #define uhash_hashUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_hashUnicodeS
tring) | | #define uhash_hashUnicodeString U_ICU_ENTRY_POINT_RENAME(uhash_hashUnicodeS
tring) | |
| #define uhash_iget U_ICU_ENTRY_POINT_RENAME(uhash_iget) | | #define uhash_iget U_ICU_ENTRY_POINT_RENAME(uhash_iget) | |
| #define uhash_igeti U_ICU_ENTRY_POINT_RENAME(uhash_igeti) | | #define uhash_igeti U_ICU_ENTRY_POINT_RENAME(uhash_igeti) | |
| #define uhash_init U_ICU_ENTRY_POINT_RENAME(uhash_init) | | #define uhash_init U_ICU_ENTRY_POINT_RENAME(uhash_init) | |
| #define uhash_iput U_ICU_ENTRY_POINT_RENAME(uhash_iput) | | #define uhash_iput U_ICU_ENTRY_POINT_RENAME(uhash_iput) | |
| #define uhash_iputi U_ICU_ENTRY_POINT_RENAME(uhash_iputi) | | #define uhash_iputi U_ICU_ENTRY_POINT_RENAME(uhash_iputi) | |
| #define uhash_iremove U_ICU_ENTRY_POINT_RENAME(uhash_iremove) | | #define uhash_iremove U_ICU_ENTRY_POINT_RENAME(uhash_iremove) | |
| #define uhash_iremovei U_ICU_ENTRY_POINT_RENAME(uhash_iremovei) | | #define uhash_iremovei U_ICU_ENTRY_POINT_RENAME(uhash_iremovei) | |
| #define uhash_nextElement U_ICU_ENTRY_POINT_RENAME(uhash_nextElement) | | #define uhash_nextElement U_ICU_ENTRY_POINT_RENAME(uhash_nextElement) | |
| | | | |
| skipping to change at line 1488 | | skipping to change at line 1483 | |
| #define ures_getVersionNumberInternal U_ICU_ENTRY_POINT_RENAME(ures_getVers
ionNumberInternal) | | #define ures_getVersionNumberInternal U_ICU_ENTRY_POINT_RENAME(ures_getVers
ionNumberInternal) | |
| #define ures_hasNext U_ICU_ENTRY_POINT_RENAME(ures_hasNext) | | #define ures_hasNext U_ICU_ENTRY_POINT_RENAME(ures_hasNext) | |
| #define ures_initStackObject U_ICU_ENTRY_POINT_RENAME(ures_initStackObject) | | #define ures_initStackObject U_ICU_ENTRY_POINT_RENAME(ures_initStackObject) | |
| #define ures_open U_ICU_ENTRY_POINT_RENAME(ures_open) | | #define ures_open U_ICU_ENTRY_POINT_RENAME(ures_open) | |
| #define ures_openAvailableLocales U_ICU_ENTRY_POINT_RENAME(ures_openAvailab
leLocales) | | #define ures_openAvailableLocales U_ICU_ENTRY_POINT_RENAME(ures_openAvailab
leLocales) | |
| #define ures_openDirect U_ICU_ENTRY_POINT_RENAME(ures_openDirect) | | #define ures_openDirect U_ICU_ENTRY_POINT_RENAME(ures_openDirect) | |
| #define ures_openFillIn U_ICU_ENTRY_POINT_RENAME(ures_openFillIn) | | #define ures_openFillIn U_ICU_ENTRY_POINT_RENAME(ures_openFillIn) | |
| #define ures_openU U_ICU_ENTRY_POINT_RENAME(ures_openU) | | #define ures_openU U_ICU_ENTRY_POINT_RENAME(ures_openU) | |
| #define ures_resetIterator U_ICU_ENTRY_POINT_RENAME(ures_resetIterator) | | #define ures_resetIterator U_ICU_ENTRY_POINT_RENAME(ures_resetIterator) | |
| #define ures_swap U_ICU_ENTRY_POINT_RENAME(ures_swap) | | #define ures_swap U_ICU_ENTRY_POINT_RENAME(ures_swap) | |
|
| | | #define uscript_breaksBetweenLetters U_ICU_ENTRY_POINT_RENAME(uscript_break
sBetweenLetters) | |
| #define uscript_closeRun U_ICU_ENTRY_POINT_RENAME(uscript_closeRun) | | #define uscript_closeRun U_ICU_ENTRY_POINT_RENAME(uscript_closeRun) | |
| #define uscript_getCode U_ICU_ENTRY_POINT_RENAME(uscript_getCode) | | #define uscript_getCode U_ICU_ENTRY_POINT_RENAME(uscript_getCode) | |
| #define uscript_getName U_ICU_ENTRY_POINT_RENAME(uscript_getName) | | #define uscript_getName U_ICU_ENTRY_POINT_RENAME(uscript_getName) | |
|
| | | #define uscript_getSampleString U_ICU_ENTRY_POINT_RENAME(uscript_getSampleS | |
| | | tring) | |
| | | #define uscript_getSampleUnicodeString U_ICU_ENTRY_POINT_RENAME(uscript_get | |
| | | SampleUnicodeString) | |
| #define uscript_getScript U_ICU_ENTRY_POINT_RENAME(uscript_getScript) | | #define uscript_getScript U_ICU_ENTRY_POINT_RENAME(uscript_getScript) | |
| #define uscript_getScriptExtensions U_ICU_ENTRY_POINT_RENAME(uscript_getScr
iptExtensions) | | #define uscript_getScriptExtensions U_ICU_ENTRY_POINT_RENAME(uscript_getScr
iptExtensions) | |
| #define uscript_getShortName U_ICU_ENTRY_POINT_RENAME(uscript_getShortName) | | #define uscript_getShortName U_ICU_ENTRY_POINT_RENAME(uscript_getShortName) | |
|
| | | #define uscript_getUsage U_ICU_ENTRY_POINT_RENAME(uscript_getUsage) | |
| #define uscript_hasScript U_ICU_ENTRY_POINT_RENAME(uscript_hasScript) | | #define uscript_hasScript U_ICU_ENTRY_POINT_RENAME(uscript_hasScript) | |
|
| | | #define uscript_isCased U_ICU_ENTRY_POINT_RENAME(uscript_isCased) | |
| | | #define uscript_isRightToLeft U_ICU_ENTRY_POINT_RENAME(uscript_isRightToLef | |
| | | t) | |
| #define uscript_nextRun U_ICU_ENTRY_POINT_RENAME(uscript_nextRun) | | #define uscript_nextRun U_ICU_ENTRY_POINT_RENAME(uscript_nextRun) | |
| #define uscript_openRun U_ICU_ENTRY_POINT_RENAME(uscript_openRun) | | #define uscript_openRun U_ICU_ENTRY_POINT_RENAME(uscript_openRun) | |
| #define uscript_resetRun U_ICU_ENTRY_POINT_RENAME(uscript_resetRun) | | #define uscript_resetRun U_ICU_ENTRY_POINT_RENAME(uscript_resetRun) | |
| #define uscript_setRunText U_ICU_ENTRY_POINT_RENAME(uscript_setRunText) | | #define uscript_setRunText U_ICU_ENTRY_POINT_RENAME(uscript_setRunText) | |
| #define usearch_close U_ICU_ENTRY_POINT_RENAME(usearch_close) | | #define usearch_close U_ICU_ENTRY_POINT_RENAME(usearch_close) | |
| #define usearch_first U_ICU_ENTRY_POINT_RENAME(usearch_first) | | #define usearch_first U_ICU_ENTRY_POINT_RENAME(usearch_first) | |
| #define usearch_following U_ICU_ENTRY_POINT_RENAME(usearch_following) | | #define usearch_following U_ICU_ENTRY_POINT_RENAME(usearch_following) | |
| #define usearch_getAttribute U_ICU_ENTRY_POINT_RENAME(usearch_getAttribute) | | #define usearch_getAttribute U_ICU_ENTRY_POINT_RENAME(usearch_getAttribute) | |
| #define usearch_getBreakIterator U_ICU_ENTRY_POINT_RENAME(usearch_getBreakI
terator) | | #define usearch_getBreakIterator U_ICU_ENTRY_POINT_RENAME(usearch_getBreakI
terator) | |
| #define usearch_getCollator U_ICU_ENTRY_POINT_RENAME(usearch_getCollator) | | #define usearch_getCollator U_ICU_ENTRY_POINT_RENAME(usearch_getCollator) | |
| | | | |
| skipping to change at line 1598 | | skipping to change at line 1599 | |
| #define uspoof_areConfusableUnicodeString U_ICU_ENTRY_POINT_RENAME(uspoof_a
reConfusableUnicodeString) | | #define uspoof_areConfusableUnicodeString U_ICU_ENTRY_POINT_RENAME(uspoof_a
reConfusableUnicodeString) | |
| #define uspoof_check U_ICU_ENTRY_POINT_RENAME(uspoof_check) | | #define uspoof_check U_ICU_ENTRY_POINT_RENAME(uspoof_check) | |
| #define uspoof_checkUTF8 U_ICU_ENTRY_POINT_RENAME(uspoof_checkUTF8) | | #define uspoof_checkUTF8 U_ICU_ENTRY_POINT_RENAME(uspoof_checkUTF8) | |
| #define uspoof_checkUnicodeString U_ICU_ENTRY_POINT_RENAME(uspoof_checkUnic
odeString) | | #define uspoof_checkUnicodeString U_ICU_ENTRY_POINT_RENAME(uspoof_checkUnic
odeString) | |
| #define uspoof_clone U_ICU_ENTRY_POINT_RENAME(uspoof_clone) | | #define uspoof_clone U_ICU_ENTRY_POINT_RENAME(uspoof_clone) | |
| #define uspoof_close U_ICU_ENTRY_POINT_RENAME(uspoof_close) | | #define uspoof_close U_ICU_ENTRY_POINT_RENAME(uspoof_close) | |
| #define uspoof_getAllowedChars U_ICU_ENTRY_POINT_RENAME(uspoof_getAllowedCh
ars) | | #define uspoof_getAllowedChars U_ICU_ENTRY_POINT_RENAME(uspoof_getAllowedCh
ars) | |
| #define uspoof_getAllowedLocales U_ICU_ENTRY_POINT_RENAME(uspoof_getAllowed
Locales) | | #define uspoof_getAllowedLocales U_ICU_ENTRY_POINT_RENAME(uspoof_getAllowed
Locales) | |
| #define uspoof_getAllowedUnicodeSet U_ICU_ENTRY_POINT_RENAME(uspoof_getAllo
wedUnicodeSet) | | #define uspoof_getAllowedUnicodeSet U_ICU_ENTRY_POINT_RENAME(uspoof_getAllo
wedUnicodeSet) | |
| #define uspoof_getChecks U_ICU_ENTRY_POINT_RENAME(uspoof_getChecks) | | #define uspoof_getChecks U_ICU_ENTRY_POINT_RENAME(uspoof_getChecks) | |
|
| | | #define uspoof_getInclusionSet U_ICU_ENTRY_POINT_RENAME(uspoof_getInclusion | |
| | | Set) | |
| | | #define uspoof_getInclusionUnicodeSet U_ICU_ENTRY_POINT_RENAME(uspoof_getIn | |
| | | clusionUnicodeSet) | |
| | | #define uspoof_getRecommendedSet U_ICU_ENTRY_POINT_RENAME(uspoof_getRecomme | |
| | | ndedSet) | |
| | | #define uspoof_getRecommendedUnicodeSet U_ICU_ENTRY_POINT_RENAME(uspoof_get | |
| | | RecommendedUnicodeSet) | |
| | | #define uspoof_getRestrictionLevel U_ICU_ENTRY_POINT_RENAME(uspoof_getRestr | |
| | | ictionLevel) | |
| #define uspoof_getSkeleton U_ICU_ENTRY_POINT_RENAME(uspoof_getSkeleton) | | #define uspoof_getSkeleton U_ICU_ENTRY_POINT_RENAME(uspoof_getSkeleton) | |
| #define uspoof_getSkeletonUTF8 U_ICU_ENTRY_POINT_RENAME(uspoof_getSkeletonU
TF8) | | #define uspoof_getSkeletonUTF8 U_ICU_ENTRY_POINT_RENAME(uspoof_getSkeletonU
TF8) | |
| #define uspoof_getSkeletonUnicodeString U_ICU_ENTRY_POINT_RENAME(uspoof_get
SkeletonUnicodeString) | | #define uspoof_getSkeletonUnicodeString U_ICU_ENTRY_POINT_RENAME(uspoof_get
SkeletonUnicodeString) | |
| #define uspoof_open U_ICU_ENTRY_POINT_RENAME(uspoof_open) | | #define uspoof_open U_ICU_ENTRY_POINT_RENAME(uspoof_open) | |
| #define uspoof_openFromSerialized U_ICU_ENTRY_POINT_RENAME(uspoof_openFromS
erialized) | | #define uspoof_openFromSerialized U_ICU_ENTRY_POINT_RENAME(uspoof_openFromS
erialized) | |
| #define uspoof_openFromSource U_ICU_ENTRY_POINT_RENAME(uspoof_openFromSourc
e) | | #define uspoof_openFromSource U_ICU_ENTRY_POINT_RENAME(uspoof_openFromSourc
e) | |
| #define uspoof_serialize U_ICU_ENTRY_POINT_RENAME(uspoof_serialize) | | #define uspoof_serialize U_ICU_ENTRY_POINT_RENAME(uspoof_serialize) | |
| #define uspoof_setAllowedChars U_ICU_ENTRY_POINT_RENAME(uspoof_setAllowedCh
ars) | | #define uspoof_setAllowedChars U_ICU_ENTRY_POINT_RENAME(uspoof_setAllowedCh
ars) | |
| #define uspoof_setAllowedLocales U_ICU_ENTRY_POINT_RENAME(uspoof_setAllowed
Locales) | | #define uspoof_setAllowedLocales U_ICU_ENTRY_POINT_RENAME(uspoof_setAllowed
Locales) | |
| #define uspoof_setAllowedUnicodeSet U_ICU_ENTRY_POINT_RENAME(uspoof_setAllo
wedUnicodeSet) | | #define uspoof_setAllowedUnicodeSet U_ICU_ENTRY_POINT_RENAME(uspoof_setAllo
wedUnicodeSet) | |
| #define uspoof_setChecks U_ICU_ENTRY_POINT_RENAME(uspoof_setChecks) | | #define uspoof_setChecks U_ICU_ENTRY_POINT_RENAME(uspoof_setChecks) | |
|
| | | #define uspoof_setRestrictionLevel U_ICU_ENTRY_POINT_RENAME(uspoof_setRestr
ictionLevel) | |
| #define uspoof_swap U_ICU_ENTRY_POINT_RENAME(uspoof_swap) | | #define uspoof_swap U_ICU_ENTRY_POINT_RENAME(uspoof_swap) | |
| #define usprep_close U_ICU_ENTRY_POINT_RENAME(usprep_close) | | #define usprep_close U_ICU_ENTRY_POINT_RENAME(usprep_close) | |
| #define usprep_open U_ICU_ENTRY_POINT_RENAME(usprep_open) | | #define usprep_open U_ICU_ENTRY_POINT_RENAME(usprep_open) | |
| #define usprep_openByType U_ICU_ENTRY_POINT_RENAME(usprep_openByType) | | #define usprep_openByType U_ICU_ENTRY_POINT_RENAME(usprep_openByType) | |
| #define usprep_prepare U_ICU_ENTRY_POINT_RENAME(usprep_prepare) | | #define usprep_prepare U_ICU_ENTRY_POINT_RENAME(usprep_prepare) | |
| #define usprep_swap U_ICU_ENTRY_POINT_RENAME(usprep_swap) | | #define usprep_swap U_ICU_ENTRY_POINT_RENAME(usprep_swap) | |
| #define ustr_hashCharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashCharsN) | | #define ustr_hashCharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashCharsN) | |
| #define ustr_hashICharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashICharsN) | | #define ustr_hashICharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashICharsN) | |
| #define ustr_hashUCharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashUCharsN) | | #define ustr_hashUCharsN U_ICU_ENTRY_POINT_RENAME(ustr_hashUCharsN) | |
| #define ustrcase_internalFold U_ICU_ENTRY_POINT_RENAME(ustrcase_internalFol
d) | | #define ustrcase_internalFold U_ICU_ENTRY_POINT_RENAME(ustrcase_internalFol
d) | |
| | | | |
End of changes. 15 change blocks. |
| 12 lines changed or deleted | | 27 lines changed or added | |
|
| uspoof.h | | uspoof.h | |
| /* | | /* | |
| *************************************************************************** | | *************************************************************************** | |
|
| * Copyright (C) 2008-2012, International Business Machines Corporation | | * Copyright (C) 2008-2013, International Business Machines Corporation | |
| * and others. All Rights Reserved. | | * and others. All Rights Reserved. | |
| *************************************************************************** | | *************************************************************************** | |
| * file name: uspoof.h | | * file name: uspoof.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * tab size: 8 (not used) | | * tab size: 8 (not used) | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 2008Feb13 | | * created on: 2008Feb13 | |
| * created by: Andy Heninger | | * created by: Andy Heninger | |
| * | | * | |
| | | | |
| skipping to change at line 189 | | skipping to change at line 189 | |
| USPOOF_WHOLE_SCRIPT_CONFUSABLE = 4, | | USPOOF_WHOLE_SCRIPT_CONFUSABLE = 4, | |
| | | | |
| /** Any Case Modifier for confusable identifier tests. | | /** Any Case Modifier for confusable identifier tests. | |
| If specified, consider all characters, of any case, when looking fo
r confusables. | | If specified, consider all characters, of any case, when looking fo
r confusables. | |
| If USPOOF_ANY_CASE is not specified, identifiers being checked are
assumed to have been | | If USPOOF_ANY_CASE is not specified, identifiers being checked are
assumed to have been | |
| case folded. Upper case confusable characters will not be checked. | | case folded. Upper case confusable characters will not be checked. | |
| Selects between Lower Case Confusable and | | Selects between Lower Case Confusable and | |
| Any Case Confusable. */ | | Any Case Confusable. */ | |
| USPOOF_ANY_CASE = 8, | | USPOOF_ANY_CASE = 8, | |
| | | | |
|
| | | /** | |
| | | * Check that an identifier is no looser than the specified Restrictio | |
| | | nLevel. | |
| | | * The default if uspoof_setRestrctionLevel() is not called is HIGHLY_ | |
| | | RESTRICTIVE. | |
| | | * | |
| | | * If USPOOF_AUX_INFO is enabled the actual restriction level of the | |
| | | * identifier being tested will also be returned by uspoof_check(). | |
| | | * | |
| | | * @see URestrictionLevel | |
| | | * @see uspoof_setRestrictionLevel | |
| | | * @see USPOOF_AUX_INFO | |
| | | * | |
| | | * @stable ICU 51 | |
| | | */ | |
| | | USPOOF_RESTRICTION_LEVEL = 16, | |
| | | | |
| | | #ifndef U_HIDE_DEPRECATED_API | |
| /** Check that an identifier contains only characters from a | | /** Check that an identifier contains only characters from a | |
| * single script (plus chars from the common and inherited scripts.) | | * single script (plus chars from the common and inherited scripts.) | |
| * Applies to checks of a single identifier check only. | | * Applies to checks of a single identifier check only. | |
|
| | | * @deprecated ICU 51 Use RESTRICTION_LEVEL instead. | |
| */ | | */ | |
|
| USPOOF_SINGLE_SCRIPT = 16, | | USPOOF_SINGLE_SCRIPT = USPOOF_RESTRICTION_LEVEL, | |
| | | #endif /* U_HIDE_DEPRECATED_API */ | |
| | | | |
| /** Check an identifier for the presence of invisible characters, | | /** Check an identifier for the presence of invisible characters, | |
| * such as zero-width spaces, or character sequences that are | | * such as zero-width spaces, or character sequences that are | |
| * likely not to display, such as multiple occurrences of the same | | * likely not to display, such as multiple occurrences of the same | |
| * non-spacing mark. This check does not test the input string as a w
hole | | * non-spacing mark. This check does not test the input string as a w
hole | |
| * for conformance to any particular syntax for identifiers. | | * for conformance to any particular syntax for identifiers. | |
| */ | | */ | |
| USPOOF_INVISIBLE = 32, | | USPOOF_INVISIBLE = 32, | |
| | | | |
| /** Check that an identifier contains only characters from a specified
set | | /** Check that an identifier contains only characters from a specified
set | |
| * of acceptable characters. See uspoof_setAllowedChars() and | | * of acceptable characters. See uspoof_setAllowedChars() and | |
| * uspoof_setAllowedLocales(). | | * uspoof_setAllowedLocales(). | |
| */ | | */ | |
| USPOOF_CHAR_LIMIT = 64, | | USPOOF_CHAR_LIMIT = 64, | |
| | | | |
|
| USPOOF_ALL_CHECKS = 0x7f | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Check that an identifier does not include decimal digits from | |
| | | * more than one numbering system. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | USPOOF_MIXED_NUMBERS = 128, | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| | | /** | |
| | | * Enable all spoof checks. | |
| | | * | |
| | | * @stable ICU 4.6 | |
| | | */ | |
| | | USPOOF_ALL_CHECKS = 0xFFFF, | |
| | | | |
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Enable the return of auxillary (non-error) information in the | |
| | | * upper bits of the check results value. | |
| | | * | |
| | | * If this "check" is not enabled, the results of uspoof_check() will | |
| | | be zero when an | |
| | | * identifier passes all of the enabled checks. | |
| | | * | |
| | | * If this "check" is enabled, (uspoof_check() & USPOOF_ALL_CHECKS) wi | |
| | | ll be zero | |
| | | * when an identifier passes all checks. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | USPOOF_AUX_INFO = 0x40000000 | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| } USpoofChecks; | | } USpoofChecks; | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Constants from UAX #39 for use in setRestrictionLevel(), and | |
| | | * for returned identifier restriction levels in check results. | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | typedef enum URestrictionLevel { | |
| | | /** | |
| | | * Only ASCII characters: U+0000..U+007F | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | USPOOF_ASCII = 0x10000000, | |
| | | /** | |
| | | * All characters in each identifier must be from a single script, | |
| | | or from the combinations: Latin + Han + | |
| | | * Hiragana + Katakana; Latin + Han + Bopomofo; or Latin + Han + Ha | |
| | | ngul. Note that this level will satisfy the | |
| | | * vast majority of Latin-script users; also that TR36 has ASCII in | |
| | | stead of Latin. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | USPOOF_HIGHLY_RESTRICTIVE = 0x20000000, | |
| | | /** | |
| | | * Allow Latin with other scripts except Cyrillic, Greek, Cherokee | |
| | | Otherwise, the same as Highly Restrictive | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | USPOOF_MODERATELY_RESTRICTIVE = 0x30000000, | |
| | | /** | |
| | | * Allow arbitrary mixtures of scripts. Otherwise, the same as Mode | |
| | | rately Restrictive. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | USPOOF_MINIMALLY_RESTRICTIVE = 0x40000000, | |
| | | /** | |
| | | * Any valid identifiers, including characters outside of the Ident | |
| | | ifier Profile. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | USPOOF_UNRESTRICTIVE = 0x50000000 | |
| | | } URestrictionLevel; | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Create a Unicode Spoof Checker, configured to perform all | | * Create a Unicode Spoof Checker, configured to perform all | |
| * checks except for USPOOF_LOCALE_LIMIT and USPOOF_CHAR_LIMIT. | | * checks except for USPOOF_LOCALE_LIMIT and USPOOF_CHAR_LIMIT. | |
| * Note that additional checks may be added in the future, | | * Note that additional checks may be added in the future, | |
| * resulting in the changes to the default checking behavior. | | * resulting in the changes to the default checking behavior. | |
| * | | * | |
| * @param status The error code, set if this function encounters a proble
m. | | * @param status The error code, set if this function encounters a proble
m. | |
| * @return the newly created Spoof Checker | | * @return the newly created Spoof Checker | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| | | | |
| skipping to change at line 254 | | skipping to change at line 346 | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE USpoofChecker * U_EXPORT2 | | U_STABLE USpoofChecker * U_EXPORT2 | |
| uspoof_openFromSerialized(const void *data, int32_t length, int32_t *pActua
lLength, | | uspoof_openFromSerialized(const void *data, int32_t length, int32_t *pActua
lLength, | |
| UErrorCode *pErrorCode); | | UErrorCode *pErrorCode); | |
| | | | |
| /** | | /** | |
| * Open a Spoof Checker from the source form of the spoof data. | | * Open a Spoof Checker from the source form of the spoof data. | |
| * The Three inputs correspond to the Unicode data files confusables.txt | | * The Three inputs correspond to the Unicode data files confusables.txt | |
| * confusablesWholeScript.txt and xidmdifications.txt as described in | | * confusablesWholeScript.txt and xidmdifications.txt as described in | |
|
| * Unicode UAX 39. The syntax of the source data is as described in UAX 3
9 for | | * Unicode UAX #39. The syntax of the source data is as described in UAX
#39 for | |
| * these files, and the content of these files is acceptable input. | | * these files, and the content of these files is acceptable input. | |
| * | | * | |
| * The character encoding of the (char *) input text is UTF-8. | | * The character encoding of the (char *) input text is UTF-8. | |
| * | | * | |
| * @param confusables a pointer to the confusable characters definitions, | | * @param confusables a pointer to the confusable characters definitions, | |
| * as found in file confusables.txt from unicode.org. | | * as found in file confusables.txt from unicode.org. | |
| * @param confusablesLen The length of the confusables text, or -1 if the | | * @param confusablesLen The length of the confusables text, or -1 if the | |
| * input string is zero terminated. | | * input string is zero terminated. | |
| * @param confusablesWholeScript | | * @param confusablesWholeScript | |
| * a pointer to the whole script confusables definition
s, | | * a pointer to the whole script confusables definition
s, | |
| | | | |
| skipping to change at line 354 | | skipping to change at line 446 | |
| * @param status The error code, set if this function encounters a proble
m. | | * @param status The error code, set if this function encounters a proble
m. | |
| * @return The set of checks that this spoof checker will perform. | | * @return The set of checks that this spoof checker will perform. | |
| * The value is a bit set, obtained by OR-ing together | | * The value is a bit set, obtained by OR-ing together | |
| * values from enum USpoofChecks. | | * values from enum USpoofChecks. | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| * | | * | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uspoof_getChecks(const USpoofChecker *sc, UErrorCode *status); | | uspoof_getChecks(const USpoofChecker *sc, UErrorCode *status); | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Set the loosest restriction level allowed. The default if this function | |
| | | * is not called is HIGHLY_RESTRICTIVE. | |
| | | * Calling this function also enables the RESTRICTION_LEVEL check. | |
| | | * @param restrictionLevel The loosest restriction level allowed. | |
| | | * @see URestrictionLevel | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | U_DRAFT void U_EXPORT2 | |
| | | uspoof_setRestrictionLevel(USpoofChecker *sc, URestrictionLevel restriction | |
| | | Level); | |
| | | | |
| | | /** | |
| | | * Get the Restriction Level that will be tested if the checks include RES | |
| | | TRICTION_LEVEL. | |
| | | * | |
| | | * @return The restriction level | |
| | | * @see URestrictionLevel | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | U_DRAFT URestrictionLevel U_EXPORT2 | |
| | | uspoof_getRestrictionLevel(const USpoofChecker *sc); | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Limit characters that are acceptable in identifiers being checked to tho
se | | * Limit characters that are acceptable in identifiers being checked to tho
se | |
| * normally used with the languages associated with the specified locales. | | * normally used with the languages associated with the specified locales. | |
| * Any previously specified list of locales is replaced by the new settings
. | | * Any previously specified list of locales is replaced by the new settings
. | |
| * | | * | |
| * A set of languages is determined from the locale(s), and | | * A set of languages is determined from the locale(s), and | |
| * from those a set of acceptable Unicode scripts is determined. | | * from those a set of acceptable Unicode scripts is determined. | |
| * Characters from this set of scripts, along with characters from | | * Characters from this set of scripts, along with characters from | |
| * the "common" and "inherited" Unicode Script categories | | * the "common" and "inherited" Unicode Script categories | |
| * will be permitted. | | * will be permitted. | |
| | | | |
| skipping to change at line 482 | | skipping to change at line 597 | |
| * characters that were set with the uspoof_setAllowedLocales() function. | | * characters that were set with the uspoof_setAllowedLocales() function. | |
| * | | * | |
| * The USPOOF_CHAR_LIMIT test is automatically enabled for this | | * The USPOOF_CHAR_LIMIT test is automatically enabled for this | |
| * USoofChecker by this function. | | * USoofChecker by this function. | |
| * | | * | |
| * @param sc The USpoofChecker | | * @param sc The USpoofChecker | |
| * @param chars A Unicode Set containing the list of | | * @param chars A Unicode Set containing the list of | |
| * characters that are permitted. Ownership of the set | | * characters that are permitted. Ownership of the set | |
| * remains with the caller. The incoming set is cloned by | | * remains with the caller. The incoming set is cloned by | |
| * this function, so there are no restrictions on modifying | | * this function, so there are no restrictions on modifying | |
|
| * or deleting the USet after calling this function. | | * or deleting the UnicodeSet after calling this function. | |
| * @param status The error code, set if this function encounters a proble
m. | | * @param status The error code, set if this function encounters a proble
m. | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE void U_EXPORT2 | | U_STABLE void U_EXPORT2 | |
| uspoof_setAllowedUnicodeSet(USpoofChecker *sc, const icu::UnicodeSet *chars
, UErrorCode *status); | | uspoof_setAllowedUnicodeSet(USpoofChecker *sc, const icu::UnicodeSet *chars
, UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Get a UnicodeSet for the characters permitted in an identifier. | | * Get a UnicodeSet for the characters permitted in an identifier. | |
| * This corresponds to the limits imposed by the Set Allowed Characters / | | * This corresponds to the limits imposed by the Set Allowed Characters / | |
| * UnicodeSet functions. Limitations imposed by other checks will not be | | * UnicodeSet functions. Limitations imposed by other checks will not be | |
| | | | |
| skipping to change at line 519 | | skipping to change at line 634 | |
| U_STABLE const icu::UnicodeSet * U_EXPORT2 | | U_STABLE const icu::UnicodeSet * U_EXPORT2 | |
| uspoof_getAllowedUnicodeSet(const USpoofChecker *sc, UErrorCode *status); | | uspoof_getAllowedUnicodeSet(const USpoofChecker *sc, UErrorCode *status); | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Check the specified string for possible security issues. | | * Check the specified string for possible security issues. | |
| * The text to be checked will typically be an identifier of some sort. | | * The text to be checked will typically be an identifier of some sort. | |
| * The set of checks to be performed is specified with uspoof_setChecks(). | | * The set of checks to be performed is specified with uspoof_setChecks(). | |
| * | | * | |
| * @param sc The USpoofChecker | | * @param sc The USpoofChecker | |
|
| * @param text The string to be checked for possible security issues, | | * @param id The identifier to be checked for possible security issues
, | |
| * in UTF-16 format. | | * in UTF-16 format. | |
| * @param length the length of the string to be checked, expressed in | | * @param length the length of the string to be checked, expressed in | |
| * 16 bit UTF-16 code units, or -1 if the string is | | * 16 bit UTF-16 code units, or -1 if the string is | |
| * zero terminated. | | * zero terminated. | |
|
| * @param position An out parameter that receives the index of the | | * @param position An out parameter. | |
| * first string position that fails the allowed character | | * Originally, the index of the first string position that f | |
| * limitation checks. | | ailed a check. | |
| * This parameter may be null if the position information | | * Now, always returns zero. | |
| * is not needed. | | * This parameter may be null. | |
| * If the string passes the requested checks the | | | |
| * parameter value will not be set. | | | |
| * @param status The error code, set if an error occurred while attempting
to | | * @param status The error code, set if an error occurred while attempting
to | |
| * perform the check. | | * perform the check. | |
| * Spoofing or security issues detected with the input strin
g are | | * Spoofing or security issues detected with the input strin
g are | |
| * not reported here, but through the function's return valu
e. | | * not reported here, but through the function's return valu
e. | |
| * @return An integer value with bits set for any potential security | | * @return An integer value with bits set for any potential security | |
| * or spoofing issues detected. The bits are defined by | | * or spoofing issues detected. The bits are defined by | |
|
| * enum USpoofChecks. Zero is returned if no issues | | * enum USpoofChecks. (returned_value & USPOOF_ALL_CHECKS) | |
| * are found with the input string. | | * will be zero if the input string passes all of the | |
| | | * enabled checks. | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uspoof_check(const USpoofChecker *sc, | | uspoof_check(const USpoofChecker *sc, | |
|
| const UChar *text, int32_t length, | | const UChar *id, int32_t length, | |
| int32_t *position, | | int32_t *position, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Check the specified string for possible security issues. | | * Check the specified string for possible security issues. | |
| * The text to be checked will typically be an identifier of some sort. | | * The text to be checked will typically be an identifier of some sort. | |
| * The set of checks to be performed is specified with uspoof_setChecks(). | | * The set of checks to be performed is specified with uspoof_setChecks(). | |
| * | | * | |
| * @param sc The USpoofChecker | | * @param sc The USpoofChecker | |
|
| * @param text A UTF-8 string to be checked for possible security issues
. | | * @param id A identifier to be checked for possible security issues,
in UTF8 format. | |
| * @param length the length of the string to be checked, or -1 if the stri
ng is | | * @param length the length of the string to be checked, or -1 if the stri
ng is | |
| * zero terminated. | | * zero terminated. | |
|
| * @param position An out parameter that receives the index of the | | * @param position An out parameter. | |
| * first string position that fails the allowed character | | * Originally, the index of the first string position that f | |
| * limitation checks. | | ailed a check. | |
| * This parameter may be null if the position information | | * Now, always returns zero. | |
| * is not needed. | | * This parameter may be null. | |
| * If the string passes the requested checks the | | * @deprecated ICU 51 | |
| * parameter value will not be set. | | | |
| * @param status The error code, set if an error occurred while attempting
to | | * @param status The error code, set if an error occurred while attempting
to | |
| * perform the check. | | * perform the check. | |
| * Spoofing or security issues detected with the input strin
g are | | * Spoofing or security issues detected with the input strin
g are | |
| * not reported here, but through the function's return valu
e. | | * not reported here, but through the function's return valu
e. | |
| * If the input contains invalid UTF-8 sequences, | | * If the input contains invalid UTF-8 sequences, | |
| * a status of U_INVALID_CHAR_FOUND will be returned. | | * a status of U_INVALID_CHAR_FOUND will be returned. | |
| * @return An integer value with bits set for any potential security | | * @return An integer value with bits set for any potential security | |
| * or spoofing issues detected. The bits are defined by | | * or spoofing issues detected. The bits are defined by | |
|
| * enum USpoofChecks. Zero is returned if no issues | | * enum USpoofChecks. (returned_value & USPOOF_ALL_CHECKS) | |
| * are found with the input string. | | * will be zero if the input string passes all of the | |
| | | * enabled checks. | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uspoof_checkUTF8(const USpoofChecker *sc, | | uspoof_checkUTF8(const USpoofChecker *sc, | |
|
| const char *text, int32_t length, | | const char *id, int32_t length, | |
| int32_t *position, | | int32_t *position, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| #if U_SHOW_CPLUSPLUS_API | | #if U_SHOW_CPLUSPLUS_API | |
| /** | | /** | |
| * Check the specified string for possible security issues. | | * Check the specified string for possible security issues. | |
| * The text to be checked will typically be an identifier of some sort. | | * The text to be checked will typically be an identifier of some sort. | |
| * The set of checks to be performed is specified with uspoof_setChecks(). | | * The set of checks to be performed is specified with uspoof_setChecks(). | |
| * | | * | |
| * @param sc The USpoofChecker | | * @param sc The USpoofChecker | |
|
| * @param text A UnicodeString to be checked for possible security issue | | * @param id A identifier to be checked for possible security issues. | |
| s. | | * @param position An out parameter. | |
| * @param position An out parameter that receives the index of the | | * Originally, the index of the first string position that f | |
| * first string position that fails the allowed character | | ailed a check. | |
| * limitation checks. | | * Now, always returns zero. | |
| * This parameter may be null if the position information | | * This parameter may be null. | |
| * is not needed. | | * @deprecated ICU 51 | |
| * If the string passes the requested checks the | | | |
| * parameter value will not be set. | | | |
| * @param status The error code, set if an error occurred while attempting
to | | * @param status The error code, set if an error occurred while attempting
to | |
| * perform the check. | | * perform the check. | |
| * Spoofing or security issues detected with the input strin
g are | | * Spoofing or security issues detected with the input strin
g are | |
| * not reported here, but through the function's return valu
e. | | * not reported here, but through the function's return valu
e. | |
|
| | | | |
| * @return An integer value with bits set for any potential security | | * @return An integer value with bits set for any potential security | |
| * or spoofing issues detected. The bits are defined by | | * or spoofing issues detected. The bits are defined by | |
|
| * enum USpoofChecks. Zero is returned if no issues | | * enum USpoofChecks. (returned_value & USPOOF_ALL_CHECKS) | |
| * are found with the input string. | | * will be zero if the input string passes all of the | |
| | | * enabled checks. | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uspoof_checkUnicodeString(const USpoofChecker *sc, | | uspoof_checkUnicodeString(const USpoofChecker *sc, | |
|
| const icu::UnicodeString &text, | | const icu::UnicodeString &id, | |
| int32_t *position, | | int32_t *position, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Check the whether two specified strings are visually confusable. | | * Check the whether two specified strings are visually confusable. | |
| * The types of confusability to be tested - single script, mixed script, | | * The types of confusability to be tested - single script, mixed script, | |
| * or whole script - are determined by the check options set for the | | * or whole script - are determined by the check options set for the | |
| * USpoofChecker. | | * USpoofChecker. | |
| | | | |
| skipping to change at line 634 | | skipping to change at line 744 | |
| * USPOOF_WHOLE_SCRIPT_CONFUSABLE | | * USPOOF_WHOLE_SCRIPT_CONFUSABLE | |
| * At least one of these tests must be selected. | | * At least one of these tests must be selected. | |
| * | | * | |
| * USPOOF_ANY_CASE is a modifier for the tests. Select it if the identifie
rs | | * USPOOF_ANY_CASE is a modifier for the tests. Select it if the identifie
rs | |
| * may be of mixed case. | | * may be of mixed case. | |
| * If identifiers are case folded for comparison and | | * If identifiers are case folded for comparison and | |
| * display to the user, do not select the USPOOF_ANY_CASE option. | | * display to the user, do not select the USPOOF_ANY_CASE option. | |
| * | | * | |
| * | | * | |
| * @param sc The USpoofChecker | | * @param sc The USpoofChecker | |
|
| * @param s1 The first of the two strings to be compared for | | * @param id1 The first of the two identifiers to be compared for | |
| * confusability. The strings are in UTF-16 format. | | * confusability. The strings are in UTF-16 format. | |
|
| * @param length1 the length of the first string, expressed in | | * @param length1 the length of the first identifer, expressed in | |
| * 16 bit UTF-16 code units, or -1 if the string is | | * 16 bit UTF-16 code units, or -1 if the string is | |
|
| * zero terminated. | | * nul terminated. | |
| * @param s2 The second of the two strings to be compared for | | * @param id2 The second of the two identifiers to be compared for | |
| * confusability. The strings are in UTF-16 format. | | * confusability. The identifiers are in UTF-16 format. | |
| * @param length2 The length of the second string, expressed in | | * @param length2 The length of the second identifiers, expressed in | |
| * 16 bit UTF-16 code units, or -1 if the string is | | * 16 bit UTF-16 code units, or -1 if the string is | |
|
| * zero terminated. | | * nul terminated. | |
| * @param status The error code, set if an error occurred while attempting
to | | * @param status The error code, set if an error occurred while attempting
to | |
| * perform the check. | | * perform the check. | |
|
| * Confusability of the strings is not reported here, | | * Confusability of the identifiers is not reported here, | |
| * but through this function's return value. | | * but through this function's return value. | |
| * @return An integer value with bit(s) set corresponding to | | * @return An integer value with bit(s) set corresponding to | |
| * the type of confusability found, as defined by | | * the type of confusability found, as defined by | |
|
| * enum USpoofChecks. Zero is returned if the strings | | * enum USpoofChecks. Zero is returned if the identifiers | |
| * are not confusable. | | * are not confusable. | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uspoof_areConfusable(const USpoofChecker *sc, | | uspoof_areConfusable(const USpoofChecker *sc, | |
|
| const UChar *s1, int32_t length1, | | const UChar *id1, int32_t length1, | |
| const UChar *s2, int32_t length2, | | const UChar *id2, int32_t length2, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
| * Check the whether two specified strings are visually confusable. | | * Check the whether two specified strings are visually confusable. | |
| * The types of confusability to be tested - single script, mixed script, | | * The types of confusability to be tested - single script, mixed script, | |
| * or whole script - are determined by the check options set for the | | * or whole script - are determined by the check options set for the | |
| * USpoofChecker. | | * USpoofChecker. | |
| * | | * | |
| * @param sc The USpoofChecker | | * @param sc The USpoofChecker | |
|
| * @param s1 The first of the two strings to be compared for | | * @param id1 The first of the two identifiers to be compared for | |
| | | * confusability. The strings are in UTF-8 format. | |
| | | * @param length1 the length of the first identifiers, in bytes, or -1 | |
| | | * if the string is nul terminated. | |
| | | * @param id2 The second of the two identifiers to be compared for | |
| * confusability. The strings are in UTF-8 format. | | * confusability. The strings are in UTF-8 format. | |
|
| * @param length1 the length of the first string, in bytes, or -1 | | | |
| * if the string is zero terminated. | | | |
| * @param s2 The second of the two strings to be compared for | | | |
| * confusability. The strings are in UTF-18 format. | | | |
| * @param length2 The length of the second string in bytes, or -1 | | * @param length2 The length of the second string in bytes, or -1 | |
|
| * if the string is zero terminated. | | * if the string is nul terminated. | |
| * @param status The error code, set if an error occurred while attempting
to | | * @param status The error code, set if an error occurred while attempting
to | |
| * perform the check. | | * perform the check. | |
| * Confusability of the strings is not reported here, | | * Confusability of the strings is not reported here, | |
| * but through this function's return value. | | * but through this function's return value. | |
| * @return An integer value with bit(s) set corresponding to | | * @return An integer value with bit(s) set corresponding to | |
| * the type of confusability found, as defined by | | * the type of confusability found, as defined by | |
| * enum USpoofChecks. Zero is returned if the strings | | * enum USpoofChecks. Zero is returned if the strings | |
| * are not confusable. | | * are not confusable. | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uspoof_areConfusableUTF8(const USpoofChecker *sc, | | uspoof_areConfusableUTF8(const USpoofChecker *sc, | |
|
| const char *s1, int32_t length1, | | const char *id1, int32_t length1, | |
| const char *s2, int32_t length2, | | const char *id2, int32_t length2, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| #if U_SHOW_CPLUSPLUS_API | | #if U_SHOW_CPLUSPLUS_API | |
| /** | | /** | |
| * Check the whether two specified strings are visually confusable. | | * Check the whether two specified strings are visually confusable. | |
| * The types of confusability to be tested - single script, mixed script, | | * The types of confusability to be tested - single script, mixed script, | |
| * or whole script - are determined by the check options set for the | | * or whole script - are determined by the check options set for the | |
| * USpoofChecker. | | * USpoofChecker. | |
| * | | * | |
| * @param sc The USpoofChecker | | * @param sc The USpoofChecker | |
|
| * @param s1 The first of the two strings to be compared for | | * @param id1 The first of the two identifiers to be compared for | |
| | | * confusability. The strings are in UTF-8 format. | |
| | | * @param id2 The second of the two identifiers to be compared for | |
| * confusability. The strings are in UTF-8 format. | | * confusability. The strings are in UTF-8 format. | |
|
| * @param s2 The second of the two strings to be compared for | | | |
| * confusability. The strings are in UTF-18 format. | | | |
| * @param status The error code, set if an error occurred while attempting
to | | * @param status The error code, set if an error occurred while attempting
to | |
| * perform the check. | | * perform the check. | |
|
| * Confusability of the strings is not reported here, | | * Confusability of the identifiers is not reported here, | |
| * but through this function's return value. | | * but through this function's return value. | |
| * @return An integer value with bit(s) set corresponding to | | * @return An integer value with bit(s) set corresponding to | |
| * the type of confusability found, as defined by | | * the type of confusability found, as defined by | |
|
| * enum USpoofChecks. Zero is returned if the strings | | * enum USpoofChecks. Zero is returned if the identifiers | |
| * are not confusable. | | * are not confusable. | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uspoof_areConfusableUnicodeString(const USpoofChecker *sc, | | uspoof_areConfusableUnicodeString(const USpoofChecker *sc, | |
| const icu::UnicodeString &s1, | | const icu::UnicodeString &s1, | |
| const icu::UnicodeString &s2, | | const icu::UnicodeString &s2, | |
| UErrorCode *status); | | UErrorCode *status); | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| * Get the "skeleton" for an identifier string. | | * Get the "skeleton" for an identifier. | |
| * Skeletons are a transformation of the input string; | | * Skeletons are a transformation of the input identifier; | |
| * Two strings are confusable if their skeletons are identical. | | * Two identifiers are confusable if their skeletons are identical. | |
| * See Unicode UAX 39 for additional information. | | * See Unicode UAX #39 for additional information. | |
| * | | * | |
| * Using skeletons directly makes it possible to quickly check | | * Using skeletons directly makes it possible to quickly check | |
| * whether an identifier is confusable with any of some large | | * whether an identifier is confusable with any of some large | |
| * set of existing identifiers, by creating an efficiently | | * set of existing identifiers, by creating an efficiently | |
| * searchable collection of the skeletons. | | * searchable collection of the skeletons. | |
| * | | * | |
| * @param sc The USpoofChecker | | * @param sc The USpoofChecker | |
| * @param type The type of skeleton, corresponding to which | | * @param type The type of skeleton, corresponding to which | |
| * of the Unicode confusable data tables to use. | | * of the Unicode confusable data tables to use. | |
| * The default is Mixed-Script, Lowercase. | | * The default is Mixed-Script, Lowercase. | |
| * Allowed options are USPOOF_SINGLE_SCRIPT_CONFUSABLE and | | * Allowed options are USPOOF_SINGLE_SCRIPT_CONFUSABLE and | |
| * USPOOF_ANY_CASE_CONFUSABLE. The two flags may be ORed. | | * USPOOF_ANY_CASE_CONFUSABLE. The two flags may be ORed. | |
|
| * @param s The input string whose skeleton will be computed. | | * @param id The input identifier whose skeleton will be computed. | |
| * @param length The length of the input string, expressed in 16 bit | | * @param length The length of the input identifier, expressed in 16 bit | |
| * UTF-16 code units, or -1 if the string is zero terminate
d. | | * UTF-16 code units, or -1 if the string is zero terminate
d. | |
| * @param dest The output buffer, to receive the skeleton string. | | * @param dest The output buffer, to receive the skeleton string. | |
| * @param destCapacity The length of the output buffer, in 16 bit units. | | * @param destCapacity The length of the output buffer, in 16 bit units. | |
| * The destCapacity may be zero, in which case the function
will | | * The destCapacity may be zero, in which case the function
will | |
| * return the actual length of the skeleton. | | * return the actual length of the skeleton. | |
| * @param status The error code, set if an error occurred while attemptin
g to | | * @param status The error code, set if an error occurred while attemptin
g to | |
| * perform the check. | | * perform the check. | |
| * @return The length of the skeleton string. The returned length | | * @return The length of the skeleton string. The returned length | |
| * is always that of the complete skeleton, even when the | | * is always that of the complete skeleton, even when the | |
| * supplied buffer is too small (or of zero length) | | * supplied buffer is too small (or of zero length) | |
| * | | * | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uspoof_getSkeleton(const USpoofChecker *sc, | | uspoof_getSkeleton(const USpoofChecker *sc, | |
| uint32_t type, | | uint32_t type, | |
|
| const UChar *s, int32_t length, | | const UChar *id, int32_t length, | |
| UChar *dest, int32_t destCapacity, | | UChar *dest, int32_t destCapacity, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| /** | | /** | |
|
| * Get the "skeleton" for an identifier string. | | * Get the "skeleton" for an identifier. | |
| * Skeletons are a transformation of the input string; | | * Skeletons are a transformation of the input identifier; | |
| * Two strings are confusable if their skeletons are identical. | | * Two identifiers are confusable if their skeletons are identical. | |
| * See Unicode UAX 39 for additional information. | | * See Unicode UAX #39 for additional information. | |
| * | | * | |
| * Using skeletons directly makes it possible to quickly check | | * Using skeletons directly makes it possible to quickly check | |
| * whether an identifier is confusable with any of some large | | * whether an identifier is confusable with any of some large | |
| * set of existing identifiers, by creating an efficiently | | * set of existing identifiers, by creating an efficiently | |
| * searchable collection of the skeletons. | | * searchable collection of the skeletons. | |
| * | | * | |
| * @param sc The USpoofChecker | | * @param sc The USpoofChecker | |
| * @param type The type of skeleton, corresponding to which | | * @param type The type of skeleton, corresponding to which | |
| * of the Unicode confusable data tables to use. | | * of the Unicode confusable data tables to use. | |
| * The default is Mixed-Script, Lowercase. | | * The default is Mixed-Script, Lowercase. | |
| * Allowed options are USPOOF_SINGLE_SCRIPT_CONFUSABLE and | | * Allowed options are USPOOF_SINGLE_SCRIPT_CONFUSABLE and | |
| * USPOOF_ANY_CASE. The two flags may be ORed. | | * USPOOF_ANY_CASE. The two flags may be ORed. | |
|
| * @param s The UTF-8 format input string whose skeleton will be com
puted. | | * @param id The UTF-8 format identifier whose skeleton will be compu
ted. | |
| * @param length The length of the input string, in bytes, | | * @param length The length of the input string, in bytes, | |
| * or -1 if the string is zero terminated. | | * or -1 if the string is zero terminated. | |
| * @param dest The output buffer, to receive the skeleton string. | | * @param dest The output buffer, to receive the skeleton string. | |
| * @param destCapacity The length of the output buffer, in bytes. | | * @param destCapacity The length of the output buffer, in bytes. | |
| * The destCapacity may be zero, in which case the function
will | | * The destCapacity may be zero, in which case the function
will | |
| * return the actual length of the skeleton. | | * return the actual length of the skeleton. | |
| * @param status The error code, set if an error occurred while attemptin
g to | | * @param status The error code, set if an error occurred while attemptin
g to | |
| * perform the check. Possible Errors include U_INVALID_CH
AR_FOUND | | * perform the check. Possible Errors include U_INVALID_CH
AR_FOUND | |
| * for invalid UTF-8 sequences, and | | * for invalid UTF-8 sequences, and | |
| * U_BUFFER_OVERFLOW_ERROR if the destination buffer is
too small | | * U_BUFFER_OVERFLOW_ERROR if the destination buffer is
too small | |
| * to hold the complete skeleton. | | * to hold the complete skeleton. | |
| * @return The length of the skeleton string, in bytes. The return
ed length | | * @return The length of the skeleton string, in bytes. The return
ed length | |
| * is always that of the complete skeleton, even when the | | * is always that of the complete skeleton, even when the | |
| * supplied buffer is too small (or of zero length) | | * supplied buffer is too small (or of zero length) | |
| * | | * | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_STABLE int32_t U_EXPORT2 | | U_STABLE int32_t U_EXPORT2 | |
| uspoof_getSkeletonUTF8(const USpoofChecker *sc, | | uspoof_getSkeletonUTF8(const USpoofChecker *sc, | |
| uint32_t type, | | uint32_t type, | |
|
| const char *s, int32_t length, | | const char *id, int32_t length, | |
| char *dest, int32_t destCapacity, | | char *dest, int32_t destCapacity, | |
| UErrorCode *status); | | UErrorCode *status); | |
| | | | |
| #if U_SHOW_CPLUSPLUS_API | | #if U_SHOW_CPLUSPLUS_API | |
| /** | | /** | |
|
| * Get the "skeleton" for an identifier string. | | * Get the "skeleton" for an identifier. | |
| * Skeletons are a transformation of the input string; | | * Skeletons are a transformation of the input identifier; | |
| * Two strings are confusable if their skeletons are identical. | | * Two identifiers are confusable if their skeletons are identical. | |
| * See Unicode UAX 39 for additional information. | | * See Unicode UAX #39 for additional information. | |
| * | | * | |
| * Using skeletons directly makes it possible to quickly check | | * Using skeletons directly makes it possible to quickly check | |
| * whether an identifier is confusable with any of some large | | * whether an identifier is confusable with any of some large | |
| * set of existing identifiers, by creating an efficiently | | * set of existing identifiers, by creating an efficiently | |
| * searchable collection of the skeletons. | | * searchable collection of the skeletons. | |
| * | | * | |
| * @param sc The USpoofChecker. | | * @param sc The USpoofChecker. | |
| * @param type The type of skeleton, corresponding to which | | * @param type The type of skeleton, corresponding to which | |
| * of the Unicode confusable data tables to use. | | * of the Unicode confusable data tables to use. | |
| * The default is Mixed-Script, Lowercase. | | * The default is Mixed-Script, Lowercase. | |
| * Allowed options are USPOOF_SINGLE_SCRIPT_CONFUSABLE and | | * Allowed options are USPOOF_SINGLE_SCRIPT_CONFUSABLE and | |
| * USPOOF_ANY_CASE_CONFUSABLE. The two flags may be ORed. | | * USPOOF_ANY_CASE_CONFUSABLE. The two flags may be ORed. | |
|
| * @param s The input string whose skeleton will be computed. | | * @param id The input identifier whose skeleton will be computed. | |
| * @param dest The output string, to receive the skeleton string. | | * @param dest The output identifier, to receive the skeleton string. | |
| * @param status The error code, set if an error occurred while attemptin
g to | | * @param status The error code, set if an error occurred while attemptin
g to | |
| * perform the check. | | * perform the check. | |
| * @return A reference to the destination (skeleton) string. | | * @return A reference to the destination (skeleton) string. | |
| * | | * | |
| * @stable ICU 4.2 | | * @stable ICU 4.2 | |
| */ | | */ | |
| U_I18N_API icu::UnicodeString & U_EXPORT2 | | U_I18N_API icu::UnicodeString & U_EXPORT2 | |
| uspoof_getSkeletonUnicodeString(const USpoofChecker *sc, | | uspoof_getSkeletonUnicodeString(const USpoofChecker *sc, | |
| uint32_t type, | | uint32_t type, | |
|
| const icu::UnicodeString &s, | | const icu::UnicodeString &id, | |
| icu::UnicodeString &dest, | | icu::UnicodeString &dest, | |
| UErrorCode *status); | | UErrorCode *status); | |
| #endif /* U_SHOW_CPLUSPLUS_API */ | | #endif /* U_SHOW_CPLUSPLUS_API */ | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Get the set of Candidate Characters for Inclusion in Identifiers, as de | |
| | | fined | |
| | | * in Unicode UAX #31, http://www.unicode.org/reports/tr31/#Table_Candidat | |
| | | e_Characters_for_Inclusion_in_Identifiers | |
| | | * | |
| | | * The returned set is frozen. Ownership of the set remains with the ICU l | |
| | | ibrary; it must not | |
| | | * be deleted by the caller. | |
| | | * | |
| | | * @param status The error code, set if a problem occurs while creating th | |
| | | e set. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | U_DRAFT const USet * U_EXPORT2 | |
| | | uspoof_getInclusionSet(UErrorCode *status); | |
| | | | |
| | | /** | |
| | | * Get the set of characters from Recommended Scripts for Inclusion in Ide | |
| | | ntifiers, as defined | |
| | | * in Unicode UAX #31, http://www.unicode.org/reports/tr31/#Table_Recommen | |
| | | ded_Scripts | |
| | | * | |
| | | * The returned set is frozen. Ownership of the set remains with the ICU l | |
| | | ibrary; it must not | |
| | | * be deleted by the caller. | |
| | | * | |
| | | * @param status The error code, set if a problem occurs while creating th | |
| | | e set. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | U_DRAFT const USet * U_EXPORT2 | |
| | | uspoof_getRecommendedSet(UErrorCode *status); | |
| | | | |
| | | #if U_SHOW_CPLUSPLUS_API | |
| | | | |
| | | /** | |
| | | * Get the set of Candidate Characters for Inclusion in Identifiers, as de | |
| | | fined | |
| | | * in Unicode UAX #31, http://www.unicode.org/reports/tr31/#Table_Candidat | |
| | | e_Characters_for_Inclusion_in_Identifiers | |
| | | * | |
| | | * The returned set is frozen. Ownership of the set remains with the ICU l | |
| | | ibrary; it must not | |
| | | * be deleted by the caller. | |
| | | * | |
| | | * @param status The error code, set if a problem occurs while creating th | |
| | | e set. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | U_DRAFT const icu::UnicodeSet * U_EXPORT2 | |
| | | uspoof_getInclusionUnicodeSet(UErrorCode *status); | |
| | | | |
| | | /** | |
| | | * Get the set of characters from Recommended Scripts for Inclusion in Ide | |
| | | ntifiers, as defined | |
| | | * in Unicode UAX #31, http://www.unicode.org/reports/tr31/#Table_Recommen | |
| | | ded_Scripts | |
| | | * | |
| | | * The returned set is frozen. Ownership of the set remains with the ICU l | |
| | | ibrary; it must not | |
| | | * be deleted by the caller. | |
| | | * | |
| | | * @param status The error code, set if a problem occurs while creating th | |
| | | e set. | |
| | | * | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | U_DRAFT const icu::UnicodeSet * U_EXPORT2 | |
| | | uspoof_getRecommendedUnicodeSet(UErrorCode *status); | |
| | | | |
| | | #endif /* U_SHOW_CPLUSPLUS_API */ | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Serialize the data for a spoof detector into a chunk of memory. | | * Serialize the data for a spoof detector into a chunk of memory. | |
| * The flattened spoof detection tables can later be used to efficiently | | * The flattened spoof detection tables can later be used to efficiently | |
| * instantiate a new Spoof Detector. | | * instantiate a new Spoof Detector. | |
| * | | * | |
|
| | | * The serialized spoof checker includes only the data compiled from the | |
| | | * Unicode data tables by uspoof_openFromSource(); it does not include | |
| | | * include any other state or configuration that may have been set. | |
| | | * | |
| * @param sc the Spoof Detector whose data is to be serialized. | | * @param sc the Spoof Detector whose data is to be serialized. | |
| * @param data a pointer to 32-bit-aligned memory to be filled with the dat
a, | | * @param data a pointer to 32-bit-aligned memory to be filled with the dat
a, | |
| * can be NULL if capacity==0 | | * can be NULL if capacity==0 | |
| * @param capacity the number of bytes available at data, | | * @param capacity the number of bytes available at data, | |
| * or 0 for preflighting | | * or 0 for preflighting | |
| * @param status an in/out ICU UErrorCode; possible errors include: | | * @param status an in/out ICU UErrorCode; possible errors include: | |
| * - U_BUFFER_OVERFLOW_ERROR if the data storage block is too small for ser
ialization | | * - U_BUFFER_OVERFLOW_ERROR if the data storage block is too small for ser
ialization | |
| * - U_ILLEGAL_ARGUMENT_ERROR the data or capacity parameters are bad | | * - U_ILLEGAL_ARGUMENT_ERROR the data or capacity parameters are bad | |
| * @return the number of bytes written or needed for the spoof data | | * @return the number of bytes written or needed for the spoof data | |
| * | | * | |
| | | | |
End of changes. 47 change blocks. |
| 84 lines changed or deleted | | 290 lines changed or added | |
|
| utf16.h | | utf16.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
|
| * Copyright (C) 1999-2011, International Business Machines | | * Copyright (C) 1999-2012, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| * | | * | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * file name: utf16.h | | * file name: utf16.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * tab size: 8 (not used) | | * tab size: 8 (not used) | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 1999sep09 | | * created on: 1999sep09 | |
| * created by: Markus W. Scherer | | * created by: Markus W. Scherer | |
| | | | |
| skipping to change at line 182 | | skipping to change at line 182 | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Get a code point from a string at a random-access offset, | | * Get a code point from a string at a random-access offset, | |
| * without changing the offset. | | * without changing the offset. | |
| * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | | * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | |
| * | | * | |
| * The offset may point to either the lead or trail surrogate unit | | * The offset may point to either the lead or trail surrogate unit | |
| * for a supplementary code point, in which case the macro will read | | * for a supplementary code point, in which case the macro will read | |
| * the adjacent matching surrogate as well. | | * the adjacent matching surrogate as well. | |
|
| | | * | |
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * If the offset points to a single, unpaired surrogate, then that itself | | * If the offset points to a single, unpaired surrogate, then that itself | |
| * will be returned as the code point. | | * will be returned as the code point. | |
| * Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16
_NEXT. | | * Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16
_NEXT. | |
| * | | * | |
| * @param s const UChar * string | | * @param s const UChar * string | |
| * @param start starting string offset (usually 0) | | * @param start starting string offset (usually 0) | |
| * @param i string offset, must be start<=i<length | | * @param i string offset, must be start<=i<length | |
| * @param length string length | | * @param length string length | |
| * @param c output UChar32 variable | | * @param c output UChar32 variable | |
| * @see U16_GET_UNSAFE | | * @see U16_GET_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U16_GET(s, start, i, length, c) { \ | | #define U16_GET(s, start, i, length, c) { \ | |
| (c)=(s)[i]; \ | | (c)=(s)[i]; \ | |
| if(U16_IS_SURROGATE(c)) { \ | | if(U16_IS_SURROGATE(c)) { \ | |
| uint16_t __c2; \ | | uint16_t __c2; \ | |
| if(U16_IS_SURROGATE_LEAD(c)) { \ | | if(U16_IS_SURROGATE_LEAD(c)) { \ | |
|
| if((i)+1<(length) && U16_IS_TRAIL(__c2=(s)[(i)+1])) { \ | | if((i)+1!=(length) && U16_IS_TRAIL(__c2=(s)[(i)+1])) { \ | |
| (c)=U16_GET_SUPPLEMENTARY((c), __c2); \ | | (c)=U16_GET_SUPPLEMENTARY((c), __c2); \ | |
| } \ | | } \ | |
| } else { \ | | } else { \ | |
| if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ | | if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ | |
| (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ | | (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ | |
| } \ | | } \ | |
| } \ | | } \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 244 | | skipping to change at line 247 | |
| (c)=U16_GET_SUPPLEMENTARY((c), (s)[(i)++]); \ | | (c)=U16_GET_SUPPLEMENTARY((c), (s)[(i)++]); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Get a code point from a string at a code point boundary offset, | | * Get a code point from a string at a code point boundary offset, | |
| * and advance the offset to the next code point boundary. | | * and advance the offset to the next code point boundary. | |
| * (Post-incrementing forward iteration.) | | * (Post-incrementing forward iteration.) | |
| * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | | * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | |
| * | | * | |
|
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * The offset may point to the lead surrogate unit | | * The offset may point to the lead surrogate unit | |
| * for a supplementary code point, in which case the macro will read | | * for a supplementary code point, in which case the macro will read | |
| * the following trail surrogate as well. | | * the following trail surrogate as well. | |
| * If the offset points to a trail surrogate or | | * If the offset points to a trail surrogate or | |
| * to a single, unpaired lead surrogate, then that itself | | * to a single, unpaired lead surrogate, then that itself | |
| * will be returned as the code point. | | * will be returned as the code point. | |
| * | | * | |
| * @param s const UChar * string | | * @param s const UChar * string | |
| * @param i string offset, must be i<length | | * @param i string offset, must be i<length | |
| * @param length string length | | * @param length string length | |
| * @param c output UChar32 variable | | * @param c output UChar32 variable | |
| * @see U16_NEXT_UNSAFE | | * @see U16_NEXT_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U16_NEXT(s, i, length, c) { \ | | #define U16_NEXT(s, i, length, c) { \ | |
| (c)=(s)[(i)++]; \ | | (c)=(s)[(i)++]; \ | |
| if(U16_IS_LEAD(c)) { \ | | if(U16_IS_LEAD(c)) { \ | |
| uint16_t __c2; \ | | uint16_t __c2; \ | |
|
| if((i)<(length) && U16_IS_TRAIL(__c2=(s)[(i)])) { \ | | if((i)!=(length) && U16_IS_TRAIL(__c2=(s)[(i)])) { \ | |
| ++(i); \ | | ++(i); \ | |
| (c)=U16_GET_SUPPLEMENTARY((c), __c2); \ | | (c)=U16_GET_SUPPLEMENTARY((c), __c2); \ | |
| } \ | | } \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Append a code point to a string, overwriting 1 or 2 code units. | | * Append a code point to a string, overwriting 1 or 2 code units. | |
| * The offset points to the current end of the string contents | | * The offset points to the current end of the string contents | |
| * and is advanced (post-increment). | | * and is advanced (post-increment). | |
| | | | |
| skipping to change at line 340 | | skipping to change at line 345 | |
| if(U16_IS_LEAD((s)[(i)++])) { \ | | if(U16_IS_LEAD((s)[(i)++])) { \ | |
| ++(i); \ | | ++(i); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Advance the string offset from one code point boundary to the next. | | * Advance the string offset from one code point boundary to the next. | |
| * (Post-incrementing iteration.) | | * (Post-incrementing iteration.) | |
| * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | | * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | |
| * | | * | |
|
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * @param s const UChar * string | | * @param s const UChar * string | |
| * @param i string offset, must be i<length | | * @param i string offset, must be i<length | |
| * @param length string length | | * @param length string length | |
| * @see U16_FWD_1_UNSAFE | | * @see U16_FWD_1_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U16_FWD_1(s, i, length) { \ | | #define U16_FWD_1(s, i, length) { \ | |
|
| if(U16_IS_LEAD((s)[(i)++]) && (i)<(length) && U16_IS_TRAIL((s)[i])) { \ | | if(U16_IS_LEAD((s)[(i)++]) && (i)!=(length) && U16_IS_TRAIL((s)[i])) {
\ | |
| ++(i); \ | | ++(i); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Advance the string offset from one code point boundary to the n-th next
one, | | * Advance the string offset from one code point boundary to the n-th next
one, | |
| * i.e., move forward by n code points. | | * i.e., move forward by n code points. | |
| * (Post-incrementing iteration.) | | * (Post-incrementing iteration.) | |
| * "Unsafe" macro, assumes well-formed UTF-16. | | * "Unsafe" macro, assumes well-formed UTF-16. | |
| * | | * | |
| | | | |
| skipping to change at line 378 | | skipping to change at line 385 | |
| --__N; \ | | --__N; \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Advance the string offset from one code point boundary to the n-th next
one, | | * Advance the string offset from one code point boundary to the n-th next
one, | |
| * i.e., move forward by n code points. | | * i.e., move forward by n code points. | |
| * (Post-incrementing iteration.) | | * (Post-incrementing iteration.) | |
| * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | | * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | |
| * | | * | |
|
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * @param s const UChar * string | | * @param s const UChar * string | |
|
| * @param i string offset, must be i<length | | * @param i int32_t string offset, must be i<length | |
| * @param length string length | | * @param length int32_t string length | |
| * @param n number of code points to skip | | * @param n number of code points to skip | |
| * @see U16_FWD_N_UNSAFE | | * @see U16_FWD_N_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U16_FWD_N(s, i, length, n) { \ | | #define U16_FWD_N(s, i, length, n) { \ | |
| int32_t __N=(n); \ | | int32_t __N=(n); \ | |
|
| while(__N>0 && (i)<(length)) { \ | | while(__N>0 && ((i)<(length) || ((length)<0 && (s)[i]!=0))) { \ | |
| U16_FWD_1(s, i, length); \ | | U16_FWD_1(s, i, length); \ | |
| --__N; \ | | --__N; \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Adjust a random-access offset to a code point boundary | | * Adjust a random-access offset to a code point boundary | |
| * at the start of a code point. | | * at the start of a code point. | |
| * If the offset points to the trail surrogate of a surrogate pair, | | * If the offset points to the trail surrogate of a surrogate pair, | |
| * then the offset is decremented. | | * then the offset is decremented. | |
| | | | |
| skipping to change at line 598 | | skipping to change at line 607 | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Adjust a random-access offset to a code point boundary after a code poin
t. | | * Adjust a random-access offset to a code point boundary after a code poin
t. | |
| * If the offset is behind the lead surrogate of a surrogate pair, | | * If the offset is behind the lead surrogate of a surrogate pair, | |
| * then the offset is incremented. | | * then the offset is incremented. | |
| * Otherwise, it is not modified. | | * Otherwise, it is not modified. | |
| * The input offset may be the same as the string length. | | * The input offset may be the same as the string length. | |
| * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | | * "Safe" macro, handles unpaired surrogates and checks for string boundari
es. | |
| * | | * | |
|
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * @param s const UChar * string | | * @param s const UChar * string | |
|
| * @param start starting string offset (usually 0) | | * @param start int32_t starting string offset (usually 0) | |
| * @param i string offset, start<=i<=length | | * @param i int32_t string offset, start<=i<=length | |
| * @param length string length | | * @param length int32_t string length | |
| * @see U16_SET_CP_LIMIT_UNSAFE | | * @see U16_SET_CP_LIMIT_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U16_SET_CP_LIMIT(s, start, i, length) { \ | | #define U16_SET_CP_LIMIT(s, start, i, length) { \ | |
|
| if((start)<(i) && (i)<(length) && U16_IS_LEAD((s)[(i)-1]) && U16_IS_TRA
IL((s)[i])) { \ | | if((start)<(i) && ((i)<(length) || (length)<0) && U16_IS_LEAD((s)[(i)-1
]) && U16_IS_TRAIL((s)[i])) { \ | |
| ++(i); \ | | ++(i); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 13 change blocks. |
| 11 lines changed or deleted | | 22 lines changed or added | |
|
| utf8.h | | utf8.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * | | * | |
|
| * Copyright (C) 1999-2012, International Business Machines | | * Copyright (C) 1999-2013, International Business Machines | |
| * Corporation and others. All Rights Reserved. | | * Corporation and others. All Rights Reserved. | |
| * | | * | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
| * file name: utf8.h | | * file name: utf8.h | |
| * encoding: US-ASCII | | * encoding: US-ASCII | |
| * tab size: 8 (not used) | | * tab size: 8 (not used) | |
| * indentation:4 | | * indentation:4 | |
| * | | * | |
| * created on: 1999sep13 | | * created on: 1999sep13 | |
| * created by: Markus W. Scherer | | * created by: Markus W. Scherer | |
| | | | |
| skipping to change at line 235 | | skipping to change at line 235 | |
| U8_SET_CP_START_UNSAFE(s, _u8_get_unsafe_index); \ | | U8_SET_CP_START_UNSAFE(s, _u8_get_unsafe_index); \ | |
| U8_NEXT_UNSAFE(s, _u8_get_unsafe_index, c); \ | | U8_NEXT_UNSAFE(s, _u8_get_unsafe_index, c); \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Get a code point from a string at a random-access offset, | | * Get a code point from a string at a random-access offset, | |
| * without changing the offset. | | * without changing the offset. | |
| * The offset may point to either the lead byte or one of the trail bytes | | * The offset may point to either the lead byte or one of the trail bytes | |
| * for a code point, in which case the macro will read all of the bytes | | * for a code point, in which case the macro will read all of the bytes | |
| * for the code point. | | * for the code point. | |
|
| | | * | |
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * If the offset points to an illegal UTF-8 byte sequence, then | | * If the offset points to an illegal UTF-8 byte sequence, then | |
| * c is set to a negative value. | | * c is set to a negative value. | |
| * Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_N
EXT. | | * Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_N
EXT. | |
| * | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
|
| * @param start starting string offset | | * @param start int32_t starting string offset | |
| * @param i string offset, must be start<=i<length | | * @param i int32_t string offset, must be start<=i<length | |
| * @param length string length | | * @param length int32_t string length | |
| * @param c output UChar32 variable, set to <0 in case of an error | | * @param c output UChar32 variable, set to <0 in case of an error | |
| * @see U8_GET_UNSAFE | | * @see U8_GET_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_GET(s, start, i, length, c) { \ | | #define U8_GET(s, start, i, length, c) { \ | |
|
| int32_t _u8_get_index=(int32_t)(i); \ | | int32_t _u8_get_index=(i); \ | |
| U8_SET_CP_START(s, start, _u8_get_index); \ | | U8_SET_CP_START(s, start, _u8_get_index); \ | |
| U8_NEXT(s, _u8_get_index, length, c); \ | | U8_NEXT(s, _u8_get_index, length, c); \ | |
| } | | } | |
| | | | |
|
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Get a code point from a string at a random-access offset, | |
| | | * without changing the offset. | |
| | | * The offset may point to either the lead byte or one of the trail bytes | |
| | | * for a code point, in which case the macro will read all of the bytes | |
| | | * for the code point. | |
| | | * | |
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| | | * If the offset points to an illegal UTF-8 byte sequence, then | |
| | | * c is set to U+FFFD. | |
| | | * Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_N | |
| | | EXT_OR_FFFD. | |
| | | * | |
| | | * This macro does not distinguish between a real U+FFFD in the text | |
| | | * and U+FFFD returned for an ill-formed sequence. | |
| | | * Use U8_GET() if that distinction is important. | |
| | | * | |
| | | * @param s const uint8_t * string | |
| | | * @param start int32_t starting string offset | |
| | | * @param i int32_t string offset, must be start<=i<length | |
| | | * @param length int32_t string length | |
| | | * @param c output UChar32 variable, set to U+FFFD in case of an error | |
| | | * @see U8_GET | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | #define U8_GET_OR_FFFD(s, start, i, length, c) { \ | |
| | | int32_t _u8_get_index=(i); \ | |
| | | U8_SET_CP_START(s, start, _u8_get_index); \ | |
| | | U8_NEXT_OR_FFFD(s, _u8_get_index, length, c); \ | |
| | | } | |
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /* definitions with forward iteration -------------------------------------
-- */ | | /* definitions with forward iteration -------------------------------------
-- */ | |
| | | | |
| /** | | /** | |
| * Get a code point from a string at a code point boundary offset, | | * Get a code point from a string at a code point boundary offset, | |
| * and advance the offset to the next code point boundary. | | * and advance the offset to the next code point boundary. | |
| * (Post-incrementing forward iteration.) | | * (Post-incrementing forward iteration.) | |
| * "Unsafe" macro, assumes well-formed UTF-8. | | * "Unsafe" macro, assumes well-formed UTF-8. | |
| * | | * | |
| * The offset may point to the lead byte of a multi-byte sequence, | | * The offset may point to the lead byte of a multi-byte sequence, | |
| * in which case the macro will read the whole sequence. | | * in which case the macro will read the whole sequence. | |
| | | | |
| skipping to change at line 294 | | skipping to change at line 330 | |
| } \ | | } \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Get a code point from a string at a code point boundary offset, | | * Get a code point from a string at a code point boundary offset, | |
| * and advance the offset to the next code point boundary. | | * and advance the offset to the next code point boundary. | |
| * (Post-incrementing forward iteration.) | | * (Post-incrementing forward iteration.) | |
| * "Safe" macro, checks for illegal sequences and for string boundaries. | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| * | | * | |
|
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * The offset may point to the lead byte of a multi-byte sequence, | | * The offset may point to the lead byte of a multi-byte sequence, | |
| * in which case the macro will read the whole sequence. | | * in which case the macro will read the whole sequence. | |
| * If the offset points to a trail byte or an illegal UTF-8 sequence, then | | * If the offset points to a trail byte or an illegal UTF-8 sequence, then | |
| * c is set to a negative value. | | * c is set to a negative value. | |
| * | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
|
| * @param i string offset, must be i<length | | * @param i int32_t string offset, must be i<length | |
| * @param length string length | | * @param length int32_t string length | |
| * @param c output UChar32 variable, set to <0 in case of an error | | * @param c output UChar32 variable, set to <0 in case of an error | |
| * @see U8_NEXT_UNSAFE | | * @see U8_NEXT_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_NEXT(s, i, length, c) { \ | | #define U8_NEXT(s, i, length, c) { \ | |
| (c)=(uint8_t)(s)[(i)++]; \ | | (c)=(uint8_t)(s)[(i)++]; \ | |
| if((c)>=0x80) { \ | | if((c)>=0x80) { \ | |
| uint8_t __t1, __t2; \ | | uint8_t __t1, __t2; \ | |
| if( /* handle U+1000..U+CFFF inline */ \ | | if( /* handle U+1000..U+CFFF inline */ \ | |
| (0xe0<(c) && (c)<=0xec) && \ | | (0xe0<(c) && (c)<=0xec) && \ | |
|
| (((i)+1)<(length)) && \ | | (((i)+1)<(length) || (length)<0) && \ | |
| (__t1=(uint8_t)((s)[i]-0x80))<=0x3f && \ | | (__t1=(uint8_t)((s)[i]-0x80))<=0x3f && \ | |
| (__t2=(uint8_t)((s)[(i)+1]-0x80))<= 0x3f \ | | (__t2=(uint8_t)((s)[(i)+1]-0x80))<= 0x3f \ | |
| ) { \ | | ) { \ | |
| /* no need for (c&0xf) because the upper bits are truncated aft
er <<12 in the cast to (UChar) */ \ | | /* no need for (c&0xf) because the upper bits are truncated aft
er <<12 in the cast to (UChar) */ \ | |
| (c)=(UChar)(((c)<<12)|(__t1<<6)|__t2); \ | | (c)=(UChar)(((c)<<12)|(__t1<<6)|__t2); \ | |
| (i)+=2; \ | | (i)+=2; \ | |
| } else if( /* handle U+0080..U+07FF inline */ \ | | } else if( /* handle U+0080..U+07FF inline */ \ | |
| ((c)<0xe0 && (c)>=0xc2) && \ | | ((c)<0xe0 && (c)>=0xc2) && \ | |
|
| ((i)<(length)) && \ | | ((i)!=(length)) && \ | |
| (__t1=(uint8_t)((s)[i]-0x80))<=0x3f \ | | (__t1=(uint8_t)((s)[i]-0x80))<=0x3f \ | |
| ) { \ | | ) { \ | |
|
| (c)=(UChar)((((c)&0x1f)<<6)|__t1); \ | | (c)=(((c)&0x1f)<<6)|__t1; \ | |
| ++(i); \ | | ++(i); \ | |
|
| } else if(U8_IS_LEAD(c)) { \ | | } else { \ | |
| /* function call for "complicated" and error cases */ \ | | /* function call for "complicated" and error cases */ \ | |
|
| (c)=utf8_nextCharSafeBody((const uint8_t *)s, &(i), (int32_t)(l | | (c)=utf8_nextCharSafeBody((const uint8_t *)s, &(i), (length), c | |
| ength), c, -1); \ | | , -1); \ | |
| | | } \ | |
| | | } \ | |
| | | } | |
| | | | |
| | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Get a code point from a string at a code point boundary offset, | |
| | | * and advance the offset to the next code point boundary. | |
| | | * (Post-incrementing forward iteration.) | |
| | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| | | * | |
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| | | * The offset may point to the lead byte of a multi-byte sequence, | |
| | | * in which case the macro will read the whole sequence. | |
| | | * If the offset points to a trail byte or an illegal UTF-8 sequence, then | |
| | | * c is set to U+FFFD. | |
| | | * | |
| | | * This macro does not distinguish between a real U+FFFD in the text | |
| | | * and U+FFFD returned for an ill-formed sequence. | |
| | | * Use U8_NEXT() if that distinction is important. | |
| | | * | |
| | | * @param s const uint8_t * string | |
| | | * @param i int32_t string offset, must be i<length | |
| | | * @param length int32_t string length | |
| | | * @param c output UChar32 variable, set to U+FFFD in case of an error | |
| | | * @see U8_NEXT | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | #define U8_NEXT_OR_FFFD(s, i, length, c) { \ | |
| | | (c)=(uint8_t)(s)[(i)++]; \ | |
| | | if((c)>=0x80) { \ | |
| | | uint8_t __t1, __t2; \ | |
| | | if( /* handle U+1000..U+CFFF inline */ \ | |
| | | (0xe0<(c) && (c)<=0xec) && \ | |
| | | (((i)+1)<(length) || (length)<0) && \ | |
| | | (__t1=(uint8_t)((s)[i]-0x80))<=0x3f && \ | |
| | | (__t2=(uint8_t)((s)[(i)+1]-0x80))<= 0x3f \ | |
| | | ) { \ | |
| | | /* no need for (c&0xf) because the upper bits are truncated aft | |
| | | er <<12 in the cast to (UChar) */ \ | |
| | | (c)=(UChar)(((c)<<12)|(__t1<<6)|__t2); \ | |
| | | (i)+=2; \ | |
| | | } else if( /* handle U+0080..U+07FF inline */ \ | |
| | | ((c)<0xe0 && (c)>=0xc2) && \ | |
| | | ((i)!=(length)) && \ | |
| | | (__t1=(uint8_t)((s)[i]-0x80))<=0x3f \ | |
| | | ) { \ | |
| | | (c)=(((c)&0x1f)<<6)|__t1; \ | |
| | | ++(i); \ | |
| } else { \ | | } else { \ | |
|
| (c)=U_SENTINEL; \ | | /* function call for "complicated" and error cases */ \ | |
| | | (c)=utf8_nextCharSafeBody((const uint8_t *)s, &(i), (length), c | |
| | | , -3); \ | |
| } \ | | } \ | |
| } \ | | } \ | |
| } | | } | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Append a code point to a string, overwriting 1 to 4 bytes. | | * Append a code point to a string, overwriting 1 to 4 bytes. | |
| * The offset points to the current end of the string contents | | * The offset points to the current end of the string contents | |
| * and is advanced (post-increment). | | * and is advanced (post-increment). | |
| * "Unsafe" macro, assumes a valid code point and sufficient space in the s
tring. | | * "Unsafe" macro, assumes a valid code point and sufficient space in the s
tring. | |
| * Otherwise, the result is undefined. | | * Otherwise, the result is undefined. | |
| * | | * | |
| * @param s const uint8_t * string buffer | | * @param s const uint8_t * string buffer | |
| * @param i string offset | | * @param i string offset | |
| | | | |
| skipping to change at line 377 | | skipping to change at line 466 | |
| /** | | /** | |
| * Append a code point to a string, overwriting 1 to 4 bytes. | | * Append a code point to a string, overwriting 1 to 4 bytes. | |
| * The offset points to the current end of the string contents | | * The offset points to the current end of the string contents | |
| * and is advanced (post-increment). | | * and is advanced (post-increment). | |
| * "Safe" macro, checks for a valid code point. | | * "Safe" macro, checks for a valid code point. | |
| * If a non-ASCII code point is written, checks for sufficient space in the
string. | | * If a non-ASCII code point is written, checks for sufficient space in the
string. | |
| * If the code point is not valid or trail bytes do not fit, | | * If the code point is not valid or trail bytes do not fit, | |
| * then isError is set to TRUE. | | * then isError is set to TRUE. | |
| * | | * | |
| * @param s const uint8_t * string buffer | | * @param s const uint8_t * string buffer | |
|
| * @param i string offset, must be i<capacity | | * @param i int32_t string offset, must be i<capacity | |
| * @param capacity size of the string buffer | | * @param capacity int32_t size of the string buffer | |
| * @param c code point to append | | * @param c UChar32 code point to append | |
| * @param isError output UBool set to TRUE if an error occurs, otherwise no
t modified | | * @param isError output UBool set to TRUE if an error occurs, otherwise no
t modified | |
| * @see U8_APPEND_UNSAFE | | * @see U8_APPEND_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_APPEND(s, i, capacity, c, isError) { \ | | #define U8_APPEND(s, i, capacity, c, isError) { \ | |
| if((uint32_t)(c)<=0x7f) { \ | | if((uint32_t)(c)<=0x7f) { \ | |
| (s)[(i)++]=(uint8_t)(c); \ | | (s)[(i)++]=(uint8_t)(c); \ | |
| } else if((uint32_t)(c)<=0x7ff && (i)+1<(capacity)) { \ | | } else if((uint32_t)(c)<=0x7ff && (i)+1<(capacity)) { \ | |
| (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); \ | | (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); \ | |
| (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \ | | (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \ | |
| } else if((uint32_t)(c)<=0xd7ff && (i)+2<(capacity)) { \ | | } else if((uint32_t)(c)<=0xd7ff && (i)+2<(capacity)) { \ | |
| (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); \ | | (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); \ | |
| (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); \ | | (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); \ | |
| (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \ | | (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \ | |
| } else { \ | | } else { \ | |
|
| (i)=utf8_appendCharSafeBody(s, (int32_t)(i), (int32_t)(capacity), c
, &(isError)); \ | | (i)=utf8_appendCharSafeBody(s, (i), (capacity), c, &(isError)); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Advance the string offset from one code point boundary to the next. | | * Advance the string offset from one code point boundary to the next. | |
| * (Post-incrementing iteration.) | | * (Post-incrementing iteration.) | |
| * "Unsafe" macro, assumes well-formed UTF-8. | | * "Unsafe" macro, assumes well-formed UTF-8. | |
| * | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
| * @param i string offset | | * @param i string offset | |
| | | | |
| skipping to change at line 418 | | skipping to change at line 507 | |
| */ | | */ | |
| #define U8_FWD_1_UNSAFE(s, i) { \ | | #define U8_FWD_1_UNSAFE(s, i) { \ | |
| (i)+=1+U8_COUNT_TRAIL_BYTES_UNSAFE((uint8_t)(s)[i]); \ | | (i)+=1+U8_COUNT_TRAIL_BYTES_UNSAFE((uint8_t)(s)[i]); \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Advance the string offset from one code point boundary to the next. | | * Advance the string offset from one code point boundary to the next. | |
| * (Post-incrementing iteration.) | | * (Post-incrementing iteration.) | |
| * "Safe" macro, checks for illegal sequences and for string boundaries. | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| * | | * | |
|
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
|
| * @param i string offset, must be i<length | | * @param i int32_t string offset, must be i<length | |
| * @param length string length | | * @param length int32_t string length | |
| * @see U8_FWD_1_UNSAFE | | * @see U8_FWD_1_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_FWD_1(s, i, length) { \ | | #define U8_FWD_1(s, i, length) { \ | |
| uint8_t __b=(uint8_t)(s)[(i)++]; \ | | uint8_t __b=(uint8_t)(s)[(i)++]; \ | |
| if(U8_IS_LEAD(__b)) { \ | | if(U8_IS_LEAD(__b)) { \ | |
| uint8_t __count=U8_COUNT_TRAIL_BYTES(__b); \ | | uint8_t __count=U8_COUNT_TRAIL_BYTES(__b); \ | |
|
| if((i)+__count>(length)) { \ | | if((i)+__count>(length) && (length)>=0) { \ | |
| __count=(uint8_t)((length)-(i)); \ | | __count=(uint8_t)((length)-(i)); \ | |
| } \ | | } \ | |
| while(__count>0 && U8_IS_TRAIL((s)[i])) { \ | | while(__count>0 && U8_IS_TRAIL((s)[i])) { \ | |
| ++(i); \ | | ++(i); \ | |
| --__count; \ | | --__count; \ | |
| } \ | | } \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 464 | | skipping to change at line 555 | |
| --__N; \ | | --__N; \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Advance the string offset from one code point boundary to the n-th next
one, | | * Advance the string offset from one code point boundary to the n-th next
one, | |
| * i.e., move forward by n code points. | | * i.e., move forward by n code points. | |
| * (Post-incrementing iteration.) | | * (Post-incrementing iteration.) | |
| * "Safe" macro, checks for illegal sequences and for string boundaries. | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| * | | * | |
|
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
|
| * @param i string offset, must be i<length | | * @param i int32_t string offset, must be i<length | |
| * @param length string length | | * @param length int32_t string length | |
| * @param n number of code points to skip | | * @param n number of code points to skip | |
| * @see U8_FWD_N_UNSAFE | | * @see U8_FWD_N_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_FWD_N(s, i, length, n) { \ | | #define U8_FWD_N(s, i, length, n) { \ | |
| int32_t __N=(n); \ | | int32_t __N=(n); \ | |
|
| while(__N>0 && (i)<(length)) { \ | | while(__N>0 && ((i)<(length) || ((length)<0 && (s)[i]!=0))) { \ | |
| U8_FWD_1(s, i, length); \ | | U8_FWD_1(s, i, length); \ | |
| --__N; \ | | --__N; \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Adjust a random-access offset to a code point boundary | | * Adjust a random-access offset to a code point boundary | |
| * at the start of a code point. | | * at the start of a code point. | |
| * If the offset points to a UTF-8 trail byte, | | * If the offset points to a UTF-8 trail byte, | |
| * then the offset is moved backward to the corresponding lead byte. | | * then the offset is moved backward to the corresponding lead byte. | |
| | | | |
| skipping to change at line 505 | | skipping to change at line 598 | |
| | | | |
| /** | | /** | |
| * Adjust a random-access offset to a code point boundary | | * Adjust a random-access offset to a code point boundary | |
| * at the start of a code point. | | * at the start of a code point. | |
| * If the offset points to a UTF-8 trail byte, | | * If the offset points to a UTF-8 trail byte, | |
| * then the offset is moved backward to the corresponding lead byte. | | * then the offset is moved backward to the corresponding lead byte. | |
| * Otherwise, it is not modified. | | * Otherwise, it is not modified. | |
| * "Safe" macro, checks for illegal sequences and for string boundaries. | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| * | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
|
| * @param start starting string offset (usually 0) | | * @param start int32_t starting string offset (usually 0) | |
| * @param i string offset, must be start<=i | | * @param i int32_t string offset, must be start<=i | |
| * @see U8_SET_CP_START_UNSAFE | | * @see U8_SET_CP_START_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_SET_CP_START(s, start, i) { \ | | #define U8_SET_CP_START(s, start, i) { \ | |
| if(U8_IS_TRAIL((s)[(i)])) { \ | | if(U8_IS_TRAIL((s)[(i)])) { \ | |
|
| (i)=utf8_back1SafeBody(s, start, (int32_t)(i)); \ | | (i)=utf8_back1SafeBody(s, start, (i)); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /* definitions with backward iteration ------------------------------------
-- */ | | /* definitions with backward iteration ------------------------------------
-- */ | |
| | | | |
| /** | | /** | |
| * Move the string offset from one code point boundary to the previous one | | * Move the string offset from one code point boundary to the previous one | |
| * and get the code point between them. | | * and get the code point between them. | |
| * (Pre-decrementing backward iteration.) | | * (Pre-decrementing backward iteration.) | |
| * "Unsafe" macro, assumes well-formed UTF-8. | | * "Unsafe" macro, assumes well-formed UTF-8. | |
| | | | |
| skipping to change at line 573 | | skipping to change at line 666 | |
| * "Safe" macro, checks for illegal sequences and for string boundaries. | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| * | | * | |
| * The input offset may be the same as the string length. | | * The input offset may be the same as the string length. | |
| * If the offset is behind a multi-byte sequence, then the macro will read | | * If the offset is behind a multi-byte sequence, then the macro will read | |
| * the whole sequence. | | * the whole sequence. | |
| * If the offset is behind a lead byte, then that itself | | * If the offset is behind a lead byte, then that itself | |
| * will be returned as the code point. | | * will be returned as the code point. | |
| * If the offset is behind an illegal UTF-8 sequence, then c is set to a ne
gative value. | | * If the offset is behind an illegal UTF-8 sequence, then c is set to a ne
gative value. | |
| * | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
|
| * @param start starting string offset (usually 0) | | * @param start int32_t starting string offset (usually 0) | |
| * @param i string offset, must be start<i | | * @param i int32_t string offset, must be start<i | |
| * @param c output UChar32 variable, set to <0 in case of an error | | * @param c output UChar32 variable, set to <0 in case of an error | |
| * @see U8_PREV_UNSAFE | | * @see U8_PREV_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_PREV(s, start, i, c) { \ | | #define U8_PREV(s, start, i, c) { \ | |
| (c)=(uint8_t)(s)[--(i)]; \ | | (c)=(uint8_t)(s)[--(i)]; \ | |
| if((c)>=0x80) { \ | | if((c)>=0x80) { \ | |
|
| if((c)<=0xbf) { \ | | (c)=utf8_prevCharSafeBody((const uint8_t *)s, start, &(i), c, -1); | |
| (c)=utf8_prevCharSafeBody((const uint8_t *)s, start, &(i), c, - | | \ | |
| 1); \ | | } \ | |
| } else { \ | | } | |
| (c)=U_SENTINEL; \ | | | |
| } \ | | #ifndef U_HIDE_DRAFT_API | |
| | | /** | |
| | | * Move the string offset from one code point boundary to the previous one | |
| | | * and get the code point between them. | |
| | | * (Pre-decrementing backward iteration.) | |
| | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| | | * | |
| | | * The input offset may be the same as the string length. | |
| | | * If the offset is behind a multi-byte sequence, then the macro will read | |
| | | * the whole sequence. | |
| | | * If the offset is behind a lead byte, then that itself | |
| | | * will be returned as the code point. | |
| | | * If the offset is behind an illegal UTF-8 sequence, then c is set to U+FF | |
| | | FD. | |
| | | * | |
| | | * This macro does not distinguish between a real U+FFFD in the text | |
| | | * and U+FFFD returned for an ill-formed sequence. | |
| | | * Use U8_PREV() if that distinction is important. | |
| | | * | |
| | | * @param s const uint8_t * string | |
| | | * @param start int32_t starting string offset (usually 0) | |
| | | * @param i int32_t string offset, must be start<i | |
| | | * @param c output UChar32 variable, set to U+FFFD in case of an error | |
| | | * @see U8_PREV | |
| | | * @draft ICU 51 | |
| | | */ | |
| | | #define U8_PREV_OR_FFFD(s, start, i, c) { \ | |
| | | (c)=(uint8_t)(s)[--(i)]; \ | |
| | | if((c)>=0x80) { \ | |
| | | (c)=utf8_prevCharSafeBody((const uint8_t *)s, start, &(i), c, -3); | |
| | | \ | |
| } \ | | } \ | |
| } | | } | |
|
| | | #endif /* U_HIDE_DRAFT_API */ | |
| | | | |
| /** | | /** | |
| * Move the string offset from one code point boundary to the previous one. | | * Move the string offset from one code point boundary to the previous one. | |
| * (Pre-decrementing backward iteration.) | | * (Pre-decrementing backward iteration.) | |
| * The input offset may be the same as the string length. | | * The input offset may be the same as the string length. | |
| * "Unsafe" macro, assumes well-formed UTF-8. | | * "Unsafe" macro, assumes well-formed UTF-8. | |
| * | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
| * @param i string offset | | * @param i string offset | |
| * @see U8_BACK_1 | | * @see U8_BACK_1 | |
| | | | |
| skipping to change at line 612 | | skipping to change at line 734 | |
| while(U8_IS_TRAIL((s)[--(i)])) {} \ | | while(U8_IS_TRAIL((s)[--(i)])) {} \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Move the string offset from one code point boundary to the previous one. | | * Move the string offset from one code point boundary to the previous one. | |
| * (Pre-decrementing backward iteration.) | | * (Pre-decrementing backward iteration.) | |
| * The input offset may be the same as the string length. | | * The input offset may be the same as the string length. | |
| * "Safe" macro, checks for illegal sequences and for string boundaries. | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| * | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
|
| * @param start starting string offset (usually 0) | | * @param start int32_t starting string offset (usually 0) | |
| * @param i string offset, must be start<i | | * @param i int32_t string offset, must be start<i | |
| * @see U8_BACK_1_UNSAFE | | * @see U8_BACK_1_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_BACK_1(s, start, i) { \ | | #define U8_BACK_1(s, start, i) { \ | |
| if(U8_IS_TRAIL((s)[--(i)])) { \ | | if(U8_IS_TRAIL((s)[--(i)])) { \ | |
|
| (i)=utf8_back1SafeBody(s, start, (int32_t)(i)); \ | | (i)=utf8_back1SafeBody(s, start, (i)); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Move the string offset from one code point boundary to the n-th one befo
re it, | | * Move the string offset from one code point boundary to the n-th one befo
re it, | |
| * i.e., move backward by n code points. | | * i.e., move backward by n code points. | |
| * (Pre-decrementing backward iteration.) | | * (Pre-decrementing backward iteration.) | |
| * The input offset may be the same as the string length. | | * The input offset may be the same as the string length. | |
| * "Unsafe" macro, assumes well-formed UTF-8. | | * "Unsafe" macro, assumes well-formed UTF-8. | |
| * | | * | |
| | | | |
| skipping to change at line 652 | | skipping to change at line 774 | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Move the string offset from one code point boundary to the n-th one befo
re it, | | * Move the string offset from one code point boundary to the n-th one befo
re it, | |
| * i.e., move backward by n code points. | | * i.e., move backward by n code points. | |
| * (Pre-decrementing backward iteration.) | | * (Pre-decrementing backward iteration.) | |
| * The input offset may be the same as the string length. | | * The input offset may be the same as the string length. | |
| * "Safe" macro, checks for illegal sequences and for string boundaries. | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| * | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
|
| * @param start index of the start of the string | | * @param start int32_t index of the start of the string | |
| * @param i string offset, must be start<i | | * @param i int32_t string offset, must be start<i | |
| * @param n number of code points to skip | | * @param n number of code points to skip | |
| * @see U8_BACK_N_UNSAFE | | * @see U8_BACK_N_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_BACK_N(s, start, i, n) { \ | | #define U8_BACK_N(s, start, i, n) { \ | |
| int32_t __N=(n); \ | | int32_t __N=(n); \ | |
| while(__N>0 && (i)>(start)) { \ | | while(__N>0 && (i)>(start)) { \ | |
| U8_BACK_1(s, start, i); \ | | U8_BACK_1(s, start, i); \ | |
| --__N; \ | | --__N; \ | |
| } \ | | } \ | |
| | | | |
| skipping to change at line 692 | | skipping to change at line 814 | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Adjust a random-access offset to a code point boundary after a code poin
t. | | * Adjust a random-access offset to a code point boundary after a code poin
t. | |
| * If the offset is behind a partial multi-byte sequence, | | * If the offset is behind a partial multi-byte sequence, | |
| * then the offset is incremented to behind the whole sequence. | | * then the offset is incremented to behind the whole sequence. | |
| * Otherwise, it is not modified. | | * Otherwise, it is not modified. | |
| * The input offset may be the same as the string length. | | * The input offset may be the same as the string length. | |
| * "Safe" macro, checks for illegal sequences and for string boundaries. | | * "Safe" macro, checks for illegal sequences and for string boundaries. | |
| * | | * | |
|
| | | * The length can be negative for a NUL-terminated string. | |
| | | * | |
| * @param s const uint8_t * string | | * @param s const uint8_t * string | |
|
| * @param start starting string offset (usually 0) | | * @param start int32_t starting string offset (usually 0) | |
| * @param i string offset, must be start<=i<=length | | * @param i int32_t string offset, must be start<=i<=length | |
| * @param length string length | | * @param length int32_t string length | |
| * @see U8_SET_CP_LIMIT_UNSAFE | | * @see U8_SET_CP_LIMIT_UNSAFE | |
| * @stable ICU 2.4 | | * @stable ICU 2.4 | |
| */ | | */ | |
| #define U8_SET_CP_LIMIT(s, start, i, length) { \ | | #define U8_SET_CP_LIMIT(s, start, i, length) { \ | |
|
| if((start)<(i) && (i)<(length)) { \ | | if((start)<(i) && ((i)<(length) || ((length)<0 && (s)[i]!=0))) { \ | |
| U8_BACK_1(s, start, i); \ | | U8_BACK_1(s, start, i); \ | |
| U8_FWD_1(s, i, length); \ | | U8_FWD_1(s, i, length); \ | |
| } \ | | } \ | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 33 change blocks. |
| 44 lines changed or deleted | | 173 lines changed or added | |
|
| vtzone.h | | vtzone.h | |
| /* | | /* | |
| ***************************************************************************
**** | | ***************************************************************************
**** | |
|
| * Copyright (C) 2007-2012, International Business Machines Corporation and | | * Copyright (C) 2007-2013, 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 163 | | skipping to change at line 163 | |
| void write(UnicodeString& result, UErrorCode& status) const; | | void write(UnicodeString& result, UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
| * Writes RFC2445 VTIMEZONE data for this time zone applicalbe | | * Writes RFC2445 VTIMEZONE data for this time zone applicalbe | |
| * for dates after the specified start time. | | * for dates after the specified start time. | |
| * @param start The start date. | | * @param start The start date. | |
| * @param result Output param to filled in with the VTIMEZONE data. | | * @param result Output param to filled in with the VTIMEZONE data. | |
| * @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. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
|
| void write(UDate start, UnicodeString& result, UErrorCode& status) /*co
nst*/; | | void write(UDate start, UnicodeString& result, UErrorCode& status) cons
t; | |
| | | | |
| /** | | /** | |
| * Writes RFC2445 VTIMEZONE data applicalbe for the specified date. | | * Writes RFC2445 VTIMEZONE data applicalbe for the specified date. | |
| * Some common iCalendar implementations can only handle a single time | | * Some common iCalendar implementations can only handle a single time | |
| * zone property or a pair of standard and daylight time properties usi
ng | | * zone property or a pair of standard and daylight time properties usi
ng | |
| * BYDAY rule with day of week (such as BYDAY=1SUN). This method produ
ce | | * BYDAY rule with day of week (such as BYDAY=1SUN). This method produ
ce | |
| * the VTIMEZONE data which can be handled these implementations. The
rules | | * the VTIMEZONE data which can be handled these implementations. The
rules | |
| * produced by this method can be used only for calculating time zone o
ffset | | * produced by this method can be used only for calculating time zone o
ffset | |
| * around the specified date. | | * around the specified date. | |
| * @param time The date used for rule extraction. | | * @param time The date used for rule extraction. | |
| * @param result Output param to filled in with the VTIMEZONE data. | | * @param result Output param to filled in with the VTIMEZONE data. | |
| * @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. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
|
| void writeSimple(UDate time, UnicodeString& result, UErrorCode& status)
/*const*/; | | void writeSimple(UDate time, UnicodeString& result, UErrorCode& status)
const; | |
| | | | |
| /** | | /** | |
| * Clones TimeZone objects polymorphically. Clients are responsible for
deleting | | * Clones TimeZone objects polymorphically. Clients are responsible for
deleting | |
| * the TimeZone object cloned. | | * the TimeZone object cloned. | |
| * @return A new copy of this TimeZone object. | | * @return A new copy of this TimeZone object. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| virtual TimeZone* clone(void) const; | | virtual TimeZone* clone(void) const; | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 322 | | skipping to change at line 322 | |
| virtual UBool hasSameRules(const TimeZone& other) const; | | virtual UBool hasSameRules(const TimeZone& other) const; | |
| | | | |
| /** | | /** | |
| * Gets the first time zone transition after the base time. | | * Gets the first time zone transition after the base time. | |
| * @param base The base time. | | * @param base The base time. | |
| * @param inclusive Whether the base time is inclusive or not. | | * @param inclusive Whether the base time is inclusive or not. | |
| * @param result Receives the first transition after the base time. | | * @param result Receives the first transition after the base time. | |
| * @return TRUE if the transition is found. | | * @return TRUE if the transition is found. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
|
| virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTr
ansition& result) /*const*/; | | virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTr
ansition& result) const; | |
| | | | |
| /** | | /** | |
| * Gets the most recent time zone transition before the base time. | | * Gets the most recent time zone transition before the base time. | |
| * @param base The base time. | | * @param base The base time. | |
| * @param inclusive Whether the base time is inclusive or not. | | * @param inclusive Whether the base time is inclusive or not. | |
| * @param result Receives the most recent transition before the base
time. | | * @param result Receives the most recent transition before the base
time. | |
| * @return TRUE if the transition is found. | | * @return TRUE if the transition is found. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
|
| virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZo
neTransition& result) /*const*/; | | virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZo
neTransition& result) const; | |
| | | | |
| /** | | /** | |
| * Returns the number of <code>TimeZoneRule</code>s which represents ti
me transitions, | | * Returns the number of <code>TimeZoneRule</code>s which represents ti
me transitions, | |
| * for this time zone, that is, all <code>TimeZoneRule</code>s for this
time zone except | | * for this time zone, that is, all <code>TimeZoneRule</code>s for this
time zone except | |
| * <code>InitialTimeZoneRule</code>. The return value range is 0 or an
y positive value. | | * <code>InitialTimeZoneRule</code>. The return value range is 0 or an
y positive value. | |
| * @param status Receives error status code. | | * @param status Receives error status code. | |
| * @return The number of <code>TimeZoneRule</code>s representing time t
ransitions. | | * @return The number of <code>TimeZoneRule</code>s representing time t
ransitions. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
|
| virtual int32_t countTransitionRules(UErrorCode& status) /*const*/; | | virtual int32_t countTransitionRules(UErrorCode& status) const; | |
| | | | |
| /** | | /** | |
| * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZ
oneRule</code> | | * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZ
oneRule</code> | |
| * which represent time transitions for this time zone. On successful
return, | | * which represent time transitions for this time zone. On successful
return, | |
| * the argument initial points to non-NULL <code>InitialTimeZoneRule</c
ode> and | | * the argument initial points to non-NULL <code>InitialTimeZoneRule</c
ode> and | |
| * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</
code> | | * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</
code> | |
| * instances up to the size specified by trscount. The results are ref
erencing the | | * instances up to the size specified by trscount. The results are ref
erencing the | |
| * rule instance held by this time zone instance. Therefore, after thi
s time zone | | * rule instance held by this time zone instance. Therefore, after thi
s time zone | |
| * is destructed, they are no longer available. | | * is destructed, they are no longer available. | |
| * @param initial Receives the initial timezone rule | | * @param initial Receives the initial timezone rule | |
| * @param trsrules Receives the timezone transition rules | | * @param trsrules Receives the timezone transition rules | |
| * @param trscount On input, specify the size of the array 'transi
tions' receiving | | * @param trscount On input, specify the size of the array 'transi
tions' receiving | |
| * the timezone transition rules. On output, actu
al number of | | * the timezone transition rules. On output, actu
al number of | |
| * rules filled in the array will be set. | | * rules filled in the array will be set. | |
| * @param status Receives error status code. | | * @param status Receives error status code. | |
| * @stable ICU 3.8 | | * @stable ICU 3.8 | |
| */ | | */ | |
| virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial, | | virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial, | |
|
| const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& stat
us) /*const*/; | | const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& stat
us) const; | |
| | | | |
| private: | | private: | |
| enum { DEFAULT_VTIMEZONE_LINES = 100 }; | | enum { DEFAULT_VTIMEZONE_LINES = 100 }; | |
| | | | |
| /** | | /** | |
| * Default constructor. | | * Default constructor. | |
| */ | | */ | |
| VTimeZone(); | | VTimeZone(); | |
| static VTimeZone* createVTimeZone(VTZReader* reader); | | static VTimeZone* createVTimeZone(VTZReader* reader); | |
| void write(VTZWriter& writer, UErrorCode& status) const; | | void write(VTZWriter& writer, UErrorCode& status) const; | |
|
| void write(UDate start, VTZWriter& writer, UErrorCode& status) /*const* | | void write(UDate start, VTZWriter& writer, UErrorCode& status) const; | |
| /; | | void writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) con | |
| void writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) /*c | | st; | |
| 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& zonename, | | void writeZonePropsByTime(VTZWriter& writer, UBool isDst, const Unicode
String& zonename, | |
| | | | |
End of changes. 8 change blocks. |
| 11 lines changed or deleted | | 10 lines changed or added | |
|