ICU-12992 s/UChar/char16_t/g in public C++ header files
authorMarkus Scherer <markus.icu@gmail.com>
Wed, 1 Mar 2017 23:55:58 +0000 (23:55 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Wed, 1 Mar 2017 23:55:58 +0000 (23:55 +0000)
X-SVN-Rev: 39721

34 files changed:
icu4c/source/common/unicode/appendable.h
icu4c/source/common/unicode/bytestriebuilder.h
icu4c/source/common/unicode/caniter.h
icu4c/source/common/unicode/casemap.h
icu4c/source/common/unicode/chariter.h
icu4c/source/common/unicode/localpointer.h
icu4c/source/common/unicode/normalizer2.h
icu4c/source/common/unicode/rep.h
icu4c/source/common/unicode/resbund.h
icu4c/source/common/unicode/schriter.h
icu4c/source/common/unicode/simpleformatter.h
icu4c/source/common/unicode/strenum.h
icu4c/source/common/unicode/stringtriebuilder.h
icu4c/source/common/unicode/ucharstrie.h
icu4c/source/common/unicode/ucharstriebuilder.h
icu4c/source/common/unicode/uchriter.h
icu4c/source/common/unicode/unifilt.h
icu4c/source/common/unicode/uniset.h
icu4c/source/common/unicode/unistr.h
icu4c/source/i18n/unicode/coll.h
icu4c/source/i18n/unicode/currunit.h
icu4c/source/i18n/unicode/dcfmtsym.h
icu4c/source/i18n/unicode/decimfmt.h
icu4c/source/i18n/unicode/dtfmtsym.h
icu4c/source/i18n/unicode/dtitvfmt.h
icu4c/source/i18n/unicode/dtptngen.h
icu4c/source/i18n/unicode/msgfmt.h
icu4c/source/i18n/unicode/numfmt.h
icu4c/source/i18n/unicode/regex.h
icu4c/source/i18n/unicode/smpdtfmt.h
icu4c/source/i18n/unicode/tblcoll.h
icu4c/source/i18n/unicode/timezone.h
icu4c/source/i18n/unicode/translit.h
icu4c/source/i18n/unicode/tzfmt.h

index d611dc008af2980e8d5397524c75c0e5bb6e1230..8512c2f30311b8d1bc1b8a8e467ddadc3828d42f 100644 (file)
@@ -19,7 +19,7 @@
 
 /**
  * \file
- * \brief C++ API: Appendable class: Sink for Unicode code points and 16-bit code units (UChars).
+ * \brief C++ API: Appendable class: Sink for Unicode code points and 16-bit code units (char16_ts).
  */
 
 #include "unicode/utypes.h"
@@ -34,10 +34,10 @@ class UnicodeString;
  * Combines elements of Java Appendable and ICU4C ByteSink.
  *
  * This class can be used in APIs where it does not matter whether the actual destination is
- * a UnicodeString, a UChar[] array, a UnicodeSet, or any other object
+ * a UnicodeString, a char16_t[] array, a UnicodeSet, or any other object
  * that receives and processes characters and/or strings.
  *
- * Implementation classes must implement at least appendCodeUnit(UChar).
+ * Implementation classes must implement at least appendCodeUnit(char16_t).
  * The base class provides default implementations for the other methods.
  *
  * The methods do not take UErrorCode parameters.
@@ -62,11 +62,11 @@ public:
      * @return TRUE if the operation succeeded
      * @stable ICU 4.8
      */
-    virtual UBool appendCodeUnit(UChar c) = 0;
+    virtual UBool appendCodeUnit(char16_t c) = 0;
 
     /**
      * Appends a code point.
-     * The default implementation calls appendCodeUnit(UChar) once or twice.
+     * The default implementation calls appendCodeUnit(char16_t) once or twice.
      * @param c code point 0..0x10ffff
      * @return TRUE if the operation succeeded
      * @stable ICU 4.8
@@ -75,20 +75,20 @@ public:
 
     /**
      * Appends a string.
-     * The default implementation calls appendCodeUnit(UChar) for each code unit.
+     * The default implementation calls appendCodeUnit(char16_t) for each code unit.
      * @param s string, must not be NULL if length!=0
      * @param length string length, or -1 if NUL-terminated
      * @return TRUE if the operation succeeded
      * @stable ICU 4.8
      */
-    virtual UBool appendString(const UChar *s, int32_t length);
+    virtual UBool appendString(const char16_t *s, int32_t length);
 
     /**
      * Tells the object that the caller is going to append roughly
-     * appendCapacity UChars. A subclass might use this to pre-allocate
+     * appendCapacity char16_ts. A subclass might use this to pre-allocate
      * a larger buffer if necessary.
      * The default implementation does nothing. (It always returns TRUE.)
-     * @param appendCapacity estimated number of UChars that will be appended
+     * @param appendCapacity estimated number of char16_ts that will be appended
      * @return TRUE if the operation succeeded
      * @stable ICU 4.8
      */
@@ -102,19 +102,19 @@ public:
      * The returned buffer is only valid until the next operation
      * on this Appendable.
      *
-     * After writing at most *resultCapacity UChars, call appendString() with the
-     * pointer returned from this function and the number of UChars written.
-     * Many appendString() implementations will avoid copying UChars if this function
+     * After writing at most *resultCapacity char16_ts, call appendString() with the
+     * pointer returned from this function and the number of char16_ts written.
+     * Many appendString() implementations will avoid copying char16_ts if this function
      * returned an internal buffer.
      *
      * Partial usage example:
      * \code
      *  int32_t capacity;
-     *  UChar* buffer = app.getAppendBuffer(..., &capacity);
-     *  ... Write n UChars into buffer, with n <= capacity.
+     *  char16_t* buffer = app.getAppendBuffer(..., &capacity);
+     *  ... Write n char16_ts into buffer, with n <= capacity.
      *  app.appendString(buffer, n);
      * \endcode
-     * In many implementations, that call to append will avoid copying UChars.
+     * In many implementations, that call to append will avoid copying char16_ts.
      *
      * If the Appendable allocates or reallocates an internal buffer, it should use
      * the desiredCapacityHint if appropriate.
@@ -138,9 +138,9 @@ public:
      * @return a buffer with *resultCapacity>=minCapacity
      * @stable ICU 4.8
      */
-    virtual UChar *getAppendBuffer(int32_t minCapacity,
+    virtual char16_t *getAppendBuffer(int32_t minCapacity,
                                    int32_t desiredCapacityHint,
-                                   UChar *scratch, int32_t scratchCapacity,
+                                   char16_t *scratch, int32_t scratchCapacity,
                                    int32_t *resultCapacity);
 };
 
@@ -171,7 +171,7 @@ public:
      * @return TRUE if the operation succeeded
      * @stable ICU 4.8
      */
-    virtual UBool appendCodeUnit(UChar c);
+    virtual UBool appendCodeUnit(char16_t c);
 
     /**
      * Appends a code point to the string.
@@ -188,12 +188,12 @@ public:
      * @return TRUE if the operation succeeded
      * @stable ICU 4.8
      */
-    virtual UBool appendString(const UChar *s, int32_t length);
+    virtual UBool appendString(const char16_t *s, int32_t length);
 
     /**
      * Tells the UnicodeString that the caller is going to append roughly
-     * appendCapacity UChars.
-     * @param appendCapacity estimated number of UChars that will be appended
+     * appendCapacity char16_ts.
+     * @param appendCapacity estimated number of char16_ts that will be appended
      * @return TRUE if the operation succeeded
      * @stable ICU 4.8
      */
@@ -220,9 +220,9 @@ public:
      * @return a buffer with *resultCapacity>=minCapacity
      * @stable ICU 4.8
      */
-    virtual UChar *getAppendBuffer(int32_t minCapacity,
+    virtual char16_t *getAppendBuffer(int32_t minCapacity,
                                    int32_t desiredCapacityHint,
-                                   UChar *scratch, int32_t scratchCapacity,
+                                   char16_t *scratch, int32_t scratchCapacity,
                                    int32_t *resultCapacity);
 
 private:
index 888ba8bdb598fd45e3882a26020a114c84ce9da7..a8412d3d6e833d31a9acf94ad9c7c1274ce7e00d 100644 (file)
@@ -127,14 +127,14 @@ private:
     void buildBytes(UStringTrieBuildOption buildOption, UErrorCode &errorCode);
 
     virtual int32_t getElementStringLength(int32_t i) const;
-    virtual UChar getElementUnit(int32_t i, int32_t byteIndex) const;
+    virtual char16_t getElementUnit(int32_t i, int32_t byteIndex) const;
     virtual int32_t getElementValue(int32_t i) const;
 
     virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t byteIndex) const;
 
     virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t byteIndex) const;
     virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t byteIndex, int32_t count) const;
-    virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t byteIndex, UChar byte) const;
+    virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t byteIndex, char16_t byte) const;
 
     virtual UBool matchNodesCanHaveValues() const { return FALSE; }
 
index 7e83a4f6cb7c3971d7122b45332f5e61225d1f6a..5a882fb3fb8bcd621a7250f60a2137241ce43c7e 100644 (file)
@@ -187,7 +187,7 @@ private:
     UnicodeString *getEquivalents(const UnicodeString &segment, int32_t &result_len, UErrorCode &status); //private String[] getEquivalents(String segment)
 
     //Set getEquivalents2(String segment);
-    Hashtable *getEquivalents2(Hashtable *fillinResult, const UChar *segment, int32_t segLen, UErrorCode &status);
+    Hashtable *getEquivalents2(Hashtable *fillinResult, const char16_t *segment, int32_t segLen, UErrorCode &status);
     //Hashtable *getEquivalents2(const UnicodeString &segment, int32_t segLen, UErrorCode &status);
 
     /**
@@ -196,7 +196,7 @@ private:
      * If so, take the remainder, and return the equivalents
      */
     //Set extract(int comp, String segment, int segmentPos, StringBuffer buffer);
-    Hashtable *extract(Hashtable *fillinResult, UChar32 comp, const UChar *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status);
+    Hashtable *extract(Hashtable *fillinResult, UChar32 comp, const char16_t *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status);
     //Hashtable *extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status);
 
     void cleanPieces();
index 1050f52d7e83152b4e6eb64d605cc693b5206245..8401867b8abb609700e84320245b4cb7a41dae0f 100644 (file)
@@ -43,7 +43,7 @@ public:
      * @param dest      A buffer for the result string. The result will be NUL-terminated if
      *                  the buffer is large enough.
      *                  The contents is undefined in case of failure.
-     * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
+     * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then
      *                  dest may be NULL and the function will only return the length of the result
      *                  without writing any of the result string.
      * @param edits     Records edits for index mapping, working with styled text,
@@ -77,7 +77,7 @@ public:
      * @param dest      A buffer for the result string. The result will be NUL-terminated if
      *                  the buffer is large enough.
      *                  The contents is undefined in case of failure.
-     * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
+     * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then
      *                  dest may be NULL and the function will only return the length of the result
      *                  without writing any of the result string.
      * @param edits     Records edits for index mapping, working with styled text,
@@ -123,7 +123,7 @@ public:
      * @param dest      A buffer for the result string. The result will be NUL-terminated if
      *                  the buffer is large enough.
      *                  The contents is undefined in case of failure.
-     * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
+     * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then
      *                  dest may be NULL and the function will only return the length of the result
      *                  without writing any of the result string.
      * @param edits     Records edits for index mapping, working with styled text,
@@ -164,7 +164,7 @@ public:
      * @param dest      A buffer for the result string. The result will be NUL-terminated if
      *                  the buffer is large enough.
      *                  The contents is undefined in case of failure.
-     * @param destCapacity The size of the buffer (number of UChars). If it is 0, then
+     * @param destCapacity The size of the buffer (number of char16_ts). If it is 0, then
      *                  dest may be NULL and the function will only return the length of the result
      *                  without writing any of the result string.
      * @param edits     Records edits for index mapping, working with styled text,
