Issue #1971 - Part 2: Update ICU source to 63.2.

This commit is contained in:
Job Bautista 2022-07-24 21:03:27 +08:00 committed by roytam1
commit 1e69214382
3160 changed files with 275815 additions and 234203 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: appendable.h
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -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: