]> granicus.if.org Git - icu/commitdiff
ICU-13234 rename UCASEMAP_OMIT_UNCHANGED_TEXT to U_OMIT_UNCHANGED_TEXT
authorMarkus Scherer <markus.icu@gmail.com>
Thu, 8 Jun 2017 19:36:34 +0000 (19:36 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Thu, 8 Jun 2017 19:36:34 +0000 (19:36 +0000)
X-SVN-Rev: 40161

icu4c/source/common/normalizer2impl.cpp
icu4c/source/common/ucasemap.cpp
icu4c/source/common/unicode/casemap.h
icu4c/source/common/unicode/normalizer2.h
icu4c/source/common/unicode/ucasemap.h
icu4c/source/common/unistr_case.cpp
icu4c/source/common/ustrcase.cpp
icu4c/source/test/intltest/strcase.cpp
icu4c/source/test/intltest/tstnorm.cpp

index 757a0c3f6bd10fac9f032802495d4f886535cb39..5e3103eca7030f3fca239a5ebfbbbaec7aa40997 100644 (file)
@@ -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);
         }
     }
index 1523cb6d9db19b72f5406b752ef32a47190e7f17..c21c4453b7641fa8ad4c6a1094316061cc0266b8 100644 (file)
@@ -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;
                 }
             }
 
index 98184820d53457bf6f9f1dba4c41bffd39c35d0f..1b8af69a26f6f2470044adc325908e331c479f5a 100644 (file)
@@ -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.
index bb43439c2ca72f43225ddc89edae6c30a25d8c41..f0d77978804a4827ce51ddb96a85c42537a14bff 100644 (file)
@@ -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.
index 18e6c2ba0b9e0b3140383eb3c95046c359d37110..15f508af20c2b15f02c7dabcfd627b88314d85d5 100644 (file)
@@ -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
 
index 48c122fcddd9dd9cc1ffc2a4df96e19ade4a35d8..2138d60c01c2d17be8dae6c51f7e1a17403e2c43 100644 (file)
@@ -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)) {
index b12e7a7c0b3a102404c0c1bf114ddf80100b7f08..57f6c8b755cbbbb3da30c9436507865f78eedd9d 100644 (file)
@@ -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;
                 }
             }
 
index 255855ce8d2944f4aec0b54897c9d52f33ecb755..3edad8e698782a6cc3dfa5ed2cb3905e33a4c7a2 100644 (file)
@@ -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)));
index f0861baf0578cedc1a926bea0764c072a76efbf5..199554d9402c00fb11a3dcc12f60644a0a4a9d38 100644 (file)
@@ -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",