1*0e209d39SAndroid Build Coastguard Worker // © 2017 and later: Unicode, Inc. and others. 2*0e209d39SAndroid Build Coastguard Worker // License & terms of use: http://www.unicode.org/copyright.html 3*0e209d39SAndroid Build Coastguard Worker 4*0e209d39SAndroid Build Coastguard Worker // stringoptions.h 5*0e209d39SAndroid Build Coastguard Worker // created: 2017jun08 Markus W. Scherer 6*0e209d39SAndroid Build Coastguard Worker 7*0e209d39SAndroid Build Coastguard Worker #ifndef __STRINGOPTIONS_H__ 8*0e209d39SAndroid Build Coastguard Worker #define __STRINGOPTIONS_H__ 9*0e209d39SAndroid Build Coastguard Worker 10*0e209d39SAndroid Build Coastguard Worker #include "unicode/utypes.h" 11*0e209d39SAndroid Build Coastguard Worker 12*0e209d39SAndroid Build Coastguard Worker /** 13*0e209d39SAndroid Build Coastguard Worker * @addtogroup icu4c ICU4C 14*0e209d39SAndroid Build Coastguard Worker * @{ 15*0e209d39SAndroid Build Coastguard Worker * \file 16*0e209d39SAndroid Build Coastguard Worker * \brief C API: Bit set option bit constants for various string and character processing functions. 17*0e209d39SAndroid Build Coastguard Worker */ 18*0e209d39SAndroid Build Coastguard Worker 19*0e209d39SAndroid Build Coastguard Worker /** 20*0e209d39SAndroid Build Coastguard Worker * Option value for case folding: Use default mappings defined in CaseFolding.txt. 21*0e209d39SAndroid Build Coastguard Worker * 22*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.0 23*0e209d39SAndroid Build Coastguard Worker */ 24*0e209d39SAndroid Build Coastguard Worker #define U_FOLD_CASE_DEFAULT 0 25*0e209d39SAndroid Build Coastguard Worker 26*0e209d39SAndroid Build Coastguard Worker /** 27*0e209d39SAndroid Build Coastguard Worker * Option value for case folding: 28*0e209d39SAndroid Build Coastguard Worker * 29*0e209d39SAndroid Build Coastguard Worker * Use the modified set of mappings provided in CaseFolding.txt to handle dotted I 30*0e209d39SAndroid Build Coastguard Worker * and dotless i appropriately for Turkic languages (tr, az). 31*0e209d39SAndroid Build Coastguard Worker * 32*0e209d39SAndroid Build Coastguard Worker * Before Unicode 3.2, CaseFolding.txt contains mappings marked with 'I' that 33*0e209d39SAndroid Build Coastguard Worker * are to be included for default mappings and 34*0e209d39SAndroid Build Coastguard Worker * excluded for the Turkic-specific mappings. 35*0e209d39SAndroid Build Coastguard Worker * 36*0e209d39SAndroid Build Coastguard Worker * Unicode 3.2 CaseFolding.txt instead contains mappings marked with 'T' that 37*0e209d39SAndroid Build Coastguard Worker * are to be excluded for default mappings and 38*0e209d39SAndroid Build Coastguard Worker * included for the Turkic-specific mappings. 39*0e209d39SAndroid Build Coastguard Worker * 40*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.0 41*0e209d39SAndroid Build Coastguard Worker */ 42*0e209d39SAndroid Build Coastguard Worker #define U_FOLD_CASE_EXCLUDE_SPECIAL_I 1 43*0e209d39SAndroid Build Coastguard Worker 44*0e209d39SAndroid Build Coastguard Worker /** 45*0e209d39SAndroid Build Coastguard Worker * Titlecase the string as a whole rather than each word. 46*0e209d39SAndroid Build Coastguard Worker * (Titlecase only the character at index 0, possibly adjusted.) 47*0e209d39SAndroid Build Coastguard Worker * Option bits value for titlecasing APIs that take an options bit set. 48*0e209d39SAndroid Build Coastguard Worker * 49*0e209d39SAndroid Build Coastguard Worker * It is an error to specify multiple titlecasing iterator options together, 50*0e209d39SAndroid Build Coastguard Worker * including both an options bit and an explicit BreakIterator. 51*0e209d39SAndroid Build Coastguard Worker * 52*0e209d39SAndroid Build Coastguard Worker * @see U_TITLECASE_ADJUST_TO_CASED 53*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 60 54*0e209d39SAndroid Build Coastguard Worker */ 55*0e209d39SAndroid Build Coastguard Worker #define U_TITLECASE_WHOLE_STRING 0x20 56*0e209d39SAndroid Build Coastguard Worker 57*0e209d39SAndroid Build Coastguard Worker /** 58*0e209d39SAndroid Build Coastguard Worker * Titlecase sentences rather than words. 59*0e209d39SAndroid Build Coastguard Worker * (Titlecase only the first character of each sentence, possibly adjusted.) 60*0e209d39SAndroid Build Coastguard Worker * Option bits value for titlecasing APIs that take an options bit set. 61*0e209d39SAndroid Build Coastguard Worker * 62*0e209d39SAndroid Build Coastguard Worker * It is an error to specify multiple titlecasing iterator options together, 63*0e209d39SAndroid Build Coastguard Worker * including both an options bit and an explicit BreakIterator. 64*0e209d39SAndroid Build Coastguard Worker * 65*0e209d39SAndroid Build Coastguard Worker * @see U_TITLECASE_ADJUST_TO_CASED 66*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 60 67*0e209d39SAndroid Build Coastguard Worker */ 68*0e209d39SAndroid Build Coastguard Worker #define U_TITLECASE_SENTENCES 0x40 69*0e209d39SAndroid Build Coastguard Worker 70*0e209d39SAndroid Build Coastguard Worker /** 71*0e209d39SAndroid Build Coastguard Worker * Do not lowercase non-initial parts of words when titlecasing. 72*0e209d39SAndroid Build Coastguard Worker * Option bit for titlecasing APIs that take an options bit set. 73*0e209d39SAndroid Build Coastguard Worker * 74*0e209d39SAndroid Build Coastguard Worker * By default, titlecasing will titlecase the character at each 75*0e209d39SAndroid Build Coastguard Worker * (possibly adjusted) BreakIterator index and 76*0e209d39SAndroid Build Coastguard Worker * lowercase all other characters up to the next iterator index. 77*0e209d39SAndroid Build Coastguard Worker * With this option, the other characters will not be modified. 78*0e209d39SAndroid Build Coastguard Worker * 79*0e209d39SAndroid Build Coastguard Worker * @see U_TITLECASE_ADJUST_TO_CASED 80*0e209d39SAndroid Build Coastguard Worker * @see UnicodeString::toTitle 81*0e209d39SAndroid Build Coastguard Worker * @see CaseMap::toTitle 82*0e209d39SAndroid Build Coastguard Worker * @see ucasemap_setOptions 83*0e209d39SAndroid Build Coastguard Worker * @see ucasemap_toTitle 84*0e209d39SAndroid Build Coastguard Worker * @see ucasemap_utf8ToTitle 85*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 3.8 86*0e209d39SAndroid Build Coastguard Worker */ 87*0e209d39SAndroid Build Coastguard Worker #define U_TITLECASE_NO_LOWERCASE 0x100 88*0e209d39SAndroid Build Coastguard Worker 89*0e209d39SAndroid Build Coastguard Worker /** 90*0e209d39SAndroid Build Coastguard Worker * Do not adjust the titlecasing BreakIterator indexes; 91*0e209d39SAndroid Build Coastguard Worker * titlecase exactly the characters at breaks from the iterator. 92*0e209d39SAndroid Build Coastguard Worker * Option bit for titlecasing APIs that take an options bit set. 93*0e209d39SAndroid Build Coastguard Worker * 94*0e209d39SAndroid Build Coastguard Worker * By default, titlecasing will take each break iterator index, 95*0e209d39SAndroid Build Coastguard Worker * adjust it to the next relevant character (see U_TITLECASE_ADJUST_TO_CASED), 96*0e209d39SAndroid Build Coastguard Worker * and titlecase that one. 97*0e209d39SAndroid Build Coastguard Worker * 98*0e209d39SAndroid Build Coastguard Worker * Other characters are lowercased. 99*0e209d39SAndroid Build Coastguard Worker * 100*0e209d39SAndroid Build Coastguard Worker * It is an error to specify multiple titlecasing adjustment options together. 101*0e209d39SAndroid Build Coastguard Worker * 102*0e209d39SAndroid Build Coastguard Worker * @see U_TITLECASE_ADJUST_TO_CASED 103*0e209d39SAndroid Build Coastguard Worker * @see U_TITLECASE_NO_LOWERCASE 104*0e209d39SAndroid Build Coastguard Worker * @see UnicodeString::toTitle 105*0e209d39SAndroid Build Coastguard Worker * @see CaseMap::toTitle 106*0e209d39SAndroid Build Coastguard Worker * @see ucasemap_setOptions 107*0e209d39SAndroid Build Coastguard Worker * @see ucasemap_toTitle 108*0e209d39SAndroid Build Coastguard Worker * @see ucasemap_utf8ToTitle 109*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 3.8 110*0e209d39SAndroid Build Coastguard Worker */ 111*0e209d39SAndroid Build Coastguard Worker #define U_TITLECASE_NO_BREAK_ADJUSTMENT 0x200 112*0e209d39SAndroid Build Coastguard Worker 113*0e209d39SAndroid Build Coastguard Worker /** 114*0e209d39SAndroid Build Coastguard Worker * Adjust each titlecasing BreakIterator index to the next cased character. 115*0e209d39SAndroid Build Coastguard Worker * (See the Unicode Standard, chapter 3, Default Case Conversion, R3 toTitlecase(X).) 116*0e209d39SAndroid Build Coastguard Worker * Option bit for titlecasing APIs that take an options bit set. 117*0e209d39SAndroid Build Coastguard Worker * 118*0e209d39SAndroid Build Coastguard Worker * This used to be the default index adjustment in ICU. 119*0e209d39SAndroid Build Coastguard Worker * Since ICU 60, the default index adjustment is to the next character that is 120*0e209d39SAndroid Build Coastguard Worker * a letter, number, symbol, or private use code point. 121*0e209d39SAndroid Build Coastguard Worker * (Uncased modifier letters are skipped.) 122*0e209d39SAndroid Build Coastguard Worker * The difference in behavior is small for word titlecasing, 123*0e209d39SAndroid Build Coastguard Worker * but the new adjustment is much better for whole-string and sentence titlecasing: 124*0e209d39SAndroid Build Coastguard Worker * It yields "49ers" and "«丰(abc)»" instead of "49Ers" and "«丰(Abc)»". 125*0e209d39SAndroid Build Coastguard Worker * 126*0e209d39SAndroid Build Coastguard Worker * It is an error to specify multiple titlecasing adjustment options together. 127*0e209d39SAndroid Build Coastguard Worker * 128*0e209d39SAndroid Build Coastguard Worker * @see U_TITLECASE_NO_BREAK_ADJUSTMENT 129*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 60 130*0e209d39SAndroid Build Coastguard Worker */ 131*0e209d39SAndroid Build Coastguard Worker #define U_TITLECASE_ADJUST_TO_CASED 0x400 132*0e209d39SAndroid Build Coastguard Worker 133*0e209d39SAndroid Build Coastguard Worker /** 134*0e209d39SAndroid Build Coastguard Worker * Option for string transformation functions to not first reset the Edits object. 135*0e209d39SAndroid Build Coastguard Worker * Used for example in some case-mapping and normalization functions. 136*0e209d39SAndroid Build Coastguard Worker * 137*0e209d39SAndroid Build Coastguard Worker * @see CaseMap 138*0e209d39SAndroid Build Coastguard Worker * @see Edits 139*0e209d39SAndroid Build Coastguard Worker * @see Normalizer2 140*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 60 141*0e209d39SAndroid Build Coastguard Worker */ 142*0e209d39SAndroid Build Coastguard Worker #define U_EDITS_NO_RESET 0x2000 143*0e209d39SAndroid Build Coastguard Worker 144*0e209d39SAndroid Build Coastguard Worker /** 145*0e209d39SAndroid Build Coastguard Worker * Omit unchanged text when recording how source substrings 146*0e209d39SAndroid Build Coastguard Worker * relate to changed and unchanged result substrings. 147*0e209d39SAndroid Build Coastguard Worker * Used for example in some case-mapping and normalization functions. 148*0e209d39SAndroid Build Coastguard Worker * 149*0e209d39SAndroid Build Coastguard Worker * @see CaseMap 150*0e209d39SAndroid Build Coastguard Worker * @see Edits 151*0e209d39SAndroid Build Coastguard Worker * @see Normalizer2 152*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 60 153*0e209d39SAndroid Build Coastguard Worker */ 154*0e209d39SAndroid Build Coastguard Worker #define U_OMIT_UNCHANGED_TEXT 0x4000 155*0e209d39SAndroid Build Coastguard Worker 156*0e209d39SAndroid Build Coastguard Worker /** 157*0e209d39SAndroid Build Coastguard Worker * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: 158*0e209d39SAndroid Build Coastguard Worker * Compare strings in code point order instead of code unit order. 159*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.2 160*0e209d39SAndroid Build Coastguard Worker */ 161*0e209d39SAndroid Build Coastguard Worker #define U_COMPARE_CODE_POINT_ORDER 0x8000 162*0e209d39SAndroid Build Coastguard Worker 163*0e209d39SAndroid Build Coastguard Worker /** 164*0e209d39SAndroid Build Coastguard Worker * Option bit for unorm_compare: 165*0e209d39SAndroid Build Coastguard Worker * Perform case-insensitive comparison. 166*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.2 167*0e209d39SAndroid Build Coastguard Worker */ 168*0e209d39SAndroid Build Coastguard Worker #define U_COMPARE_IGNORE_CASE 0x10000 169*0e209d39SAndroid Build Coastguard Worker 170*0e209d39SAndroid Build Coastguard Worker /** 171*0e209d39SAndroid Build Coastguard Worker * Option bit for unorm_compare: 172*0e209d39SAndroid Build Coastguard Worker * Both input strings are assumed to fulfill FCD conditions. 173*0e209d39SAndroid Build Coastguard Worker * \xrefitem stable "Stable" "Stable List" ICU 2.2 174*0e209d39SAndroid Build Coastguard Worker */ 175*0e209d39SAndroid Build Coastguard Worker #define UNORM_INPUT_IS_FCD 0x20000 176*0e209d39SAndroid Build Coastguard Worker 177*0e209d39SAndroid Build Coastguard Worker // Related definitions elsewhere. 178*0e209d39SAndroid Build Coastguard Worker // Options that are not meaningful in the same functions 179*0e209d39SAndroid Build Coastguard Worker // can share the same bits. 180*0e209d39SAndroid Build Coastguard Worker // 181*0e209d39SAndroid Build Coastguard Worker // Public: 182*0e209d39SAndroid Build Coastguard Worker // unicode/unorm.h #define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20 183*0e209d39SAndroid Build Coastguard Worker // 184*0e209d39SAndroid Build Coastguard Worker // Internal: (may change or be removed) 185*0e209d39SAndroid Build Coastguard Worker // ucase.h #define _STRCASECMP_OPTIONS_MASK 0xffff 186*0e209d39SAndroid Build Coastguard Worker // ucase.h #define _FOLD_CASE_OPTIONS_MASK 7 187*0e209d39SAndroid Build Coastguard Worker // ucasemap_imp.h #define U_TITLECASE_ITERATOR_MASK 0xe0 188*0e209d39SAndroid Build Coastguard Worker // ucasemap_imp.h #define U_TITLECASE_ADJUSTMENT_MASK 0x600 189*0e209d39SAndroid Build Coastguard Worker // ustr_imp.h #define _STRNCMP_STYLE 0x1000 190*0e209d39SAndroid Build Coastguard Worker // unormcmp.cpp #define _COMPARE_EQUIV 0x80000 191*0e209d39SAndroid Build Coastguard Worker 192*0e209d39SAndroid Build Coastguard Worker #endif // __STRINGOPTIONS_H__ 193*0e209d39SAndroid Build Coastguard Worker 194*0e209d39SAndroid Build Coastguard Worker /** @} */ // addtogroup 195