mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-13234 rename UCASEMAP_OMIT_UNCHANGED_TEXT to U_OMIT_UNCHANGED_TEXT
X-SVN-Rev: 40161
This commit is contained in:
parent
d1103a457b
commit
3975adb564
9 changed files with 31 additions and 31 deletions
|
@ -23,7 +23,7 @@
|
|||
#include "unicode/bytestream.h"
|
||||
#include "unicode/edits.h"
|
||||
#include "unicode/normalizer2.h"
|
||||
#include "unicode/ucasemap.h" // UCASEMAP_OMIT_UNCHANGED_TEXT
|
||||
#include "unicode/ucasemap.h" // U_OMIT_UNCHANGED_TEXT
|
||||
#include "unicode/udata.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "unicode/utf16.h"
|
||||
|
@ -199,7 +199,7 @@ appendUnchanged(const uint8_t *s, const uint8_t *limit,
|
|||
if (edits != nullptr) {
|
||||
edits->addUnchanged(length);
|
||||
}
|
||||
if ((options & UCASEMAP_OMIT_UNCHANGED_TEXT) ==0) {
|
||||
if ((options & U_OMIT_UNCHANGED_TEXT) ==0) {
|
||||
sink.Append(reinterpret_cast<const char *>(s), length);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ appendResult(uint8_t *dest, int32_t destIndex, int32_t destCapacity,
|
|||
/* (not) original code point */
|
||||
if(edits!=NULL) {
|
||||
edits->addUnchanged(cpLength);
|
||||
if(options & UCASEMAP_OMIT_UNCHANGED_TEXT) {
|
||||
if(options & U_OMIT_UNCHANGED_TEXT) {
|
||||
return destIndex;
|
||||
}
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ appendUnchanged(uint8_t *dest, int32_t destIndex, int32_t destCapacity,
|
|||
if(length>0) {
|
||||
if(edits!=NULL) {
|
||||
edits->addUnchanged(length);
|
||||
if(options & UCASEMAP_OMIT_UNCHANGED_TEXT) {
|
||||
if(options & U_OMIT_UNCHANGED_TEXT) {
|
||||
return destIndex;
|
||||
}
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ int32_t toUpper(uint32_t options,
|
|||
edits->addUnchanged(oldLength);
|
||||
}
|
||||
// Write unchanged text?
|
||||
change = (options & UCASEMAP_OMIT_UNCHANGED_TEXT) == 0;
|
||||
change = (options & U_OMIT_UNCHANGED_TEXT) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
* The source string and the destination buffer must not overlap.
|
||||
*
|
||||
* @param locale The locale ID. ("" = root locale, NULL = default locale.)
|
||||
* @param options Options bit set, usually 0. See UCASEMAP_OMIT_UNCHANGED_TEXT.
|
||||
* @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT.
|
||||
* @param src The original string.
|
||||
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
||||
* @param dest A buffer for the result string. The result will be NUL-terminated if
|
||||
|
@ -71,7 +71,7 @@ public:
|
|||
* The source string and the destination buffer must not overlap.
|
||||
*
|
||||
* @param locale The locale ID. ("" = root locale, NULL = default locale.)
|
||||
* @param options Options bit set, usually 0. See UCASEMAP_OMIT_UNCHANGED_TEXT.
|
||||
* @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT.
|
||||
* @param src The original string.
|
||||
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
||||
* @param dest A buffer for the result string. The result will be NUL-terminated if
|
||||
|
@ -112,7 +112,7 @@ public:
|
|||
* all others. (This can be modified with options bits.)
|
||||
*
|
||||
* @param locale The locale ID. ("" = root locale, NULL = default locale.)
|
||||
* @param options Options bit set, usually 0. See UCASEMAP_OMIT_UNCHANGED_TEXT,
|
||||
* @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT,
|
||||
* U_TITLECASE_NO_LOWERCASE, U_TITLECASE_NO_BREAK_ADJUSTMENT.
|
||||
* @param iter A break iterator to find the first characters of words that are to be titlecased.
|
||||
* It is set to the source string (setText())
|
||||
|
@ -159,7 +159,7 @@ public:
|
|||
* The result may be longer or shorter than the original.
|
||||
* The source string and the destination buffer must not overlap.
|
||||
*
|
||||
* @param options Options bit set, usually 0. See UCASEMAP_OMIT_UNCHANGED_TEXT,
|
||||
* @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT,
|
||||
* U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I.
|
||||
* @param src The original string.
|
||||
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
||||
|
@ -195,7 +195,7 @@ public:
|
|||
* The source string and the destination buffer must not overlap.
|
||||
*
|
||||
* @param locale The locale ID. ("" = root locale, NULL = default locale.)
|
||||
* @param options Options bit set, usually 0. See UCASEMAP_OMIT_UNCHANGED_TEXT.
|
||||
* @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT.
|
||||
* @param src The original string.
|
||||
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
||||
* @param dest A buffer for the result string. The result will be NUL-terminated if
|
||||
|
@ -230,7 +230,7 @@ public:
|
|||
* The source string and the destination buffer must not overlap.
|
||||
*
|
||||
* @param locale The locale ID. ("" = root locale, NULL = default locale.)
|
||||
* @param options Options bit set, usually 0. See UCASEMAP_OMIT_UNCHANGED_TEXT.
|
||||
* @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT.
|
||||
* @param src The original string.
|
||||
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
||||
* @param dest A buffer for the result string. The result will be NUL-terminated if
|
||||
|
@ -271,7 +271,7 @@ public:
|
|||
* all others. (This can be modified with options bits.)
|
||||
*
|
||||
* @param locale The locale ID. ("" = root locale, NULL = default locale.)
|
||||
* @param options Options bit set, usually 0. See UCASEMAP_OMIT_UNCHANGED_TEXT,
|
||||
* @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT,
|
||||
* U_TITLECASE_NO_LOWERCASE, U_TITLECASE_NO_BREAK_ADJUSTMENT.
|
||||
* @param iter A break iterator to find the first characters of words that are to be titlecased.
|
||||
* It is set to the source string (setText())
|
||||
|
@ -317,7 +317,7 @@ public:
|
|||
* The result may be longer or shorter than the original.
|
||||
* The source string and the destination buffer must not overlap.
|
||||
*
|
||||
* @param options Options bit set, usually 0. See UCASEMAP_OMIT_UNCHANGED_TEXT,
|
||||
* @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT,
|
||||
* U_FOLD_CASE_DEFAULT, U_FOLD_CASE_EXCLUDE_SPECIAL_I.
|
||||
* @param src The original string.
|
||||
* @param srcLength The length of the original string. If -1, then src must be NUL-terminated.
|
||||
|
|
|
@ -228,7 +228,7 @@ public:
|
|||
* (UNORM2_COMPOSE and UNORM2_COMPOSE_CONTIGUOUS).
|
||||
* Otherwise currently converts to & from UTF-16 and does not support edits.
|
||||
*
|
||||
* @param options Options bit set, usually 0. See UCASEMAP_OMIT_UNCHANGED_TEXT.
|
||||
* @param options Options bit set, usually 0. See U_OMIT_UNCHANGED_TEXT.
|
||||
* @param src Source UTF-8 string.
|
||||
* @param sink A ByteSink to which the normalized UTF-8 result string is written.
|
||||
* sink.Flush() is called at the end.
|
||||
|
|
|
@ -186,13 +186,13 @@ ucasemap_setOptions(UCaseMap *csm, uint32_t options, UErrorCode *pErrorCode);
|
|||
#define U_TITLECASE_NO_BREAK_ADJUSTMENT 0x200
|
||||
|
||||
/**
|
||||
* Omit unchanged text when case-mapping with Edits.
|
||||
* Omit unchanged text when case-mapping or normalizing with Edits.
|
||||
*
|
||||
* @see CaseMap
|
||||
* @see Edits
|
||||
* @draft ICU 59
|
||||
* @draft ICU 60
|
||||
*/
|
||||
#define UCASEMAP_OMIT_UNCHANGED_TEXT 0x4000
|
||||
#define U_OMIT_UNCHANGED_TEXT 0x4000
|
||||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ UnicodeString::caseMap(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITER
|
|||
iter->setText(oldString);
|
||||
}
|
||||
#endif
|
||||
stringCaseMapper(caseLocale, options | UCASEMAP_OMIT_UNCHANGED_TEXT, UCASEMAP_BREAK_ITERATOR
|
||||
stringCaseMapper(caseLocale, options | U_OMIT_UNCHANGED_TEXT, UCASEMAP_BREAK_ITERATOR
|
||||
replacementChars, UPRV_LENGTHOF(replacementChars),
|
||||
oldArray, oldLength, &edits, errorCode);
|
||||
if (U_SUCCESS(errorCode)) {
|
||||
|
|
|
@ -72,7 +72,7 @@ appendResult(UChar *dest, int32_t destIndex, int32_t destCapacity,
|
|||
/* (not) original code point */
|
||||
if(edits!=NULL) {
|
||||
edits->addUnchanged(cpLength);
|
||||
if(options & UCASEMAP_OMIT_UNCHANGED_TEXT) {
|
||||
if(options & U_OMIT_UNCHANGED_TEXT) {
|
||||
return destIndex;
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ appendUnchanged(UChar *dest, int32_t destIndex, int32_t destCapacity,
|
|||
if(length>0) {
|
||||
if(edits!=NULL) {
|
||||
edits->addUnchanged(length);
|
||||
if(options & UCASEMAP_OMIT_UNCHANGED_TEXT) {
|
||||
if(options & U_OMIT_UNCHANGED_TEXT) {
|
||||
return destIndex;
|
||||
}
|
||||
}
|
||||
|
@ -965,7 +965,7 @@ int32_t toUpper(uint32_t options,
|
|||
edits->addUnchanged(oldLength);
|
||||
}
|
||||
// Write unchanged text?
|
||||
change = (options & UCASEMAP_OMIT_UNCHANGED_TEXT) == 0;
|
||||
change = (options & U_OMIT_UNCHANGED_TEXT) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -911,7 +911,7 @@ void StringCaseTest::TestCaseMapWithEdits() {
|
|||
UChar dest[20];
|
||||
Edits edits;
|
||||
|
||||
int32_t length = CaseMap::toLower("tr", UCASEMAP_OMIT_UNCHANGED_TEXT,
|
||||
int32_t length = CaseMap::toLower("tr", U_OMIT_UNCHANGED_TEXT,
|
||||
u"IstanBul", 8, dest, UPRV_LENGTHOF(dest), &edits, errorCode);
|
||||
assertEquals(u"toLower(IstanBul)", UnicodeString(u"ıb"), UnicodeString(TRUE, dest, length));
|
||||
static const EditChange lowerExpectedChanges[] = {
|
||||
|
@ -926,7 +926,7 @@ void StringCaseTest::TestCaseMapWithEdits() {
|
|||
TRUE, errorCode);
|
||||
|
||||
edits.reset();
|
||||
length = CaseMap::toUpper("el", UCASEMAP_OMIT_UNCHANGED_TEXT,
|
||||
length = CaseMap::toUpper("el", U_OMIT_UNCHANGED_TEXT,
|
||||
u"Πατάτα", 6, dest, UPRV_LENGTHOF(dest), &edits, errorCode);
|
||||
assertEquals(u"toUpper(Πατάτα)", UnicodeString(u"ΑΤΑΤΑ"), UnicodeString(TRUE, dest, length));
|
||||
static const EditChange upperExpectedChanges[] = {
|
||||
|
@ -946,7 +946,7 @@ void StringCaseTest::TestCaseMapWithEdits() {
|
|||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
length = CaseMap::toTitle("nl",
|
||||
UCASEMAP_OMIT_UNCHANGED_TEXT |
|
||||
U_OMIT_UNCHANGED_TEXT |
|
||||
U_TITLECASE_NO_BREAK_ADJUSTMENT |
|
||||
U_TITLECASE_NO_LOWERCASE,
|
||||
NULL, u"IjssEL IglOo", 12,
|
||||
|
@ -964,7 +964,7 @@ void StringCaseTest::TestCaseMapWithEdits() {
|
|||
#endif
|
||||
|
||||
edits.reset();
|
||||
length = CaseMap::fold(UCASEMAP_OMIT_UNCHANGED_TEXT | U_FOLD_CASE_EXCLUDE_SPECIAL_I,
|
||||
length = CaseMap::fold(U_OMIT_UNCHANGED_TEXT | U_FOLD_CASE_EXCLUDE_SPECIAL_I,
|
||||
u"IßtanBul", 8, dest, UPRV_LENGTHOF(dest), &edits, errorCode);
|
||||
assertEquals(u"foldCase(IßtanBul)", UnicodeString(u"ıssb"), UnicodeString(TRUE, dest, length));
|
||||
static const EditChange foldExpectedChanges[] = {
|
||||
|
@ -985,7 +985,7 @@ void StringCaseTest::TestCaseMapUTF8WithEdits() {
|
|||
char dest[50];
|
||||
Edits edits;
|
||||
|
||||
int32_t length = CaseMap::utf8ToLower("tr", UCASEMAP_OMIT_UNCHANGED_TEXT,
|
||||
int32_t length = CaseMap::utf8ToLower("tr", U_OMIT_UNCHANGED_TEXT,
|
||||
u8"IstanBul", 8, dest, UPRV_LENGTHOF(dest), &edits, errorCode);
|
||||
assertEquals(u"toLower(IstanBul)", UnicodeString(u"ıb"),
|
||||
UnicodeString::fromUTF8(StringPiece(dest, length)));
|
||||
|
@ -1001,7 +1001,7 @@ void StringCaseTest::TestCaseMapUTF8WithEdits() {
|
|||
TRUE, errorCode);
|
||||
|
||||
edits.reset();
|
||||
length = CaseMap::utf8ToUpper("el", UCASEMAP_OMIT_UNCHANGED_TEXT,
|
||||
length = CaseMap::utf8ToUpper("el", U_OMIT_UNCHANGED_TEXT,
|
||||
u8"Πατάτα", 6 * 2, dest, UPRV_LENGTHOF(dest), &edits, errorCode);
|
||||
assertEquals(u"toUpper(Πατάτα)", UnicodeString(u"ΑΤΑΤΑ"),
|
||||
UnicodeString::fromUTF8(StringPiece(dest, length)));
|
||||
|
@ -1021,7 +1021,7 @@ void StringCaseTest::TestCaseMapUTF8WithEdits() {
|
|||
edits.reset();
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
length = CaseMap::utf8ToTitle("nl",
|
||||
UCASEMAP_OMIT_UNCHANGED_TEXT |
|
||||
U_OMIT_UNCHANGED_TEXT |
|
||||
U_TITLECASE_NO_BREAK_ADJUSTMENT |
|
||||
U_TITLECASE_NO_LOWERCASE,
|
||||
NULL, u8"IjssEL IglOo", 12,
|
||||
|
@ -1040,7 +1040,7 @@ void StringCaseTest::TestCaseMapUTF8WithEdits() {
|
|||
#endif
|
||||
|
||||
edits.reset();
|
||||
length = CaseMap::utf8Fold(UCASEMAP_OMIT_UNCHANGED_TEXT | U_FOLD_CASE_EXCLUDE_SPECIAL_I,
|
||||
length = CaseMap::utf8Fold(U_OMIT_UNCHANGED_TEXT | U_FOLD_CASE_EXCLUDE_SPECIAL_I,
|
||||
u8"IßtanBul", 1 + 2 + 6, dest, UPRV_LENGTHOF(dest), &edits, errorCode);
|
||||
assertEquals(u"foldCase(IßtanBul)", UnicodeString(u"ıssb"),
|
||||
UnicodeString::fromUTF8(StringPiece(dest, length)));
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "unicode/uchar.h"
|
||||
#include "unicode/errorcode.h"
|
||||
#include "unicode/normlzr.h"
|
||||
#include "unicode/ucasemap.h" // UCASEMAP_OMIT_UNCHANGED_TEXT
|
||||
#include "unicode/ucasemap.h" // U_OMIT_UNCHANGED_TEXT
|
||||
#include "unicode/uniset.h"
|
||||
#include "unicode/usetiter.h"
|
||||
#include "unicode/schriter.h"
|
||||
|
@ -1561,7 +1561,7 @@ BasicNormalizerTest::TestNormalizeUTF8WithEdits() {
|
|||
expected = u8"aääạ\u0308ạ\u0308가각갃";
|
||||
result.clear();
|
||||
edits.reset();
|
||||
nfkc_cf->normalizeUTF8(UCASEMAP_OMIT_UNCHANGED_TEXT, src, sink, &edits, errorCode);
|
||||
nfkc_cf->normalizeUTF8(U_OMIT_UNCHANGED_TEXT, src, sink, &edits, errorCode);
|
||||
assertSuccess("normalizeUTF8 omit unchanged", errorCode.get());
|
||||
assertEquals("normalizeUTF8 omit unchanged", expected.c_str(), result.c_str());
|
||||
TestUtility::checkEditsIter(*this, u"normalizeUTF8 omit unchanged",
|
||||
|
|
Loading…
Add table
Reference in a new issue