index 17ab178e6c20ac0d0e5ee9532421417da9ba0d2e..76f01402e7b31e5ee866f05c3ed43d4a958e5c1c 100644 (file)
@@ -78,7 +78,7 @@ U_NAMESPACE_BEGIN
  * }
  *
  * void function1(ForwardCharacterIterator &it) {
- *     UChar c;
+ *     char16_t c;
  *     while((c=it.nextPostInc())!=ForwardCharacterIterator::DONE) {
  *         // use c
  *      }
@@ -149,7 +149,7 @@ public:
      * @return the current code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         nextPostInc(void) = 0;
+    virtual char16_t         nextPostInc(void) = 0;
     
     /**
      * Gets the current code point for returning and advances to the next code point
@@ -230,7 +230,7 @@ protected:
  * showing a way to convert simple for() loops:
  * \code
  * void forward2(CharacterIterator &it) {
- *     UChar c;
+ *     char16_t c;
  *     for(c=it.firstPostInc(); c!=CharacterIterator::DONE; c=it.nextPostInc()) {
  *          // use c
  *      }
@@ -249,7 +249,7 @@ protected:
  * Backward iteration with a more traditional for() loop:
  * \code
  * void backward2(CharacterIterator &it) {
- *     UChar c;
+ *     char16_t c;
  *     for(c=it.last(); c!=CharacterIterator::DONE; c=it.previous()) {
  *         // use c
  *      }
@@ -266,7 +266,7 @@ protected:
  *      // get the position
  *      int32_t pos=it.getIndex();
  *      // get the previous code unit
- *      UChar u=it.previous();
+ *      char16_t u=it.previous();
  *      // move back one more code unit
  *      it.move(-1, CharacterIterator::kCurrent);
  *      // set the position back to where it was
@@ -283,7 +283,7 @@ protected:
  * Function processing characters, in this example simple output
  * <pre>
  * \code
- *  void processChar( UChar c )
+ *  void processChar( char16_t c )
  *  {
  *      cout << " " << c;
  *  }
@@ -294,7 +294,7 @@ protected:
  * \code
  *  void traverseForward(CharacterIterator& iter)
  *  {
- *      for(UChar c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
+ *      for(char16_t c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
  *          processChar(c);
  *      }
  *  }
@@ -305,7 +305,7 @@ protected:
  * \code
  *  void traverseBackward(CharacterIterator& iter)
  *  {
- *      for(UChar c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) {
+ *      for(char16_t c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) {
  *          processChar(c);
  *      }
  *  }
@@ -317,7 +317,7 @@ protected:
  * \code
  * void traverseOut(CharacterIterator& iter, int32_t pos)
  * {
- *      UChar c;
+ *      char16_t c;
  *      for (c = iter.setIndex(pos);
  *      c != CharacterIterator.DONE && (Unicode::isLetter(c) || Unicode::isDigit(c));
  *          c = iter.next()) {}
@@ -386,7 +386,7 @@ public:
      * @return the first code unit in its iteration range.
      * @stable ICU 2.0
      */
-    virtual UChar         first(void) = 0;
+    virtual char16_t         first(void) = 0;
 
     /**
      * Sets the iterator to refer to the first code unit in its
@@ -396,7 +396,7 @@ public:
      * @return the first code unit in its iteration range.
      * @stable ICU 2.0
      */
-    virtual UChar         firstPostInc(void);
+    virtual char16_t         firstPostInc(void);
 
     /**
      * Sets the iterator to refer to the first code point in its
@@ -435,7 +435,7 @@ public:
      * @return the last code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         last(void) = 0;
+    virtual char16_t         last(void) = 0;
         
     /**
      * Sets the iterator to refer to the last code point in its
@@ -463,7 +463,7 @@ public:
      * @return the "position"-th code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         setIndex(int32_t position) = 0;
+    virtual char16_t         setIndex(int32_t position) = 0;
 
     /**
      * Sets the iterator to refer to the beginning of the code point
@@ -483,7 +483,7 @@ public:
      * @return the current code unit. 
      * @stable ICU 2.0
      */
-    virtual UChar         current(void) const = 0;
+    virtual char16_t         current(void) const = 0;
         
     /**
      * Returns the code point the iterator currently refers to.  
@@ -499,7 +499,7 @@ public:
      * @return the next code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         next(void) = 0;
+    virtual char16_t         next(void) = 0;
         
     /**
      * Advances to the next code point in the iteration range
@@ -520,7 +520,7 @@ public:
      * @return the previous code unit.
      * @stable ICU 2.0
      */
-    virtual UChar         previous(void) = 0;
+    virtual char16_t         previous(void) = 0;
 
     /**
      * Advances to the previous code point in the iteration range
index aa374f83b86695d3bc33eb59d007c0043ee19c0c..3ab820188f7f2387d3e05c09062f9dc469e34f1e 100644 (file)
@@ -174,9 +174,9 @@ private:
  * \code
  * LocalPointer<UnicodeString> s(new UnicodeString((UChar32)0x50005));
  * int32_t length=s->length();  // 2
- * UChar lead=s->charAt(0);  // 0xd900
+ * char16_t lead=s->charAt(0);  // 0xd900
  * if(some condition) { return; }  // no need to explicitly delete the pointer
- * s.adoptInstead(new UnicodeString((UChar)0xfffc));
+ * s.adoptInstead(new UnicodeString((char16_t)0xfffc));
  * length=s->length();  // 1
  * // no need to explicitly delete the pointer
  * \endcode
@@ -323,10 +323,10 @@ public:
  * Usage example:
  * \code
  * LocalArray<UnicodeString> a(new UnicodeString[2]);
- * a[0].append((UChar)0x61);
+ * a[0].append((char16_t)0x61);
  * if(some condition) { return; }  // no need to explicitly delete the array
  * a.adoptInstead(new UnicodeString[4]);
- * a[3].append((UChar)0x62).append((UChar)0x63).reverse();
+ * a[3].append((char16_t)0x62).append((char16_t)0x63).reverse();
  * // no need to explicitly delete the array
  * \endcode
  *
index 8995c8a56d120d659e0a48b6e8524d1696dbe302..d326da948a35736f868fb4abfcfe048b135f2b65 100644 (file)
@@ -282,7 +282,7 @@ public:
      *
      * When used on a standard NFC Normalizer2 instance,
      * 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 char16_ts).
      *
      * This function is independent of the mode of the Normalizer2.
      * The default implementation returns FALSE.
index cf414967afb7ae3289c9320b8db0dff57579daee..41fdc040497bf2cdd40c003e91076f59645073a0 100644 (file)
@@ -93,7 +93,7 @@ public:
      * @return 16-bit code unit of text at given offset
      * @stable ICU 1.8
      */
-    inline UChar charAt(int32_t offset) const;
+    inline char16_t charAt(int32_t offset) const;
 
     /**
      * Returns the 32-bit code point at the given 16-bit offset into
@@ -230,7 +230,7 @@ protected:
      * Virtual version of charAt().
      * @stable ICU 2.4
      */
-    virtual UChar getCharAt(int32_t offset) const = 0;
+    virtual char16_t getCharAt(int32_t offset) const = 0;
 
     /**
      * Virtual version of char32At().
@@ -246,7 +246,7 @@ Replaceable::length() const {
     return getLength();
 }
 
-inline UChar
+inline char16_t
 Replaceable::charAt(int32_t offset) const {
     return getCharAt(offset);
 }
index 355df474178d0f62f47308e91a34f435e8275cf3..b522a7a615422cdc788708bcfffd5495f734503c 100644 (file)
@@ -216,7 +216,7 @@ public:
      *                could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
      *                could be a warning
      *                e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
-     * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
+     * @return a pointer to a zero-terminated char16_t array which lives in a memory mapped/DLL file.
      * @stable ICU 2.0
      */
     UnicodeString
index f9d8117b3ccd2ea675648d5125a86934ce6eeaff..b1dc939bd66f85544f4fde2bcb49665272726b86 100644 (file)
@@ -175,7 +175,7 @@ protected:
    * @param newTextLength The length of the String
    * @stable ICU 2.0
    */
-  void setText(const UChar* newText, int32_t newTextLength);
+  void setText(const char16_t* newText, int32_t newTextLength);
 
   /**
    * Copy of the iterated string object.
index 16c8ad046e8641185b52311090daa0d563133705..d307b4728c037ac2756f7eac75eb50db70103daf 100644 (file)
@@ -57,7 +57,7 @@ public:
      * Default constructor.
      * @draft ICU 57
      */
-    SimpleFormatter() : compiledPattern((UChar)0) {}
+    SimpleFormatter() : compiledPattern((char16_t)0) {}
 
     /**
      * Constructs a formatter from the pattern string.
@@ -275,15 +275,15 @@ private:
      */
     UnicodeString compiledPattern;
 
-    static inline int32_t getArgumentLimit(const UChar *compiledPattern,
+    static inline int32_t getArgumentLimit(const char16_t *compiledPattern,
                                               int32_t compiledPatternLength) {
         return compiledPatternLength == 0 ? 0 : compiledPattern[0];
     }
 
-    static UnicodeString getTextWithNoArguments(const UChar *compiledPattern, int32_t compiledPatternLength);
+    static UnicodeString getTextWithNoArguments(const char16_t *compiledPattern, int32_t compiledPatternLength);
 
     static UnicodeString &format(
-            const UChar *compiledPattern, int32_t compiledPatternLength,
+            const char16_t *compiledPattern, int32_t compiledPatternLength,
             const UnicodeString *const *values,
             UnicodeString &result, const UnicodeString *resultCopy, UBool forbidResultAsValue,
             int32_t *offsets, int32_t offsetsLength,
index 368188a4aa885381f669ee4bad01d165eb13fc3c..61d514813b92c14679a99ce4f7c2c9f89b6f15f7 100644 (file)
@@ -35,7 +35,7 @@ U_NAMESPACE_BEGIN
  * call, so the returned string still might not be 'valid' on
  * subsequent use.</p>
  *
- * <p>Strings may take the form of const char*, const UChar*, or const
+ * <p>Strings may take the form of const char*, const char16_t*, or const
  * UnicodeString*.  The type you get is determine by the variant of
  * 'next' that you call.  In general the StringEnumeration is
  * optimized for one of these types, but all StringEnumerations can
@@ -112,7 +112,7 @@ public:
      * <p>If the iterator is out of sync with its service, status is set
      * to U_ENUM_OUT_OF_SYNC_ERROR and NULL is returned.</p>
      *
-     * <p>If the native service string is a UChar* string, it is
+     * <p>If the native service string is a char16_t* string, it is
      * converted to char* with the invariant converter.  If the
      * conversion fails (because a character cannot be converted) then
      * status is set to U_INVARIANT_CONVERSION_ERROR and the return
@@ -131,7 +131,7 @@ public:
     virtual const char* next(int32_t *resultLength, UErrorCode& status);
 
     /**
-     * <p>Returns the next element as a NUL-terminated UChar*.  If there
+     * <p>Returns the next element as a NUL-terminated char16_t*.  If there
      * are no more elements, returns NULL.  If the resultLength pointer
      * is not NULL, the length of the string (not counting the
      * terminating NUL) is returned at that address.  If an error
@@ -153,7 +153,7 @@ public:
      *
      * @stable ICU 2.4 
      */
-    virtual const UChar* unext(int32_t *resultLength, UErrorCode& status);
+    virtual const char16_t* unext(int32_t *resultLength, UErrorCode& status);
 
     /**
      * <p>Returns the next element a UnicodeString*.  If there are no
index 91f1bd24dab102e90efefbb7b3ef500f52917d80..bcad2484e7ba9944f445703e9530d25a2a9bdfd8 100644 (file)
@@ -105,7 +105,7 @@ protected:
     /** @internal */
     virtual int32_t getElementStringLength(int32_t i) const = 0;
     /** @internal */
-    virtual UChar getElementUnit(int32_t i, int32_t unitIndex) const = 0;
+    virtual char16_t getElementUnit(int32_t i, int32_t unitIndex) const = 0;
     /** @internal */
     virtual int32_t getElementValue(int32_t i) const = 0;
 
@@ -120,7 +120,7 @@ protected:
     /** @internal */
     virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t count) const = 0;
     /** @internal */
-    virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, UChar unit) const = 0;
+    virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, char16_t unit) const = 0;
 
     /** @internal */
     virtual UBool matchNodesCanHaveValues() const = 0;
@@ -137,7 +137,7 @@ protected:
     /** @internal */
     static const int32_t kMaxBranchLinearSubNodeLength=5;
 
-    // Maximum number of nested split-branch levels for a branch on all 2^16 possible UChar units.
+    // Maximum number of nested split-branch levels for a branch on all 2^16 possible char16_t units.
     // log2(2^16/kMaxBranchLinearSubNodeLength) rounded up.
     /** @internal */
     static const int32_t kMaxSplitBranchLevels=14;
@@ -338,7 +338,7 @@ protected:
         virtual void write(StringTrieBuilder &builder);
         // Adds a unit with a final value.
         void add(int32_t c, int32_t value) {
-            units[length]=(UChar)c;
+            units[length]=(char16_t)c;
             equal[length]=NULL;
             values[length]=value;
             ++length;
@@ -346,7 +346,7 @@ protected:
         }
         // Adds a unit which leads to another match node.
         void add(int32_t c, Node *node) {
-            units[length]=(UChar)c;
+            units[length]=(char16_t)c;
             equal[length]=node;
             values[length]=0;
             ++length;
@@ -356,7 +356,7 @@ protected:
         Node *equal[kMaxBranchLinearSubNodeLength];  // NULL means "has final value".
         int32_t length;
         int32_t values[kMaxBranchLinearSubNodeLength];
-        UChar units[kMaxBranchLinearSubNodeLength];
+        char16_t units[kMaxBranchLinearSubNodeLength];
     };
 
     /**
@@ -364,7 +364,7 @@ protected:
      */
     class SplitBranchNode : public BranchNode {
     public:
-        SplitBranchNode(UChar middleUnit, Node *lessThanNode, Node *greaterOrEqualNode)
+        SplitBranchNode(char16_t middleUnit, Node *lessThanNode, Node *greaterOrEqualNode)
                 : BranchNode(((0x555555*37+middleUnit)*37+
                               hashCode(lessThanNode))*37+hashCode(greaterOrEqualNode)),
                   unit(middleUnit), lessThan(lessThanNode), greaterOrEqual(greaterOrEqualNode) {}
@@ -372,7 +372,7 @@ protected:
         virtual int32_t markRightEdgesFirst(int32_t edgeNumber);
         virtual void write(StringTrieBuilder &builder);
     protected:
-        UChar unit;
+        char16_t unit;
         Node *lessThan;
         Node *greaterOrEqual;
     };
index fdff53f4d33bab4c0574c93d1cc86dd095749d8b..dfc93f6d0bae8acf02463b99044e8dea72e939bb 100644 (file)
@@ -36,7 +36,7 @@ class UVector32;
 
 /**
  * Light-weight, non-const reader class for a UCharsTrie.
- * Traverses a UChar-serialized data structure with minimal state,
+ * Traverses a char16_t-serialized data structure with minimal state,
  * for mapping strings (16-bit-unit sequences) to non-negative integer values.
  *
  * This class owns the serialized trie data only if it was constructed by
@@ -52,15 +52,15 @@ public:
     /**
      * Constructs a UCharsTrie reader instance.
      *
-     * The trieUChars must contain a copy of a UChar sequence from the UCharsTrieBuilder,
-     * starting with the first UChar of that sequence.
-     * The UCharsTrie object will not read more UChars than
+     * The trieUChars must contain a copy of a char16_t sequence from the UCharsTrieBuilder,
+     * starting with the first char16_t of that sequence.
+     * The UCharsTrie object will not read more char16_ts than
      * the UCharsTrieBuilder generated in the corresponding build() call.
      *
      * The array is not copied/cloned and must not be modified while
      * the UCharsTrie object is in use.
      *
-     * @param trieUChars The UChar array that contains the serialized trie.
+     * @param trieUChars The char16_t array that contains the serialized trie.
      * @stable ICU 4.8
      */
     UCharsTrie(ConstChar16Ptr trieUChars)
@@ -75,7 +75,7 @@ public:
 
     /**
      * Copy constructor, copies the other trie reader object and its state,
-     * but not the UChar array which will be shared. (Shallow copy.)
+     * but not the char16_t array which will be shared. (Shallow copy.)
      * @param other Another UCharsTrie object.
      * @stable ICU 4.8
      */
@@ -109,8 +109,8 @@ public:
     private:
         friend class UCharsTrie;
 
-        const UChar *uchars;
-        const UChar *pos;
+        const char16_t *uchars;
+        const char16_t *pos;
         int32_t remainingMatchLength;
     };
 
@@ -148,14 +148,14 @@ public:
 
     /**
      * Determines whether the string so far matches, whether it has a value,
-     * and whether another input UChar can continue a matching string.
+     * and whether another input char16_t can continue a matching string.
      * @return The match/value Result.
      * @stable ICU 4.8
      */
     UStringTrieResult current() const;
 
     /**
-     * Traverses the trie from the initial state for this input UChar.
+     * Traverses the trie from the initial state for this input char16_t.
      * Equivalent to reset().next(uchar).
      * @param uchar Input char value. Values below 0 and above 0xffff will never match.
      * @return The match/value Result.
@@ -177,7 +177,7 @@ public:
     UStringTrieResult firstForCodePoint(UChar32 cp);
 
     /**
-     * Traverses the trie from the current state for this input UChar.
+     * Traverses the trie from the current state for this input char16_t.
      * @param uchar Input char value. Values below 0 and above 0xffff will never match.
      * @return The match/value Result.
      * @stable ICU 4.8
@@ -220,7 +220,7 @@ public:
      * @stable ICU 4.8
      */
     inline int32_t getValue() const {
-        const UChar *pos=pos_;
+        const char16_t *pos=pos_;
         int32_t leadUnit=*pos++;
         // U_ASSERT(leadUnit>=kMinValueLead);
         return leadUnit&kValueIsFinal ?
@@ -237,16 +237,16 @@ public:
      * @stable ICU 4.8
      */
     inline UBool hasUniqueValue(int32_t &uniqueValue) const {
-        const UChar *pos=pos_;
+        const char16_t *pos=pos_;
         // Skip the rest of a pending linear-match node.
         return pos!=NULL && findUniqueValue(pos+remainingMatchLength_+1, FALSE, uniqueValue);
     }
 
     /**
-     * Finds each UChar which continues the string from the current state.
-     * That is, each UChar c for which it would be next(c)!=USTRINGTRIE_NO_MATCH now.
-     * @param out Each next UChar is appended to this object.
-     * @return the number of UChars which continue the string from here
+     * Finds each char16_t which continues the string from the current state.
+     * That is, each char16_t c for which it would be next(c)!=USTRINGTRIE_NO_MATCH now.
+     * @param out Each next char16_t is appended to this object.
+     * @return the number of char16_ts which continue the string from here
      * @stable ICU 4.8
      */
     int32_t getNextUChars(Appendable &out) const;
@@ -258,8 +258,8 @@ public:
     class U_COMMON_API Iterator : public UMemory {
     public:
         /**
-         * Iterates from the root of a UChar-serialized UCharsTrie.
-         * @param trieUChars The trie UChars.
+         * Iterates from the root of a char16_t-serialized UCharsTrie.
+         * @param trieUChars The trie char16_ts.
          * @param maxStringLength If 0, the iterator returns full strings.
          *                        Otherwise, the iterator returns strings with this maximum length.
          * @param errorCode Standard ICU error code. Its input value must
@@ -336,11 +336,11 @@ public:
             return TRUE;
         }
 
-        const UChar *branchNext(const UChar *pos, int32_t length, UErrorCode &errorCode);
+        const char16_t *branchNext(const char16_t *pos, int32_t length, UErrorCode &errorCode);
 
-        const UChar *uchars_;
-        const UChar *pos_;
-        const UChar *initialPos_;
+        const char16_t *uchars_;
+        const char16_t *pos_;
+        const char16_t *initialPos_;
         int32_t remainingMatchLength_;
         int32_t initialRemainingMatchLength_;
         UBool skipValue_;  // Skip intermediate value which was already delivered.
@@ -368,7 +368,7 @@ private:
      * this constructor adopts the builder's array.
      * This constructor is only called by the builder.
      */
-    UCharsTrie(UChar *adoptUChars, const UChar *trieUChars)
+    UCharsTrie(char16_t *adoptUChars, const char16_t *trieUChars)
             : ownedArray_(adoptUChars), uchars_(trieUChars),
               pos_(uchars_), remainingMatchLength_(-1) {}
 
@@ -381,7 +381,7 @@ private:
 
     // Reads a compact 32-bit integer.
     // pos is already after the leadUnit, and the lead unit has bit 15 reset.
-    static inline int32_t readValue(const UChar *pos, int32_t leadUnit) {
+    static inline int32_t readValue(const char16_t *pos, int32_t leadUnit) {
         int32_t value;
         if(leadUnit<kMinTwoUnitValueLead) {
             value=leadUnit;
@@ -392,7 +392,7 @@ private:
         }
         return value;
     }
-    static inline const UChar *skipValue(const UChar *pos, int32_t leadUnit) {
+    static inline const char16_t *skipValue(const char16_t *pos, int32_t leadUnit) {
         if(leadUnit>=kMinTwoUnitValueLead) {
             if(leadUnit<kThreeUnitValueLead) {
                 ++pos;
@@ -402,12 +402,12 @@ private:
         }
         return pos;
     }
-    static inline const UChar *skipValue(const UChar *pos) {
+    static inline const char16_t *skipValue(const char16_t *pos) {
         int32_t leadUnit=*pos++;
         return skipValue(pos, leadUnit&0x7fff);
     }
 
-    static inline int32_t readNodeValue(const UChar *pos, int32_t leadUnit) {
+    static inline int32_t readNodeValue(const char16_t *pos, int32_t leadUnit) {
         // U_ASSERT(kMinValueLead<=leadUnit && leadUnit<kValueIsFinal);
         int32_t value;
         if(leadUnit<kMinTwoUnitNodeValueLead) {
@@ -419,7 +419,7 @@ private:
         }
         return value;
     }
-    static inline const UChar *skipNodeValue(const UChar *pos, int32_t leadUnit) {
+    static inline const char16_t *skipNodeValue(const char16_t *pos, int32_t leadUnit) {
         // U_ASSERT(kMinValueLead<=leadUnit && leadUnit<kValueIsFinal);
         if(leadUnit>=kMinTwoUnitNodeValueLead) {
             if(leadUnit<kThreeUnitNodeValueLead) {
@@ -431,7 +431,7 @@ private:
         return pos;
     }
 
-    static inline const UChar *jumpByDelta(const UChar *pos) {
+    static inline const char16_t *jumpByDelta(const char16_t *pos) {
         int32_t delta=*pos++;
         if(delta>=kMinTwoUnitDeltaLead) {
             if(delta==kThreeUnitDeltaLead) {
@@ -444,7 +444,7 @@ private:
         return pos+delta;
     }
 
-    static const UChar *skipDelta(const UChar *pos) {
+    static const char16_t *skipDelta(const char16_t *pos) {
         int32_t delta=*pos++;
         if(delta>=kMinTwoUnitDeltaLead) {
             if(delta==kThreeUnitDeltaLead) {
@@ -461,28 +461,28 @@ private:
     }
 
     // Handles a branch node for both next(uchar) and next(string).
-    UStringTrieResult branchNext(const UChar *pos, int32_t length, int32_t uchar);
+    UStringTrieResult branchNext(const char16_t *pos, int32_t length, int32_t uchar);
 
     // Requires remainingLength_<0.
-    UStringTrieResult nextImpl(const UChar *pos, int32_t uchar);
+    UStringTrieResult nextImpl(const char16_t *pos, int32_t uchar);
 
     // Helper functions for hasUniqueValue().
     // Recursively finds a unique value (or whether there is not a unique one)
     // from a branch.
-    static const UChar *findUniqueValueFromBranch(const UChar *pos, int32_t length,
+    static const char16_t *findUniqueValueFromBranch(const char16_t *pos, int32_t length,
                                                   UBool haveUniqueValue, int32_t &uniqueValue);
     // Recursively finds a unique value (or whether there is not a unique one)
     // starting from a position on a node lead unit.
-    static UBool findUniqueValue(const UChar *pos, UBool haveUniqueValue, int32_t &uniqueValue);
+    static UBool findUniqueValue(const char16_t *pos, UBool haveUniqueValue, int32_t &uniqueValue);
 
     // Helper functions for getNextUChars().
     // getNextUChars() when pos is on a branch node.
-    static void getNextBranchUChars(const UChar *pos, int32_t length, Appendable &out);
+    static void getNextBranchUChars(const char16_t *pos, int32_t length, Appendable &out);
 
     // UCharsTrie data structure
     //
-    // The trie consists of a series of UChar-serialized nodes for incremental
-    // Unicode string/UChar sequence matching. (UChar=16-bit unsigned integer)
+    // The trie consists of a series of char16_t-serialized nodes for incremental
+    // Unicode string/char16_t sequence matching. (char16_t=16-bit unsigned integer)
     // The root node is at the beginning of the trie data.
     //
     // Types of nodes are distinguished by their node lead unit ranges.
@@ -491,9 +491,9 @@ private:
     //
     // Node types:
     //  - Final-value node: Stores a 32-bit integer in a compact, variable-length format.
-    //    The value is for the string/UChar sequence so far.
+    //    The value is for the string/char16_t sequence so far.
     //  - Match node, optionally with an intermediate value in a different compact format.
-    //    The value, if present, is for the string/UChar sequence so far.
+    //    The value, if present, is for the string/char16_t sequence so far.
     //
     //  Aside from the value, which uses the node lead unit's high bits:
     //
@@ -560,15 +560,15 @@ private:
 
     static const int32_t kMaxTwoUnitDelta=((kThreeUnitDeltaLead-kMinTwoUnitDeltaLead)<<16)-1;  // 0x03feffff
 
-    UChar *ownedArray_;
+    char16_t *ownedArray_;
 
     // Fixed value referencing the UCharsTrie words.
-    const UChar *uchars_;
+    const char16_t *uchars_;
 
     // Iterator variables.
 
     // Pointer to next trie unit to read. NULL if no more matches.
-    const UChar *pos_;
+    const char16_t *pos_;
     // Remaining length of a linear-match node, minus 1. Negative if not in such a node.
     int32_t remainingMatchLength_;
 };
index a8b75697de7efeda0b30c768be33e3356e2ab812..2aa4757e52cb07c7e1c27902d883a357b66d3166 100644 (file)
@@ -89,21 +89,21 @@ public:
     UCharsTrie *build(UStringTrieBuildOption buildOption, UErrorCode &errorCode);
 
     /**
-     * Builds a UCharsTrie for the add()ed data and UChar-serializes it.
+     * Builds a UCharsTrie for the add()ed data and char16_t-serializes it.
      * Once built, no further data can be add()ed until clear() is called.
      *
      * A UCharsTrie cannot be empty. At least one (string, value) pair
      * must have been add()ed.
      *
      * Multiple calls to buildUnicodeString() set the UnicodeStrings to the
-     * builder's same UChar array, without rebuilding.
+     * builder's same char16_t array, without rebuilding.
      * If buildUnicodeString() is called after build(), the trie will be
      * re-serialized into a new array.
      * If build() is called after buildUnicodeString(), the trie object will become
      * the owner of the previously returned array.
      * After clear() has been called, a new array will be used as well.
      * @param buildOption Build option, see UStringTrieBuildOption.
-     * @param result A UnicodeString which will be set to the UChar-serialized
+     * @param result A UnicodeString which will be set to the char16_t-serialized
      *               UCharsTrie for the add()ed data.
      * @param errorCode Standard ICU error code. Its input value must
      *                  pass the U_SUCCESS() test, or else the function returns
@@ -135,14 +135,14 @@ private:
     void buildUChars(UStringTrieBuildOption buildOption, UErrorCode &errorCode);
 
     virtual int32_t getElementStringLength(int32_t i) const;
-    virtual UChar getElementUnit(int32_t i, int32_t unitIndex) const;
+    virtual char16_t getElementUnit(int32_t i, int32_t unitIndex) const;
     virtual int32_t getElementValue(int32_t i) const;
 
     virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t unitIndex) const;
 
     virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t unitIndex) const;
     virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t count) const;
-    virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, UChar unit) const;
+    virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, char16_t unit) const;
 
     virtual UBool matchNodesCanHaveValues() const { return TRUE; }
 
@@ -152,11 +152,11 @@ private:
 
     class UCTLinearMatchNode : public LinearMatchNode {
     public:
-        UCTLinearMatchNode(const UChar *units, int32_t len, Node *nextNode);
+        UCTLinearMatchNode(const char16_t *units, int32_t len, Node *nextNode);
         virtual UBool operator==(const Node &other) const;
         virtual void write(StringTrieBuilder &builder);
     private:
-        const UChar *s;
+        const char16_t *s;
     };
 
     virtual Node *createLinearMatchNode(int32_t i, int32_t unitIndex, int32_t length,
@@ -164,7 +164,7 @@ private:
 
     UBool ensureCapacity(int32_t length);
     virtual int32_t write(int32_t unit);
-    int32_t write(const UChar *s, int32_t length);
+    int32_t write(const char16_t *s, int32_t length);
     virtual int32_t writeElementUnits(int32_t i, int32_t unitIndex, int32_t length);
     virtual int32_t writeValueAndFinal(int32_t i, UBool isFinal);
     virtual int32_t writeValueAndType(UBool hasValue, int32_t value, int32_t node);
@@ -175,9 +175,9 @@ private:
     int32_t elementsCapacity;
     int32_t elementsLength;
 
-    // UChar serialization of the trie.
+    // char16_t serialization of the trie.
     // Grows from the back: ucharsLength measures from the end of the buffer!
-    UChar *uchars;
+    char16_t *uchars;
     int32_t ucharsCapacity;
     int32_t ucharsLength;
 };
index 644fbd8a2a9151fcce894db3a054d92f3e71a803..21c9315414132a0593e2ba5827ab98c7e4b401e6 100644 (file)
 
 /**
  * \file 
- * \brief C++ API: UChar Character Iterator
+ * \brief C++ API: char16_t Character Iterator
  */
  
 U_NAMESPACE_BEGIN
 
 /**
  * A concrete subclass of CharacterIterator that iterates over the
- * characters (code units or code points) in a UChar array.
+ * characters (code units or code points) in a char16_t array.
  * It's possible not only to create an
- * iterator that iterates over an entire UChar array, but also to
- * create one that iterates over only a subrange of a UChar array
- * (iterators over different subranges of the same UChar array don't
+ * iterator that iterates over an entire char16_t array, but also to
+ * create one that iterates over only a subrange of a char16_t array
+ * (iterators over different subranges of the same char16_t array don't
  * compare equal).
  * @see CharacterIterator
  * @see ForwardCharacterIterator
@@ -35,26 +35,26 @@ U_NAMESPACE_BEGIN
 class U_COMMON_API UCharCharacterIterator : public CharacterIterator {
 public:
   /**
-   * Create an iterator over the UChar array referred to by "textPtr".
+   * Create an iterator over the char16_t array referred to by "textPtr".
    * The iteration range is 0 to <code>length-1</code>.
    * text is only aliased, not adopted (the
    * destructor will not delete it).
-   * @param textPtr The UChar array to be iterated over
-   * @param length The length of the UChar array
+   * @param textPtr The char16_t array to be iterated over
+   * @param length The length of the char16_t array
    * @stable ICU 2.0
    */
   UCharCharacterIterator(ConstChar16Ptr textPtr, int32_t length);
 
   /**
-   * Create an iterator over the UChar array referred to by "textPtr".
+   * Create an iterator over the char16_t array referred to by "textPtr".
    * The iteration range is 0 to <code>length-1</code>.
    * text is only aliased, not adopted (the
    * destructor will not delete it).
    * The starting
    * position is specified by "position". If "position" is outside the valid
    * iteration range, the behavior of this object is undefined.
-   * @param textPtr The UChar array to be iteratd over
-   * @param length The length of the UChar array
+   * @param textPtr The char16_t array to be iteratd over
+   * @param length The length of the char16_t array
    * @param position The starting position of the iteration
    * @stable ICU 2.0
    */
@@ -62,7 +62,7 @@ public:
                          int32_t position);
 
   /**
-   * Create an iterator over the UChar array referred to by "textPtr".
+   * Create an iterator over the char16_t array referred to by "textPtr".
    * The iteration range is 0 to <code>end-1</code>.
    * text is only aliased, not adopted (the
    * destructor will not delete it).
@@ -70,8 +70,8 @@ public:
    * position is specified by "position". If begin and end do not
    * form a valid iteration range or "position" is outside the valid
    * iteration range, the behavior of this object is undefined.
-   * @param textPtr The UChar array to be iterated over
-   * @param length The length of the UChar array
+   * @param textPtr The char16_t array to be iterated over
+   * @param length The length of the char16_t array
    * @param textBegin  The begin position of the iteration range
    * @param textEnd    The end position of the iteration range
    * @param position    The starting position of the iteration
@@ -141,7 +141,7 @@ public:
    * @return the first code unit in its iteration range.
    * @stable ICU 2.0
    */
-  virtual UChar         first(void);
+  virtual char16_t         first(void);
 
   /**
    * Sets the iterator to refer to the first code unit in its
@@ -151,7 +151,7 @@ public:
    * @return the first code unit in its iteration range
    * @stable ICU 2.0
    */
-  virtual UChar         firstPostInc(void);
+  virtual char16_t         firstPostInc(void);
 
   /**
    * Sets the iterator to refer to the first code point in its
@@ -181,7 +181,7 @@ public:
    * @return the last code unit in its iteration range.
    * @stable ICU 2.0
    */
-  virtual UChar         last(void);
+  virtual char16_t         last(void);
 
   /**
    * Sets the iterator to refer to the last code point in its
@@ -200,7 +200,7 @@ public:
    * @return the code unit
    * @stable ICU 2.0
    */
-  virtual UChar         setIndex(int32_t position);
+  virtual char16_t         setIndex(int32_t position);
 
   /**
    * Sets the iterator to refer to the beginning of the code point
@@ -220,7 +220,7 @@ public:
    * @return the code unit the iterator currently refers to.
    * @stable ICU 2.0
    */
-  virtual UChar         current(void) const;
+  virtual char16_t         current(void) const;
 
   /**
    * Returns the code point the iterator currently refers to.
@@ -236,7 +236,7 @@ public:
    * @return the next code unit in the iteration range.
    * @stable ICU 2.0
    */
-  virtual UChar         next(void);
+  virtual char16_t         next(void);
 
   /**
    * Gets the current code unit for returning and advances to the next code unit
@@ -246,7 +246,7 @@ public:
    * @return the current code unit.
    * @stable ICU 2.0
    */
-  virtual UChar         nextPostInc(void);
+  virtual char16_t         nextPostInc(void);
 
   /**
    * Advances to the next code point in the iteration range (toward
@@ -288,7 +288,7 @@ public:
    * @return the previous code unit in the iteration range.
    * @stable ICU 2.0
    */
-  virtual UChar         previous(void);
+  virtual char16_t         previous(void);
 
   /**
    * Advances to the previous code point in the iteration range (toward
@@ -343,7 +343,7 @@ public:
   void setText(ConstChar16Ptr newText, int32_t newTextLength);
 
   /**
-   * Copies the UChar array under iteration into the UnicodeString
+   * Copies the char16_t array under iteration into the UnicodeString
    * referred to by "result".  Even if this iterator iterates across
    * only a part of this string, the whole string is copied.
    * @param result Receives a copy of the text under iteration.
@@ -375,7 +375,7 @@ protected:
    * Protected member text
    * @stable ICU 2.0
    */
-  const UChar*            text;
+  const char16_t*            text;
 
 };
 
index a23d871a151e3eed893e267b6f26a84b32af38c5..e10527154b6de13e65de39f4195547a219fc93a7 100644 (file)
@@ -30,7 +30,7 @@ U_NAMESPACE_BEGIN
  * defined range.
  * @stable ICU 3.0
  */
-#define U_ETHER ((UChar)0xFFFF)
+#define U_ETHER ((char16_t)0xFFFF)
 
 /**
  *
index 133c2cf7f8daaedfae443b5b15af18aa81218e3b..4a4ce193b6471982f37df2fb5c4f72d335086faa 100644 (file)
@@ -294,7 +294,7 @@ class U_COMMON_API UnicodeSet U_FINAL : public UnicodeFilter {
      * indicating that toPattern() must generate a pattern
      * representation from the inversion list.
      */
-    UChar *pat;
+    char16_t *pat;
     UVector* strings; // maintained in sorted order
     UnicodeSetStringSpan *stringSpan;
 
@@ -891,7 +891,7 @@ public:
      * @stable ICU 3.8
      * @see USetSpanCondition
      */
-    int32_t span(const UChar *s, int32_t length, USetSpanCondition spanCondition) const;
+    int32_t span(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const;
 
     /**
      * Returns the end of the substring of the input string according to the USetSpanCondition.
@@ -924,7 +924,7 @@ public:
      * @stable ICU 3.8
      * @see USetSpanCondition
      */
-    int32_t spanBack(const UChar *s, int32_t length, USetSpanCondition spanCondition) const;
+    int32_t spanBack(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const;
 
     /**
      * Returns the start of the substring of the input string according to the USetSpanCondition.
index 0d1bbb6f49e2eeed05a1982c10bc44a7625152cc..4f1f824e9cbb8153fdecfc43f2ac6429112fce00 100644 (file)
@@ -77,8 +77,8 @@ UStringCaseMapper(int32_t caseLocale, uint32_t options,
 #if !UCONFIG_NO_BREAK_ITERATION
                   icu::BreakIterator *iter,
 #endif
-                  UChar *dest, int32_t destCapacity,
-                  const UChar *src, int32_t srcLength,
+                  char16_t *dest, int32_t destCapacity,
+                  const char16_t *src, int32_t srcLength,
                   icu::Edits *edits,
                   UErrorCode &errorCode);
 
@@ -139,7 +139,7 @@ class UnicodeStringAppendable;  // unicode/appendable.h
 /**
  * \def UNISTR_FROM_CHAR_EXPLICIT
  * This can be defined to be empty or "explicit".
- * If explicit, then the UnicodeString(UChar) and UnicodeString(UChar32)
+ * If explicit, then the UnicodeString(char16_t) and UnicodeString(UChar32)
  * constructors are marked as explicit, preventing their inadvertent use.
  * @stable ICU 49
  */
@@ -156,7 +156,7 @@ class UnicodeStringAppendable;  // unicode/appendable.h
 /**
  * \def UNISTR_FROM_STRING_EXPLICIT
  * This can be defined to be empty or "explicit".
- * If explicit, then the UnicodeString(const char *) and UnicodeString(const UChar *)
+ * If explicit, then the UnicodeString(const char *) and UnicodeString(const char16_t *)
  * constructors are marked as explicit, preventing their inadvertent use.
  *
  * In particular, this helps prevent accidentally depending on ICU conversion code
@@ -190,18 +190,18 @@ class UnicodeStringAppendable;  // unicode/appendable.h
  * to 4 * sizeof(pointer) (or 3 * sizeof(pointer) for P128 data models),
  * to hold the fields for heap-allocated strings.
  * Such a minimum size also ensures that the object is easily large enough
- * to hold at least 2 UChars, for one supplementary code point (U16_MAX_LENGTH).
+ * to hold at least 2 char16_ts, for one supplementary code point (U16_MAX_LENGTH).
  *
  * sizeof(UnicodeString) >= 48 should work for all known platforms.
  *
  * For example, on a 64-bit machine where sizeof(vtable pointer) is 8,
  * sizeof(UnicodeString) = 64 would leave space for
  * (64 - sizeof(vtable pointer) - 2) / U_SIZEOF_UCHAR = (64 - 8 - 2) / 2 = 27
- * UChars stored inside the object.
+ * char16_ts stored inside the object.
  *
  * The minimum object size on a 64-bit machine would be
  * 4 * sizeof(pointer) = 4 * 8 = 32 bytes,
- * and the internal buffer would hold up to 11 UChars in that case.
+ * and the internal buffer would hold up to 11 char16_ts in that case.
  *
  * @see U16_MAX_LENGTH
  * @stable ICU 56
@@ -233,7 +233,7 @@ class UnicodeStringAppendable;  // unicode/appendable.h
  * <p>In ICU, a Unicode string consists of 16-bit Unicode <em>code units</em>.
  * A Unicode character may be stored with either one code unit
  * (the most common case) or with a matched pair of special code units
- * ("surrogates"). The data type for code units is UChar.
+ * ("surrogates"). The data type for code units is char16_t.
  * For single-character handling, a Unicode character code <em>point</em> is a value
  * in the range 0..0x10ffff. ICU uses the UChar32 type for code points.</p>
  *
@@ -249,7 +249,7 @@ class UnicodeStringAppendable;  // unicode/appendable.h
  * than other ICU APIs. In particular:
  * - If indexes are out of bounds for a UnicodeString object
  *   (<0 or >length()) then they are "pinned" to the nearest boundary.
- * - If primitive string pointer values (e.g., const UChar * or char *)
+ * - If primitive string pointer values (e.g., const char16_t * or char *)
  *   for input strings are NULL, then those input string parameters are treated
  *   as if they pointed to an empty string.
  *   However, this is <em>not</em> the case for char * parameters for charset names
@@ -455,7 +455,7 @@ public:
    */
   inline int8_t compare(int32_t start,
          int32_t length,
-         const UChar *srcChars) const;
+         const char16_t *srcChars) const;
 
   /**
    * Compare the characters bitwise in the range
@@ -476,7 +476,7 @@ public:
    */
   inline int8_t compare(int32_t start,
          int32_t length,
-         const UChar *srcChars,
+         const char16_t *srcChars,
          int32_t srcStart,
          int32_t srcLength) const;
 
@@ -614,7 +614,7 @@ public:
    */
   inline int8_t compareCodePointOrder(int32_t start,
                                       int32_t length,
-                                      const UChar *srcChars) const;
+                                      const char16_t *srcChars) const;
 
   /**
    * Compare two Unicode strings in code point order.
@@ -639,7 +639,7 @@ public:
    */
   inline int8_t compareCodePointOrder(int32_t start,
                                       int32_t length,
-                                      const UChar *srcChars,
+                                      const char16_t *srcChars,
                                       int32_t srcStart,
                                       int32_t srcLength) const;
 
@@ -789,7 +789,7 @@ public:
    */
   inline int8_t caseCompare(int32_t start,
          int32_t length,
-         const UChar *srcChars,
+         const char16_t *srcChars,
          uint32_t options) const;
 
   /**
@@ -816,7 +816,7 @@ public:
    */
   inline int8_t caseCompare(int32_t start,
          int32_t length,
-         const UChar *srcChars,
+         const char16_t *srcChars,
          int32_t srcStart,
          int32_t srcLength,
          uint32_t options) const;
@@ -893,7 +893,7 @@ public:
    * @return TRUE if this ends with the characters in <TT>srcChars</TT>, FALSE otherwise
    * @stable ICU 2.0
    */
-  inline UBool startsWith(const UChar *srcChars,
+  inline UBool startsWith(const char16_t *srcChars,
             int32_t srcStart,
             int32_t srcLength) const;
 
@@ -941,7 +941,7 @@ public:
    * FALSE otherwise
    * @stable ICU 2.0
    */
-  inline UBool endsWith(const UChar *srcChars,
+  inline UBool endsWith(const char16_t *srcChars,
           int32_t srcStart,
           int32_t srcLength) const;
 
@@ -1018,7 +1018,7 @@ public:
    * or -1 if not found.
    * @stable ICU 2.0
    */
-  inline int32_t indexOf(const UChar *srcChars,
+  inline int32_t indexOf(const char16_t *srcChars,
               int32_t srcLength,
               int32_t start) const;
 
@@ -1055,7 +1055,7 @@ public:
    * or -1 if not found.
    * @stable ICU 2.0
    */
-  int32_t indexOf(const UChar *srcChars,
+  int32_t indexOf(const char16_t *srcChars,
               int32_t srcStart,
               int32_t srcLength,
               int32_t start,
@@ -1068,7 +1068,7 @@ public:
    * @return The offset into this of <TT>c</TT>, or -1 if not found.
    * @stable ICU 2.0
    */
-  inline int32_t indexOf(UChar c) const;
+  inline int32_t indexOf(char16_t c) const;
 
   /**
    * Locate in this the first occurrence of the code point <TT>c</TT>,
@@ -1088,7 +1088,7 @@ public:
    * @return The offset into this of <TT>c</TT>, or -1 if not found.
    * @stable ICU 2.0
    */
-  inline int32_t indexOf(UChar c,
+  inline int32_t indexOf(char16_t c,
               int32_t start) const;
 
   /**
@@ -1113,7 +1113,7 @@ public:
    * @return The offset into this of <TT>c</TT>, or -1 if not found.
    * @stable ICU 2.0
    */
-  inline int32_t indexOf(UChar c,
+  inline int32_t indexOf(char16_t c,
               int32_t start,
               int32_t length) const;
 
@@ -1201,7 +1201,7 @@ public:
    * or -1 if not found.
    * @stable ICU 2.0
    */
-  inline int32_t lastIndexOf(const UChar *srcChars,
+  inline int32_t lastIndexOf(const char16_t *srcChars,
               int32_t srcLength,
               int32_t start) const;
 
@@ -1238,7 +1238,7 @@ public:
    * or -1 if not found.
    * @stable ICU 2.0
    */
-  int32_t lastIndexOf(const UChar *srcChars,
+  int32_t lastIndexOf(const char16_t *srcChars,
               int32_t srcStart,
               int32_t srcLength,
               int32_t start,
@@ -1251,7 +1251,7 @@ public:
    * @return The offset into this of <TT>c</TT>, or -1 if not found.
    * @stable ICU 2.0
    */
-  inline int32_t lastIndexOf(UChar c) const;
+  inline int32_t lastIndexOf(char16_t c) const;
 
   /**
    * Locate in this the last occurrence of the code point <TT>c</TT>,
@@ -1271,7 +1271,7 @@ public:
    * @return The offset into this of <TT>c</TT>, or -1 if not found.
    * @stable ICU 2.0
    */
-  inline int32_t lastIndexOf(UChar c,
+  inline int32_t lastIndexOf(char16_t c,
               int32_t start) const;
 
   /**
@@ -1296,7 +1296,7 @@ public:
    * @return The offset into this of <TT>c</TT>, or -1 if not found.
    * @stable ICU 2.0
    */
-  inline int32_t lastIndexOf(UChar c,
+  inline int32_t lastIndexOf(char16_t c,
               int32_t start,
               int32_t length) const;
 
@@ -1326,7 +1326,7 @@ public:
    *         or 0xffff if the offset is not valid for this string
    * @stable ICU 2.0
    */
-  inline UChar charAt(int32_t offset) const;
+  inline char16_t charAt(int32_t offset) const;
 
   /**
    * Return the code unit at offset <tt>offset</tt>.
@@ -1335,7 +1335,7 @@ public:
    * @return the code unit at offset <tt>offset</tt>
    * @stable ICU 2.0
    */
-  inline UChar operator[] (int32_t offset) const;
+  inline char16_t operator[] (int32_t offset) const;
 
   /**
    * Return the code point that contains the code unit
@@ -1475,7 +1475,7 @@ public:
    * then extract() will not copy the contents.
    *
    * @param dest Destination string buffer.
-   * @param destCapacity Number of UChars available at dest.
+   * @param destCapacity Number of char16_ts available at dest.
    * @param errorCode ICU error code.
    * @return length()
    * @stable ICU 2.0
@@ -1511,7 +1511,7 @@ public:
    */
   inline void extractBetween(int32_t start,
               int32_t limit,
-              UChar *dst,
+              char16_t *dst,
               int32_t dstStart = 0) const;
 
   /**
@@ -1756,7 +1756,7 @@ public:
 
   /**
    * Return the length of the UnicodeString object.
-   * The length is the number of UChar code units are in the UnicodeString.
+   * The length is the number of char16_t code units are in the UnicodeString.
    * If you want the number of code points, please use countChar32().
    * @return the length of the UnicodeString object
    * @see countChar32
@@ -1765,14 +1765,14 @@ public:
   inline int32_t length(void) const;
 
   /**
-   * Count Unicode code points in the length UChar code units of the string.
-   * A code point may occupy either one or two UChar code units.
+   * Count Unicode code points in the length char16_t code units of the string.
+   * A code point may occupy either one or two char16_t code units.
    * Counting code points involves reading all code units.
    *
    * This functions is basically the inverse of moveIndex32().
    *
    * @param start the index of the first code unit to check
-   * @param length the number of UChar code units to check
+   * @param length the number of char16_t code units to check
    * @return the number of code points in the specified code units
    * @see length
    * @stable ICU 2.0
@@ -1781,7 +1781,7 @@ public:
   countChar32(int32_t start=0, int32_t length=INT32_MAX) const;
 
   /**
-   * Check if the length UChar code units of the string
+   * Check if the length char16_t code units of the string
    * contain more Unicode code points than a certain number.
    * This is more efficient than counting all code points in this part of the string
    * and comparing that number with a threshold.
@@ -1789,10 +1789,10 @@ public:
    * falls within a certain range, and
    * never needs to count more than 'number+1' code points.
    * Logically equivalent to (countChar32(start, length)>number).
-   * A Unicode code point may occupy either one or two UChar code units.
+   * A Unicode code point may occupy either one or two char16_t code units.
    *
    * @param start the index of the first code unit to check (0 for the entire string)
-   * @param length the number of UChar code units to check
+   * @param length the number of char16_t code units to check
    *               (use INT32_MAX for the entire string; remember that start/length
    *                values are pinned)
    * @param number The number of code points in the (sub)string is compared against
@@ -1818,7 +1818,7 @@ public:
    * This is useful together with the getBuffer functions.
    * See there for details.
    *
-   * @return the number of UChars available in the internal buffer
+   * @return the number of char16_ts available in the internal buffer
    * @see getBuffer
    * @stable ICU 2.0
    */
@@ -1952,7 +1952,7 @@ public:
    * @return a reference to this
    * @stable ICU 2.0
    */
-  inline UnicodeString& operator= (UChar ch);
+  inline UnicodeString& operator= (char16_t ch);
 
   /**
    * Assignment operator.  Replace the characters in this UnicodeString
@@ -2012,7 +2012,7 @@ public:
    * @return a reference to this
    * @stable ICU 2.0
    */
-  inline UnicodeString& setTo(const UChar *srcChars,
+  inline UnicodeString& setTo(const char16_t *srcChars,
                int32_t srcLength);
 
   /**
@@ -2023,7 +2023,7 @@ public:
    * @return a reference to this
    * @stable ICU 2.0
    */
-  UnicodeString& setTo(UChar srcChar);
+  UnicodeString& setTo(char16_t srcChar);
 
   /**
    * Set the characters in the UnicodeString object to the code point
@@ -2036,7 +2036,7 @@ public:
   UnicodeString& setTo(UChar32 srcChar);
 
   /**
-   * Aliasing setTo() function, analogous to the readonly-aliasing UChar* constructor.
+   * Aliasing setTo() function, analogous to the readonly-aliasing char16_t* constructor.
    * The text will be used for the UnicodeString object, but
    * it will not be released when the UnicodeString is destroyed.
    * This has copy-on-write semantics:
@@ -2059,11 +2059,11 @@ public:
    * @stable ICU 2.0
    */
   UnicodeString &setTo(UBool isTerminated,
-                       const UChar *text,
+                       const char16_t *text,
                        int32_t textLength);
 
   /**
-   * Aliasing setTo() function, analogous to the writable-aliasing UChar* constructor.
+   * Aliasing setTo() function, analogous to the writable-aliasing char16_t* constructor.
    * The text will be used for the UnicodeString object, but
    * it will not be released when the UnicodeString is destroyed.
    * This has write-through semantics:
@@ -2077,11 +2077,11 @@ public:
    *
    * @param buffer The characters to alias for the UnicodeString.
    * @param buffLength The number of Unicode characters in <code>buffer</code> to alias.
-   * @param buffCapacity The size of <code>buffer</code> in UChars.
+   * @param buffCapacity The size of <code>buffer</code> in char16_ts.
    * @return a reference to this
    * @stable ICU 2.0
    */
-  UnicodeString &setTo(UChar *buffer,
+  UnicodeString &setTo(char16_t *buffer,
                        int32_t buffLength,
                        int32_t buffCapacity);
 
@@ -2117,7 +2117,7 @@ public:
    *   s.truncate(0);        // set to an empty string (complete truncation), or
    *   s=UnicodeString();    // assign an empty string, or
    *   s.setTo((UChar32)-1); // set to a pseudo code point that is out of range, or
-   *   static const UChar nul=0;
+   *   static const char16_t nul=0;
    *   s.setTo(&nul, 0);     // set to an empty C Unicode string
    * }
    * \endcode
@@ -2135,7 +2135,7 @@ public:
    * @stable ICU 2.0
    */
   UnicodeString& setCharAt(int32_t offset,
-               UChar ch);
+               char16_t ch);
 
 
   /* Append operations */
@@ -2147,7 +2147,7 @@ public:
    * @return a reference to this
    * @stable ICU 2.0
    */
- inline  UnicodeString& operator+= (UChar ch);
+ inline  UnicodeString& operator+= (char16_t ch);
 
   /**
    * Append operator. Append the code point <TT>ch</TT> to the UnicodeString
@@ -2207,7 +2207,7 @@ public:
    * @return a reference to this
    * @stable ICU 2.0
    */
-  inline UnicodeString& append(const UChar *srcChars,
+  inline UnicodeString& append(const char16_t *srcChars,
             int32_t srcStart,
             int32_t srcLength);
 
@@ -2229,7 +2229,7 @@ public:
    * @return a reference to this
    * @stable ICU 2.0
    */
-  inline UnicodeString& append(UChar srcChar);
+  inline UnicodeString& append(char16_t srcChar);
 
   /**
    * Append the code point <TT>srcChar</TT> to the UnicodeString object.
@@ -2285,7 +2285,7 @@ public:
    * @stable ICU 2.0
    */
   inline UnicodeString& insert(int32_t start,
-            const UChar *srcChars,
+            const char16_t *srcChars,
             int32_t srcStart,
             int32_t srcLength);
 
@@ -2311,7 +2311,7 @@ public:
    * @stable ICU 2.0
    */
   inline UnicodeString& insert(int32_t start,
-            UChar srcChar);
+            char16_t srcChar);
 
   /**
    * Insert the code point <TT>srcChar</TT> into the UnicodeString object at
@@ -2385,7 +2385,7 @@ public:
    */
   UnicodeString& replace(int32_t start,
              int32_t length,
-             const UChar *srcChars,
+             const char16_t *srcChars,
              int32_t srcStart,
              int32_t srcLength);
 
@@ -2419,7 +2419,7 @@ public:
    */
   inline UnicodeString& replace(int32_t start,
              int32_t length,
-             UChar srcChar);
+             char16_t srcChar);
 
   /**
    * Replace the characters in the range
@@ -2617,7 +2617,7 @@ public:
    * @stable ICU 2.0
    */
   UBool padLeading(int32_t targetLength,
-                    UChar padChar = 0x0020);
+                    char16_t padChar = 0x0020);
 
   /**
    * Pad the end of this UnicodeString with the character <TT>padChar</TT>.
@@ -2631,7 +2631,7 @@ public:
    * @stable ICU 2.0
    */
   UBool padTrailing(int32_t targetLength,
-                     UChar padChar = 0x0020);
+                     char16_t padChar = 0x0020);
 
   /**
    * Truncate this UnicodeString to the <TT>targetLength</TT>.
@@ -2818,7 +2818,7 @@ public:
 
   /**
    * Get a read/write pointer to the internal buffer.
-   * The buffer is guaranteed to be large enough for at least minCapacity UChars,
+   * The buffer is guaranteed to be large enough for at least minCapacity char16_ts,
    * writable, and is still owned by the UnicodeString object.
    * Calls to getBuffer(minCapacity) must not be nested, and
    * must be matched with calls to releaseBuffer(newLength).
@@ -2849,7 +2849,7 @@ public:
    * - You must call releaseBuffer(newLength) before and in order to
    *   return to normal UnicodeString operation.
    *
-   * @param minCapacity the minimum number of UChars that are to be available
+   * @param minCapacity the minimum number of char16_ts that are to be available
    *        in the buffer, starting at the returned pointer;
    *        default to the current string capacity if minCapacity==-1
    * @return a writable pointer to the internal string buffer,
@@ -2960,8 +2960,8 @@ public:
   inline UnicodeString();
 
   /**
-   * Construct a UnicodeString with capacity to hold <TT>capacity</TT> UChars
-   * @param capacity the number of UChars this UnicodeString should hold
+   * Construct a UnicodeString with capacity to hold <TT>capacity</TT> char16_ts
+   * @param capacity the number of char16_ts this UnicodeString should hold
    * 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 adjusted
    * accordingly.
@@ -2973,7 +2973,7 @@ public:
   UnicodeString(int32_t capacity, UChar32 c, int32_t count);
 
   /**
-   * Single UChar (code unit) constructor.
+   * Single char16_t (code unit) constructor.
    *
    * It is recommended to mark this constructor "explicit" by
    * <code>-DUNISTR_FROM_CHAR_EXPLICIT=explicit</code>
@@ -2981,7 +2981,7 @@ public:
    * @param ch the character to place in the UnicodeString
    * @stable ICU 2.0
    */
-  UNISTR_FROM_CHAR_EXPLICIT UnicodeString(UChar ch);
+  UNISTR_FROM_CHAR_EXPLICIT UnicodeString(char16_t ch);
 
   /**
    * Single UChar32 (code point) constructor.
@@ -2995,7 +2995,7 @@ public:
   UNISTR_FROM_CHAR_EXPLICIT UnicodeString(UChar32 ch);
 
   /**
-   * UChar* constructor.
+   * char16_t* constructor.
    *
    * It is recommended to mark this constructor "explicit" by
    * <code>-DUNISTR_FROM_STRING_EXPLICIT=explicit</code>
@@ -3004,11 +3004,11 @@ public:
    * must be NULL (U+0000) terminated.
    * @stable ICU 2.0
    */
-  UNISTR_FROM_STRING_EXPLICIT UnicodeString(const UChar *text);
+  UNISTR_FROM_STRING_EXPLICIT UnicodeString(const char16_t *text);
 
   /**
    * uint16_t * constructor.
-   * Delegates to UnicodeString(const UChar *).
+   * Delegates to UnicodeString(const char16_t *).
    *
    * It is recommended to mark this constructor "explicit" by
    * <code>-DUNISTR_FROM_STRING_EXPLICIT=explicit</code>
@@ -3023,7 +3023,7 @@ public:
   /**
    * wchar_t * constructor.
    * (Only defined if U_SIZEOF_WCHAR_T==2.)
-   * Delegates to UnicodeString(const UChar *).
+   * Delegates to UnicodeString(const char16_t *).
    *
    * It is recommended to mark this constructor "explicit" by
    * <code>-DUNISTR_FROM_STRING_EXPLICIT=explicit</code>
@@ -3048,18 +3048,18 @@ public:
   UNISTR_FROM_STRING_EXPLICIT inline UnicodeString(const std::nullptr_t text);
 
   /**
-   * UChar* constructor.
+   * char16_t* constructor.
    * @param text The characters to place in the UnicodeString.
    * @param textLength The number of Unicode characters in <TT>text</TT>
    * to copy.
    * @stable ICU 2.0
    */
-  UnicodeString(const UChar *text,
+  UnicodeString(const char16_t *text,
         int32_t textLength);
 
   /**
    * uint16_t * constructor.
-   * Delegates to UnicodeString(const UChar *, int32_t).
+   * Delegates to UnicodeString(const char16_t *, int32_t).
    * @param text UTF-16 string
    * @param length string length
    * @draft ICU 59
@@ -3071,7 +3071,7 @@ public:
   /**
    * wchar_t * constructor.
    * (Only defined if U_SIZEOF_WCHAR_T==2.)
-   * Delegates to UnicodeString(const UChar *, int32_t).
+   * Delegates to UnicodeString(const char16_t *, int32_t).
    * @param text NUL-terminated UTF-16 string
    * @param length string length
    * @draft ICU 59
@@ -3090,7 +3090,7 @@ public:
   inline UnicodeString(const std::nullptr_t text, int32_t length);
 
   /**
-   * Readonly-aliasing UChar* constructor.
+   * Readonly-aliasing char16_t* constructor.
    * The text will be used for the UnicodeString object, but
    * it will not be released when the UnicodeString is destroyed.
    * This has copy-on-write semantics:
@@ -3116,7 +3116,7 @@ public:
                 int32_t textLength);
 
   /**
-   * Writable-aliasing UChar* constructor.
+   * Writable-aliasing char16_t* constructor.
    * The text will be used for the UnicodeString object, but
    * it will not be released when the UnicodeString is destroyed.
    * This has write-through semantics:
@@ -3130,14 +3130,14 @@ public:
    *
    * @param buffer The characters to alias for the UnicodeString.
    * @param buffLength The number of Unicode characters in <code>buffer</code> to alias.
-   * @param buffCapacity The size of <code>buffer</code> in UChars.
+   * @param buffCapacity The size of <code>buffer</code> in char16_ts.
    * @stable ICU 2.0
    */
-  UnicodeString(UChar *buffer, int32_t buffLength, int32_t buffCapacity);
+  UnicodeString(char16_t *buffer, int32_t buffLength, int32_t buffCapacity);
 
   /**
    * Writable-aliasing uint16_t * constructor.
-   * Delegates to UnicodeString(const UChar *, int32_t, int32_t).
+   * Delegates to UnicodeString(const char16_t *, int32_t, int32_t).
    * @param buffer writable buffer of/for UTF-16 text
    * @param buffLength length of the current buffer contents
    * @param buffCapacity buffer capacity
@@ -3150,7 +3150,7 @@ public:
   /**
    * Writable-aliasing wchar_t * constructor.
    * (Only defined if U_SIZEOF_WCHAR_T==2.)
-   * Delegates to UnicodeString(const UChar *, int32_t, int32_t).
+   * Delegates to UnicodeString(const char16_t *, int32_t, int32_t).
    * @param buffer writable buffer of/for UTF-16 text
    * @param buffLength length of the current buffer contents
    * @param buffCapacity buffer capacity
@@ -3485,7 +3485,7 @@ protected:
    * UnicodeString::charAt() to be inline again (see jitterbug 709).
    * @stable ICU 2.4
    */
-  virtual UChar getCharAt(int32_t offset) const;
+  virtual char16_t getCharAt(int32_t offset) const;
 
   /**
    * The change in Replaceable to use virtual getChar32At() allows
@@ -3521,7 +3521,7 @@ private:
 
   int8_t doCompare(int32_t start,
            int32_t length,
-           const UChar *srcChars,
+           const char16_t *srcChars,
            int32_t srcStart,
            int32_t srcLength) const;
 
@@ -3534,7 +3534,7 @@ private:
 
   int8_t doCompareCodePointOrder(int32_t start,
                                  int32_t length,
-                                 const UChar *srcChars,
+                                 const char16_t *srcChars,
                                  int32_t srcStart,
                                  int32_t srcLength) const;
 
@@ -3549,12 +3549,12 @@ private:
   int8_t
   doCaseCompare(int32_t start,
                 int32_t length,
-                const UChar *srcChars,
+                const char16_t *srcChars,
                 int32_t srcStart,
                 int32_t srcLength,
                 uint32_t options) const;
 
-  int32_t doIndexOf(UChar c,
+  int32_t doIndexOf(char16_t c,
             int32_t start,
             int32_t length) const;
 
@@ -3562,7 +3562,7 @@ private:
                         int32_t start,
                         int32_t length) const;
 
-  int32_t doLastIndexOf(UChar c,
+  int32_t doLastIndexOf(char16_t c,
                 int32_t start,
                 int32_t length) const;
 
@@ -3572,14 +3572,14 @@ private:
 
   void doExtract(int32_t start,
          int32_t length,
-         UChar *dst,
+         char16_t *dst,
          int32_t dstStart) const;
 
   inline void doExtract(int32_t start,
          int32_t length,
          UnicodeString& target) const;
 
-  inline UChar doCharAt(int32_t offset)  const;
+  inline char16_t doCharAt(int32_t offset)  const;
 
   UnicodeString& doReplace(int32_t start,
                int32_t length,
@@ -3589,12 +3589,12 @@ private:
 
   UnicodeString& doReplace(int32_t start,
                int32_t length,
-               const UChar *srcChars,
+               const char16_t *srcChars,
                int32_t srcStart,
                int32_t srcLength);
 
   UnicodeString& doAppend(const UnicodeString& src, int32_t srcStart, int32_t srcLength);
-  UnicodeString& doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLength);
+  UnicodeString& doAppend(const char16_t *srcChars, int32_t srcStart, int32_t srcLength);
 
   UnicodeString& doReverse(int32_t start,
                int32_t length);
@@ -3604,8 +3604,8 @@ private:
 
   // get pointer to start of array
   // these do not check for kOpenGetBuffer, unlike the public getBuffer() function
-  inline UChar* getArrayStart(void);
-  inline const UChar* getArrayStart(void) const;
+  inline char16_t* getArrayStart(void);
+  inline const char16_t* getArrayStart(void) const;
 
   inline UBool hasShortLength() const;
   inline int32_t getShortLength() const;
@@ -3622,7 +3622,7 @@ private:
   inline void setShortLength(int32_t len);
   inline void setLength(int32_t len);
   inline void setToEmpty();
-  inline void setArray(UChar *array, int32_t len, int32_t capacity); // sets length but not flags
+  inline void setArray(char16_t *array, int32_t len, int32_t capacity); // sets length but not flags
 
   // allocate the array; result may be the stack buffer
   // sets refCount to 1 if appropriate
@@ -3800,15 +3800,15 @@ private:
     // Each struct of the union must begin with fLengthAndFlags.
     struct {
       int16_t fLengthAndFlags;          // bit fields: see constants above
-      UChar fBuffer[US_STACKBUF_SIZE];  // buffer for short strings
+      char16_t fBuffer[US_STACKBUF_SIZE];  // buffer for short strings
     } fStackFields;
     struct {
       int16_t fLengthAndFlags;          // bit fields: see constants above
       int32_t fLength;    // number of characters in fArray if >127; else undefined
-      int32_t fCapacity;  // capacity of fArray (in UChars)
+      int32_t fCapacity;  // capacity of fArray (in char16_ts)
       // array pointer last to minimize padding for machines with P128 data model
       // or pointer sizes that are not a power of 2
-      UChar   *fArray;    // the Unicode data
+      char16_t   *fArray;    // the Unicode data
     } fFields;
   } fUnion;
 };
@@ -3861,13 +3861,13 @@ UnicodeString::pinIndices(int32_t& start,
   }
 }
 
-inline UChar*
+inline char16_t*
 UnicodeString::getArrayStart() {
   return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
     fUnion.fStackFields.fBuffer : fUnion.fFields.fArray;
 }
 
-inline const UChar*
+inline const char16_t*
 UnicodeString::getArrayStart() const {
   return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
     fUnion.fStackFields.fBuffer : fUnion.fFields.fArray;
@@ -4026,13 +4026,13 @@ UnicodeString::compare(int32_t start,
 inline int8_t
 UnicodeString::compare(int32_t start,
                int32_t _length,
-               const UChar *srcChars) const
+               const char16_t *srcChars) const
 { return doCompare(start, _length, srcChars, 0, _length); }
 
 inline int8_t
 UnicodeString::compare(int32_t start,
                int32_t _length,
-               const UChar *srcChars,
+               const char16_t *srcChars,
                int32_t srcStart,
                int32_t srcLength) const
 { return doCompare(start, _length, srcChars, srcStart, srcLength); }
@@ -4087,13 +4087,13 @@ UnicodeString::compareCodePointOrder(int32_t start,
 inline int8_t
 UnicodeString::compareCodePointOrder(int32_t start,
                                      int32_t _length,
-                                     const UChar *srcChars) const
+                                     const char16_t *srcChars) const
 { return doCompareCodePointOrder(start, _length, srcChars, 0, _length); }
 
 inline int8_t
 UnicodeString::compareCodePointOrder(int32_t start,
                                      int32_t _length,
-                                     const UChar *srcChars,
+                                     const char16_t *srcChars,
                                      int32_t srcStart,
                                      int32_t srcLength) const
 { return doCompareCodePointOrder(start, _length, srcChars, srcStart, srcLength); }
@@ -4156,7 +4156,7 @@ UnicodeString::caseCompare(int32_t start,
 inline int8_t
 UnicodeString::caseCompare(int32_t start,
                            int32_t _length,
-                           const UChar *srcChars,
+                           const char16_t *srcChars,
                            uint32_t options) const {
   return doCaseCompare(start, _length, srcChars, 0, _length, options);
 }
@@ -4164,7 +4164,7 @@ UnicodeString::caseCompare(int32_t start,
 inline int8_t
 UnicodeString::caseCompare(int32_t start,
                            int32_t _length,
-                           const UChar *srcChars,
+                           const char16_t *srcChars,
                            int32_t srcStart,
                            int32_t srcLength,
                            uint32_t options) const {
@@ -4215,7 +4215,7 @@ UnicodeString::indexOf(const UnicodeString& text,
 { return indexOf(text, 0, text.length(), start, _length); }
 
 inline int32_t
-UnicodeString::indexOf(const UChar *srcChars,
+UnicodeString::indexOf(const char16_t *srcChars,
                int32_t srcLength,
                int32_t start) const {
   pinIndex(start);
@@ -4230,7 +4230,7 @@ UnicodeString::indexOf(ConstChar16Ptr srcChars,
 { return indexOf(srcChars, 0, srcLength, start, _length); }
 
 inline int32_t
-UnicodeString::indexOf(UChar c,
+UnicodeString::indexOf(char16_t c,
                int32_t start,
                int32_t _length) const
 { return doIndexOf(c, start, _length); }
@@ -4242,7 +4242,7 @@ UnicodeString::indexOf(UChar32 c,
 { return doIndexOf(c, start, _length); }
 
 inline int32_t
-UnicodeString::indexOf(UChar c) const
+UnicodeString::indexOf(char16_t c) const
 { return doIndexOf(c, 0, length()); }
 
 inline int32_t
@@ -4250,7 +4250,7 @@ UnicodeString::indexOf(UChar32 c) const
 { return indexOf(c, 0, length()); }
 
 inline int32_t
-UnicodeString::indexOf(UChar c,
+UnicodeString::indexOf(char16_t c,
                int32_t start) const {
   pinIndex(start);
   return doIndexOf(c, start, length() - start);
@@ -4271,7 +4271,7 @@ UnicodeString::lastIndexOf(ConstChar16Ptr srcChars,
 { return lastIndexOf(srcChars, 0, srcLength, start, _length); }
 
 inline int32_t
-UnicodeString::lastIndexOf(const UChar *srcChars,
+UnicodeString::lastIndexOf(const char16_t *srcChars,
                int32_t srcLength,
                int32_t start) const {
   pinIndex(start);
@@ -4312,7 +4312,7 @@ UnicodeString::lastIndexOf(const UnicodeString& text) const
 { return lastIndexOf(text, 0, text.length(), 0, length()); }
 
 inline int32_t
-UnicodeString::lastIndexOf(UChar c,
+UnicodeString::lastIndexOf(char16_t c,
                int32_t start,
                int32_t _length) const
 { return doLastIndexOf(c, start, _length); }
@@ -4325,7 +4325,7 @@ UnicodeString::lastIndexOf(UChar32 c,
 }
 
 inline int32_t
-UnicodeString::lastIndexOf(UChar c) const
+UnicodeString::lastIndexOf(char16_t c) const
 { return doLastIndexOf(c, 0, length()); }
 
 inline int32_t
@@ -4334,7 +4334,7 @@ UnicodeString::lastIndexOf(UChar32 c) const {
 }
 
 inline int32_t
-UnicodeString::lastIndexOf(UChar c,
+UnicodeString::lastIndexOf(char16_t c,
                int32_t start) const {
   pinIndex(start);
   return doLastIndexOf(c, start, length() - start);
@@ -4366,7 +4366,7 @@ UnicodeString::startsWith(ConstChar16Ptr srcChars, int32_t srcLength) const {
 }
 
 inline UBool
-UnicodeString::startsWith(const UChar *srcChars, int32_t srcStart, int32_t srcLength) const {
+UnicodeString::startsWith(const char16_t *srcChars, int32_t srcStart, int32_t srcLength) const {
   if(srcLength < 0) {
     srcLength = u_strlen(srcChars);
   }
@@ -4398,7 +4398,7 @@ UnicodeString::endsWith(ConstChar16Ptr srcChars,
 }
 
 inline UBool
-UnicodeString::endsWith(const UChar *srcChars,
+UnicodeString::endsWith(const char16_t *srcChars,
             int32_t srcStart,
             int32_t srcLength) const {
   if(srcLength < 0) {
@@ -4435,7 +4435,7 @@ UnicodeString::replace(int32_t start,
 inline UnicodeString&
 UnicodeString::replace(int32_t start,
                int32_t _length,
-               const UChar *srcChars,
+               const char16_t *srcChars,
                int32_t srcStart,
                int32_t srcLength)
 { return doReplace(start, _length, srcChars, srcStart, srcLength); }
@@ -4443,7 +4443,7 @@ UnicodeString::replace(int32_t start,
 inline UnicodeString&
 UnicodeString::replace(int32_t start,
                int32_t _length,
-               UChar srcChar)
+               char16_t srcChar)
 { return doReplace(start, _length, &srcChar, 0, 1); }
 
 inline UnicodeString&
@@ -4514,7 +4514,7 @@ UnicodeString::extract(int32_t start,
 inline void
 UnicodeString::extractBetween(int32_t start,
                   int32_t limit,
-                  UChar *dst,
+                  char16_t *dst,
                   int32_t dstStart) const {
   pinIndex(start);
   pinIndex(limit);
@@ -4526,7 +4526,7 @@ UnicodeString::tempSubStringBetween(int32_t start, int32_t limit) const {
     return tempSubString(start, limit - start);
 }
 
-inline UChar
+inline char16_t
 UnicodeString::doCharAt(int32_t offset) const
 {
   if((uint32_t)offset < (uint32_t)length()) {
@@ -4536,11 +4536,11 @@ UnicodeString::doCharAt(int32_t offset) const
   }
 }
 
-inline UChar
+inline char16_t
 UnicodeString::charAt(int32_t offset) const
 { return doCharAt(offset); }
 
-inline UChar
+inline char16_t
 UnicodeString::operator[] (int32_t offset) const
 { return doCharAt(offset); }
 
@@ -4581,14 +4581,14 @@ UnicodeString::setToEmpty() {
 }
 
 inline void
-UnicodeString::setArray(UChar *array, int32_t len, int32_t capacity) {
+UnicodeString::setArray(char16_t *array, int32_t len, int32_t capacity) {
   setLength(len);
   fUnion.fFields.fArray = array;
   fUnion.fFields.fCapacity = capacity;
 }
 
 inline UnicodeString&
-UnicodeString::operator= (UChar ch)
+UnicodeString::operator= (char16_t ch)
 { return doReplace(0, length(), &ch, 0, 1); }
 
 inline UnicodeString&
@@ -4620,7 +4620,7 @@ UnicodeString::setTo(const UnicodeString& srcText)
 }
 
 inline UnicodeString&
-UnicodeString::setTo(const UChar *srcChars,
+UnicodeString::setTo(const char16_t *srcChars,
              int32_t srcLength)
 {
   unBogus();
@@ -4628,7 +4628,7 @@ UnicodeString::setTo(const UChar *srcChars,
 }
 
 inline UnicodeString&
-UnicodeString::setTo(UChar srcChar)
+UnicodeString::setTo(char16_t srcChar)
 {
   unBogus();
   return doReplace(0, length(), &srcChar, 0, 1);
@@ -4652,7 +4652,7 @@ UnicodeString::append(const UnicodeString& srcText)
 { return doAppend(srcText, 0, srcText.length()); }
 
 inline UnicodeString&
-UnicodeString::append(const UChar *srcChars,
+UnicodeString::append(const char16_t *srcChars,
               int32_t srcStart,
               int32_t srcLength)
 { return doAppend(srcChars, srcStart, srcLength); }
@@ -4663,11 +4663,11 @@ UnicodeString::append(ConstChar16Ptr srcChars,
 { return doAppend(srcChars, 0, srcLength); }
 
 inline UnicodeString&
-UnicodeString::append(UChar srcChar)
+UnicodeString::append(char16_t srcChar)
 { return doAppend(&srcChar, 0, 1); }
 
 inline UnicodeString&
-UnicodeString::operator+= (UChar ch)
+UnicodeString::operator+= (char16_t ch)
 { return doAppend(&ch, 0, 1); }
 
 inline UnicodeString&
@@ -4693,7 +4693,7 @@ UnicodeString::insert(int32_t start,
 
 inline UnicodeString&
 UnicodeString::insert(int32_t start,
-              const UChar *srcChars,
+              const char16_t *srcChars,
               int32_t srcStart,
               int32_t srcLength)
 { return doReplace(start, 0, srcChars, srcStart, srcLength); }
@@ -4706,7 +4706,7 @@ UnicodeString::insert(int32_t start,
 
 inline UnicodeString&
 UnicodeString::insert(int32_t start,
-              UChar srcChar)
+              char16_t srcChar)
 { return doReplace(start, 0, &srcChar, 0, 1); }
 
 inline UnicodeString&
index f7b2b52d1c5d0942f90e88eec00558f731644dce..a53df5deebd0da915c7da5111029d7b31d33ca7e 100644 (file)
@@ -393,8 +393,8 @@ public:
      * is less than, greater than or equal to another string array.
      * <p>Example of use:
      * <pre>
-     * .       UChar ABC[] = {0x41, 0x42, 0x43, 0};  // = "ABC"
-     * .       UChar abc[] = {0x61, 0x62, 0x63, 0};  // = "abc"
+     * .       char16_t ABC[] = {0x41, 0x42, 0x43, 0};  // = "ABC"
+     * .       char16_t abc[] = {0x61, 0x62, 0x63, 0};  // = "abc"
      * .       UErrorCode status = U_ZERO_ERROR;
      * .       Collator *myCollation =
      * .                         Collator::createInstance(Locale::getUS(), status);
@@ -420,8 +420,8 @@ public:
      *         target
      * @deprecated ICU 2.6 use the overload with UErrorCode &
      */
-    virtual EComparisonResult compare(const UChar* source, int32_t sourceLength,
-                                      const UChar* target, int32_t targetLength)
+    virtual EComparisonResult compare(const char16_t* source, int32_t sourceLength,
+                                      const char16_t* target, int32_t targetLength)
                                       const;
 
     /**
@@ -440,8 +440,8 @@ public:
      * than target
      * @stable ICU 2.6
      */
-    virtual UCollationResult compare(const UChar* source, int32_t sourceLength,
-                                      const UChar* target, int32_t targetLength,
+    virtual UCollationResult compare(const char16_t* source, int32_t sourceLength,
+                                      const char16_t* target, int32_t targetLength,
                                       UErrorCode &status) const = 0;
 
     /**
@@ -517,7 +517,7 @@ public:
      * @see CollationKey#compare
      * @stable ICU 2.0
      */
-    virtual CollationKey& getCollationKey(const UChar*source,
+    virtual CollationKey& getCollationKey(const char16_t*source,
                                           int32_t sourceLength,
                                           CollationKey& key,
                                           UErrorCode& status) const = 0;
@@ -911,7 +911,7 @@ public:
      * the top of one of the supported reordering groups,
      * and it must not be beyond the last of those groups.
      * See setMaxVariable().
-     * @param varTop one or more (if contraction) UChars to which the variable top should be set
+     * @param varTop one or more (if contraction) char16_ts to which the variable top should be set
      * @param len length of variable top string. If -1 it is considered to be zero terminated.
      * @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
      *    U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
@@ -920,7 +920,7 @@ public:
      * @return variable top primary weight
      * @deprecated ICU 53 Call setMaxVariable() instead.
      */
-    virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status) = 0;
+    virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status) = 0;
 
     /**
      * Sets the variable top to the primary weight of the specified string.
@@ -929,7 +929,7 @@ public:
      * the top of one of the supported reordering groups,
      * and it must not be beyond the last of those groups.
      * See setMaxVariable().
-     * @param varTop a UnicodeString size 1 or more (if contraction) of UChars to which the variable top should be set
+     * @param varTop a UnicodeString size 1 or more (if contraction) of char16_ts to which the variable top should be set
      * @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
      *    U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
      *    U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond
@@ -1002,7 +1002,7 @@ public:
                               int32_t resultLength) const = 0;
 
     /**
-     * Get the sort key as an array of bytes from a UChar buffer.
+     * Get the sort key as an array of bytes from a char16_t buffer.
      * Sort key byte arrays are zero-terminated and can be compared using
      * strcmp().
      *
@@ -1020,7 +1020,7 @@ public:
      * @return Number of bytes needed for storing the sort key
      * @stable ICU 2.2
      */
-    virtual int32_t getSortKey(const UChar*source, int32_t sourceLength,
+    virtual int32_t getSortKey(const char16_t*source, int32_t sourceLength,
                                uint8_t*result, int32_t resultLength) const = 0;
 
     /**
index 857d9ceafe015e90287860f65e55e5ee0536721d..cefea536eb03e58cf2440abeb82661b0bfa85806 100644 (file)
@@ -28,7 +28,7 @@ U_NAMESPACE_BEGIN
 
 /**
  * A unit of currency, such as USD (U.S. dollars) or JPY (Japanese
- * yen).  This class is a thin wrapper over a UChar string that
+ * yen).  This class is a thin wrapper over a char16_t string that
  * subclasses MeasureUnit, for use with Measure and MeasureFormat.
  *
  * @author Alan Liu
@@ -99,7 +99,7 @@ class U_I18N_API CurrencyUnit: public MeasureUnit {
     /**
      * The ISO 4217 code of this object.
      */
-    UChar isoCode[4];
+    char16_t isoCode[4];
 };
 
 inline ConstChar16Ptr CurrencyUnit::getISOCurrency() const {
index 6e6615ebd9fe833b5639ba52345416c02b075b7f..3a502d0ec03d1c7fa3ec308840cd9339518f8757 100644 (file)
@@ -393,7 +393,7 @@ public:
      * Returns that pattern stored in currecy info. Internal API for use by NumberFormat API.
      * @internal
      */
-    inline const UChar* getCurrencyPattern(void) const;
+    inline const char16_t* getCurrencyPattern(void) const;
 #endif  /* U_HIDE_INTERNAL_API */
 
 private:
@@ -424,7 +424,7 @@ private:
 
     char actualLocale[ULOC_FULLNAME_CAPACITY];
     char validLocale[ULOC_FULLNAME_CAPACITY];
-    const UChar* currPattern;
+    const char16_t* currPattern;
 
     UnicodeString currencySpcBeforeSym[UNUM_CURRENCY_SPACING_COUNT];
     UnicodeString currencySpcAfterSym[UNUM_CURRENCY_SPACING_COUNT];
@@ -492,7 +492,7 @@ DecimalFormatSymbols::getLocale() const {
 }
 
 #ifndef U_HIDE_INTERNAL_API
-inline const UChar*
+inline const char16_t*
 DecimalFormatSymbols::getCurrencyPattern() const {
     return currPattern;
 }
index 7ba34dd4a942fd7adf12d24c04a3ac6e9650063e..1deff5bf921c87cdde9b5ab758d00408eadc4846 100644 (file)
@@ -604,7 +604,7 @@ template class U_I18N_API    EnumSet<UNumberFormatAttribute,
  * including prefix and suffix, determines the format width.  For example, in
  * the pattern <code>"* #0 o''clock"</code>, the format width is 10.
  *
- * <li>The width is counted in 16-bit code units (UChars).
+ * <li>The width is counted in 16-bit code units (char16_ts).
  *
  * <li>Some parameters which usually do not matter have meaning when padding is
  * used, because the pattern width is significant with padding.  In the pattern
@@ -1961,14 +1961,14 @@ public:
      * @param ec input-output error code
      * @stable ICU 3.0
      */
-    virtual void setCurrency(const UChar* theCurrency, UErrorCode& ec);
+    virtual void setCurrency(const char16_t* theCurrency, UErrorCode& ec);
 
     /**
      * Sets the currency used to display currency amounts.  See
-     * setCurrency(const UChar*, UErrorCode&).
-     * @deprecated ICU 3.0. Use setCurrency(const UChar*, UErrorCode&).
+     * setCurrency(const char16_t*, UErrorCode&).
+     * @deprecated ICU 3.0. Use setCurrency(const char16_t*, UErrorCode&).
      */
-    virtual void setCurrency(const UChar* theCurrency);
+    virtual void setCurrency(const char16_t* theCurrency);
 
     /**
      * Sets the <tt>Currency Context</tt> object used to display currency.
@@ -2108,7 +2108,7 @@ private:
     void parse(const UnicodeString& text,
                Formattable& result,
                ParsePosition& pos,
-               UChar* currency) const;
+               char16_t* currency) const;
 
     enum {
         fgStatusInfinite,
@@ -2124,7 +2124,7 @@ private:
                    int8_t type,
                    ParsePosition& parsePosition,
                    DigitList& digits, UBool* status,
-                   UChar* currency) const;
+                   char16_t* currency) const;
 
     // Mixed style parsing for currency.
     // It parses against the current currency pattern
@@ -2135,7 +2135,7 @@ private:
                            ParsePosition& parsePosition,
                            DigitList& digits,
                            UBool* status,
-                           UChar* currency) const;
+                           char16_t* currency) const;
 
     int32_t skipPadding(const UnicodeString& text, int32_t position) const;
 
@@ -2146,7 +2146,7 @@ private:
                          const UnicodeString* affixPat,
                          UBool complexCurrencyParsing,
                          int8_t type,
-                         UChar* currency) const;
+                         char16_t* currency) const;
 
     static UnicodeString& trimMarksFromAffix(const UnicodeString& affix, UnicodeString& trimmedAffix);
 
@@ -2169,7 +2169,7 @@ private:
                                 const UnicodeString& input,
                                 int32_t pos,
                                 int8_t type,
-                                UChar* currency) const;
+                                char16_t* currency) const;
 
     static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch);
 
@@ -2195,11 +2195,11 @@ private:
     void setupCurrencyAffixPatterns(UErrorCode& status);
 
     // get the currency rounding with respect to currency usage
-    double getCurrencyRounding(const UChar* currency,
+    double getCurrencyRounding(const char16_t* currency,
                                UErrorCode* ec) const;
 
     // get the currency fraction with respect to currency usage
-    int getCurrencyFractionDigits(const UChar* currency,
+    int getCurrencyFractionDigits(const char16_t* currency,
                                   UErrorCode* ec) const;
 
     // hashtable operations
@@ -2271,7 +2271,7 @@ protected:
      * have a capacity of at least 4
      * @internal
      */
-    virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const;
+    virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const;
 
   /** number of integer digits
    * @stable ICU 2.4
index 8374de3c2070526f5c116cafb311acaef4a2d26d..e5f4d5c36c898984eab0340e95fc419c6e26a6fb 100644 (file)
@@ -426,13 +426,13 @@ public:
      * doesn't specify any time separator, and always recognized when parsing.
      * @internal
      */
-    static const UChar DEFAULT_TIME_SEPARATOR = 0x003a;  // ':'
+    static const char16_t DEFAULT_TIME_SEPARATOR = 0x003a;  // ':'
 
     /**
      * This alternate time separator is always recognized when parsing.
      * @internal
      */
-    static const UChar ALTERNATE_TIME_SEPARATOR = 0x002e;  // '.'
+    static const char16_t ALTERNATE_TIME_SEPARATOR = 0x002e;  // '.'
 
     /**
      * Gets the time separator string. For example: ":".
@@ -977,7 +977,7 @@ private:
      * Returns the date format field index of the pattern character c,
      * or UDAT_FIELD_COUNT if c is not a pattern character.
      */
-    static UDateFormatField U_EXPORT2 getPatternCharIndex(UChar c);
+    static UDateFormatField U_EXPORT2 getPatternCharIndex(char16_t c);
 
     /**
      * Returns TRUE if f (with its pattern character repeated count times) is a numeric field.
@@ -987,7 +987,7 @@ private:
     /**
      * Returns TRUE if c (repeated count times) is the pattern character for a numeric field.
      */
-    static UBool U_EXPORT2 isNumericPatternChar(UChar c, int32_t count);
+    static UBool U_EXPORT2 isNumericPatternChar(char16_t c, int32_t count);
 public:
 #ifndef U_HIDE_INTERNAL_API
     /**
index 3c42e15e675e9511f1729d50c1e383fe853a3335..5eaa559d0eaf48a416ecb03406af758f279010af 100644 (file)
@@ -996,7 +996,7 @@ private:
 
 
     // from calendar field to pattern letter
-    static const UChar fgCalendarFieldToPatternLetter[];
+    static const char16_t fgCalendarFieldToPatternLetter[];
 
 
     /**
index 6748e57ff8592f6822c3da754cff9adc8e703966..5f991db68380cf6da8a58c5eedb796e6b60ec600 100644 (file)
@@ -517,7 +517,7 @@ private:
     DateTimeMatcher *skipMatcher;
     Hashtable *fAvailableFormatKeyHash;
     UnicodeString emptyString;
-    UChar fDefaultHourFormatChar;
+    char16_t fDefaultHourFormatChar;
 
     int32_t fAllowedHourFormats[7];  // Actually an array of AllowedHourFormat enum type, ending with UNKNOWN.
 
index 55cbee35247a72649f9f74fd95d018731609f832..fef80107747bf8473f3dbccac331b21cff298ddc 100644 (file)
@@ -939,7 +939,7 @@ private:
      * @return the index of the list which matches the keyword s.
      */
     static int32_t findKeyword( const UnicodeString& s,
-                                const UChar * const *list);
+                                const char16_t * const *list);
 
     /**
      * Thin wrapper around the format(... AppendableWrapper ...) variant.
index 009d59f0916492bde6044e50b59aefff53fee373..6d83f43f520b6a02be1bc07e520cb65a6d49727d 100644 (file)
@@ -931,7 +931,7 @@ public:
      * @param ec input-output error code
      * @stable ICU 3.0
      */
-    virtual void setCurrency(const UChar* theCurrency, UErrorCode& ec);
+    virtual void setCurrency(const char16_t* theCurrency, UErrorCode& ec);
 
     /**
      * Gets the currency used to display currency
@@ -1018,7 +1018,7 @@ protected:
      * have a capacity of at least 4
      * @internal
      */
-    virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const;
+    virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const;
 
 #ifndef U_HIDE_INTERNAL_API
     /**
@@ -1065,7 +1065,7 @@ private:
     UBool      fLenient; // TRUE => lenient parse is enabled
 
     // ISO currency code
-    UChar      fCurrency[4];
+    char16_t      fCurrency[4];
 
     UDisplayContext fCapitalizationContext;
 
index 4f2562466a03eba511b558c8f12fa15686224ec7..6829f7ba47255ff65dede862867176d25d41dad2 100644 (file)
@@ -350,17 +350,17 @@ public:
 private:
     /**
      * Cause a compilation error if an application accidentally attempts to
-     *   create a matcher with a (UChar *) string as input rather than
+     *   create a matcher with a (char16_t *) string as input rather than
      *   a UnicodeString.  Avoids a dangling reference to a temporary string.
      * <p>
-     * To efficiently work with UChar *strings, wrap the data in a UnicodeString
+     * To efficiently work with char16_t *strings, wrap the data in a UnicodeString
      * using one of the aliasing constructors, such as
-     * <code>UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength);</code>
+     * <code>UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength);</code>
      * or in a UText, using
-     * <code>utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status);</code>
+     * <code>utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status);</code>
      *
      */
-    RegexMatcher *matcher(const UChar *input,
+    RegexMatcher *matcher(const char16_t *input,
         UErrorCode          &status) const;
 public:
 
@@ -748,17 +748,17 @@ public:
 private:
     /**
      * Cause a compilation error if an application accidentally attempts to
-     *   create a matcher with a (UChar *) string as input rather than
+     *   create a matcher with a (char16_t *) string as input rather than
      *   a UnicodeString.    Avoids a dangling reference to a temporary string.
      * <p>
-     * To efficiently work with UChar *strings, wrap the data in a UnicodeString
+     * To efficiently work with char16_t *strings, wrap the data in a UnicodeString
      * using one of the aliasing constructors, such as
-     * <code>UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength);</code>
+     * <code>UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength);</code>
      * or in a UText, using
-     * <code>utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status);</code>
+     * <code>utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status);</code>
      *
      */
-    RegexMatcher(const UnicodeString &regexp, const UChar *input,
+    RegexMatcher(const UnicodeString &regexp, const char16_t *input,
         uint32_t flags, UErrorCode &status);
 public:
 
@@ -1156,17 +1156,17 @@ public:
 private:
     /**
      * Cause a compilation error if an application accidentally attempts to
-     *   reset a matcher with a (UChar *) string as input rather than
+     *   reset a matcher with a (char16_t *) string as input rather than
      *   a UnicodeString.    Avoids a dangling reference to a temporary string.
      * <p>
-     * To efficiently work with UChar *strings, wrap the data in a UnicodeString
+     * To efficiently work with char16_t *strings, wrap the data in a UnicodeString
      * using one of the aliasing constructors, such as
-     * <code>UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength);</code>
+     * <code>UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength);</code>
      * or in a UText, using
-     * <code>utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status);</code>
+     * <code>utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status);</code>
      *
      */
-    RegexMatcher &reset(const UChar *input);
+    RegexMatcher &reset(const char16_t *input);
 public:
 
    /**
index e0ab9702ceda100ea1907f1a42af3979050fefe7..4733e759aa705fdfe01afc6f228d968420d83815 100644 (file)
@@ -1170,7 +1170,7 @@ public:
      * @param field The UDateFormatField to get
      * @stable ICU 54
      */
-    const NumberFormat * getNumberFormatForField(UChar field) const;
+    const NumberFormat * getNumberFormatForField(char16_t field) const;
 
 #ifndef U_HIDE_INTERNAL_API
     /**
@@ -1262,7 +1262,7 @@ private:
      *                  succeeds.
      */
     void subFormat(UnicodeString &appendTo,
-                   UChar ch,
+                   char16_t ch,
                    int32_t count,
                    UDisplayContext capitalizationContext,
                    int32_t fieldNum,
@@ -1294,7 +1294,7 @@ private:
      * Return true if the given format character, occuring count
      * times, represents a numeric field.
      */
-    static UBool isNumeric(UChar formatChar, int32_t count);
+    static UBool isNumeric(char16_t formatChar, int32_t count);
 
     /**
      * Returns TRUE if the patternOffset is at the start of a numeric field.
@@ -1412,7 +1412,7 @@ private:
      * @return the new start position if matching succeeded; a negative number
      * indicating matching failure, otherwise.
      */
-    int32_t subParse(const UnicodeString& text, int32_t& start, UChar ch, int32_t count,
+    int32_t subParse(const UnicodeString& text, int32_t& start, char16_t ch, int32_t count,
                      UBool obeyCount, UBool allowNegative, UBool ambiguousYear[], int32_t& saveHebrewMonth, Calendar& cal,
                      int32_t patLoc, MessageFormat * numericLeapMonthFormatter, UTimeZoneFormatTimeType *tzTimeType, SimpleDateFormatMutableNFs &mutableNFs,
                      int32_t *dayPeriod=NULL) const;
@@ -1523,12 +1523,12 @@ private:
     /**
      * Map calendar field letter into calendar field level.
      */
-    static int32_t getLevelFromChar(UChar ch);
+    static int32_t getLevelFromChar(char16_t ch);
 
     /**
      * Tell if a character can be used to define a field in a format string.
      */
-    static UBool isSyntaxChar(UChar ch);
+    static UBool isSyntaxChar(char16_t ch);
 
     /**
      * The formatting pattern for this formatter.
index 6767ee93fc0058439d7f1ccc4ad774276d16bd26..24ba213b41eacc1181f1926f4d11da467a77f24d 100644 (file)
@@ -308,8 +308,8 @@ public:
     * than target
     * @stable ICU 2.6
     */
-    virtual UCollationResult compare(const UChar* source, int32_t sourceLength,
-                                     const UChar* target, int32_t targetLength,
+    virtual UCollationResult compare(const char16_t* source, int32_t sourceLength,
+                                     const char16_t* target, int32_t targetLength,
                                      UErrorCode &status) const;
 
     /**
@@ -377,7 +377,7 @@ public:
      * @see CollationKey
      * @stable ICU 2.0
      */
-    virtual CollationKey& getCollationKey(const UChar *source,
+    virtual CollationKey& getCollationKey(const char16_t *source,
                                           int32_t sourceLength,
                                           CollationKey& key,
                                           UErrorCode& status) const;
@@ -552,7 +552,7 @@ public:
      * the top of one of the supported reordering groups,
      * and it must not be beyond the last of those groups.
      * See setMaxVariable().
-     * @param varTop one or more (if contraction) UChars to which the variable top should be set
+     * @param varTop one or more (if contraction) char16_ts to which the variable top should be set
      * @param len length of variable top string. If -1 it is considered to be zero terminated.
      * @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
      *    U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
@@ -561,7 +561,7 @@ public:
      * @return variable top primary weight
      * @deprecated ICU 53 Call setMaxVariable() instead.
      */
-    virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status);
+    virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status);
 
     /**
      * Sets the variable top to the primary weight of the specified string.
@@ -570,7 +570,7 @@ public:
      * the top of one of the supported reordering groups,
      * and it must not be beyond the last of those groups.
      * See setMaxVariable().
-     * @param varTop a UnicodeString size 1 or more (if contraction) of UChars to which the variable top should be set
+     * @param varTop a UnicodeString size 1 or more (if contraction) of char16_ts to which the variable top should be set
      * @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
      *    U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
      *    U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond
@@ -631,7 +631,7 @@ public:
                                int32_t resultLength) const;
 
     /**
-     * Get the sort key as an array of bytes from a UChar buffer.
+     * Get the sort key as an array of bytes from a char16_t buffer.
      *
      * Note that sort keys are often less efficient than simply doing comparison.
      * For more details, see the ICU User Guide.
@@ -646,7 +646,7 @@ public:
      * @return Number of bytes needed for storing the sort key
      * @stable ICU 2.2
      */
-    virtual int32_t getSortKey(const UChar *source, int32_t sourceLength,
+    virtual int32_t getSortKey(const char16_t *source, int32_t sourceLength,
                                uint8_t *result, int32_t resultLength) const;
 
     /**
@@ -821,17 +821,17 @@ private:
     void adoptTailoring(CollationTailoring *t, UErrorCode &errorCode);
 
     // Both lengths must be <0 or else both must be >=0.
-    UCollationResult doCompare(const UChar *left, int32_t leftLength,
-                               const UChar *right, int32_t rightLength,
+    UCollationResult doCompare(const char16_t *left, int32_t leftLength,
+                               const char16_t *right, int32_t rightLength,
                                UErrorCode &errorCode) const;
     UCollationResult doCompare(const uint8_t *left, int32_t leftLength,
                                const uint8_t *right, int32_t rightLength,
                                UErrorCode &errorCode) const;
 
-    void writeSortKey(const UChar *s, int32_t length,
+    void writeSortKey(const char16_t *s, int32_t length,
                       SortKeyByteSink &sink, UErrorCode &errorCode) const;
 
-    void writeIdenticalLevel(const UChar *s, const UChar *limit,
+    void writeIdenticalLevel(const char16_t *s, const char16_t *limit,
                              SortKeyByteSink &sink, UErrorCode &errorCode) const;
 
     const CollationSettings &getDefaultSettings() const;
index 3d570d23bde39b283df48d6ebe132282b7a50e8e..83dee317784a819962d4118f6bf39fafdee28082 100644 (file)
@@ -863,7 +863,7 @@ private:
      * @param id zone id string
      * @return the pointer of the ID resource, or NULL.
      */
-    static const UChar* findID(const UnicodeString& id);
+    static const char16_t* findID(const UnicodeString& id);
 
     /**
      * Resolve a link in Olson tzdata.  When the given id is known and it's not a link,
@@ -873,7 +873,7 @@ private:
      * @param id zone id string
      * @return the dereferenced zone or NULL
      */
-    static const UChar* dereferOlsonLink(const UnicodeString& id);
+    static const char16_t* dereferOlsonLink(const UnicodeString& id);
 
     /**
      * Returns the region code associated with the given zone,
@@ -881,7 +881,7 @@ private:
      * @param id zone id string
      * @return the region associated with the given zone
      */
-    static const UChar* getRegion(const UnicodeString& id);
+    static const char16_t* getRegion(const UnicodeString& id);
 
   public:
 #ifndef U_HIDE_INTERNAL_API
@@ -893,7 +893,7 @@ private:
      * @return the region associated with the given zone
      * @internal
      */
-    static const UChar* getRegion(const UnicodeString& id, UErrorCode& status);
+    static const char16_t* getRegion(const UnicodeString& id, UErrorCode& status);
 #endif  /* U_HIDE_INTERNAL_API */
 
   private:
index f4ea9ae8014c335ffde0a5a057e9277d95dbed79..bccba5480242467e63a82dc704d1bc9247f07566 100644 (file)
@@ -1319,7 +1319,7 @@ inline int32_t Transliterator::getMaximumContextLength(void) const {
 inline void Transliterator::setID(const UnicodeString& id) {
     ID = id;
     // NUL-terminate the ID string, which is a non-aliased copy.
-    ID.append((UChar)0);
+    ID.append((char16_t)0);
     ID.truncate(ID.length()-1);
 }
 
index 6d2de5bcf0655b987550258848e5a7d149feb24b..724ff4d85bb265796611eeda4d2ca68558f2d698 100644 (file)
@@ -942,7 +942,7 @@ private:
      * @param parsedLen the parsed length, or 0 on failure.
      * @return the parsed offset in milliseconds.
      */
-    int32_t parseDefaultOffsetFields(const UnicodeString& text, int32_t start, UChar separator,
+    int32_t parseDefaultOffsetFields(const UnicodeString& text, int32_t start, char16_t separator,
         int32_t& parsedLen) const;
 
     /**
@@ -982,7 +982,7 @@ private:
      * @param maxFields The maximum fields
      * @return The offset string
      */
-    static UnicodeString& formatOffsetWithAsciiDigits(int32_t offset, UChar sep,
+    static UnicodeString& formatOffsetWithAsciiDigits(int32_t offset, char16_t sep,
         OffsetFields minFields, OffsetFields maxFields, UnicodeString& result);
 
     /**
@@ -1012,7 +1012,7 @@ private:
      * @param maxFields The maximum Fields to be parsed
      * @return Parsed offset, 0 or positive number.
      */
-    static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, UChar sep,
+    static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, char16_t sep,
         OffsetFields minFields, OffsetFields maxFields);
 
     /**