36 class StringThreadTest;
38 #ifndef U_COMPARE_CODE_POINT_ORDER
45 #define U_COMPARE_CODE_POINT_ORDER 0x8000
74 #define US_INV U_NAMESPACE_QUALIFIER UnicodeString::kInvariant
93 #if defined(U_DECLARE_UTF16)
94 # define UNICODE_STRING(cs, _length) U_NAMESPACE_QUALIFIER UnicodeString(TRUE, (const UChar *)U_DECLARE_UTF16(cs), _length)
95 #elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16)))
96 # define UNICODE_STRING(cs, _length) U_NAMESPACE_QUALIFIER UnicodeString(TRUE, (const UChar *)L ## cs, _length)
97 #elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
98 # define UNICODE_STRING(cs, _length) U_NAMESPACE_QUALIFIER UnicodeString(TRUE, (const UChar *)cs, _length)
100 # define UNICODE_STRING(cs, _length) U_NAMESPACE_QUALIFIER UnicodeString(cs, _length, US_INV)
116 #define UNICODE_STRING_SIMPLE(cs) UNICODE_STRING(cs, -1)
352 const UChar *srcChars)
const;
373 const UChar *srcChars,
487 inline int8_t compareCodePointOrder(
const UChar *srcChars,
511 const UChar *srcChars)
const;
536 const UChar *srcChars,
686 const UChar *srcChars,
713 const UChar *srcChars,
778 inline UBool startsWith(
const UChar *srcChars,
790 inline UBool startsWith(
const UChar *srcChars,
1351 inline void extract(
int32_t start,
1391 inline void extract(
int32_t start,
1449 enum EInvariant inv)
const;
1451 #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
1479 #if !UCONFIG_NO_CONVERSION
1509 const char *codepage = 0)
const;
1544 const char *codepage)
const;
1581 #if U_HAVE_STD_STRING
1595 template<
typename StringClass>
1596 StringClass &toUTF8String(StringClass &result)
const {
1597 StringByteSink<StringClass> sbs(&result);
1680 inline UBool isEmpty(
void)
const;
1691 inline int32_t getCapacity(
void)
const;
1700 inline int32_t hashCode(
void)
const;
1713 inline UBool isBogus(
void)
const;
2090 const UChar *srcChars,
2104 const UChar *srcChars,
2190 const UChar *srcChars,
2208 const UChar *srcChars,
2414 UChar padChar = 0x0020);
2428 UChar padChar = 0x0020);
2500 #if !UCONFIG_NO_BREAK_ITERATION
2676 void releaseBuffer(
int32_t newLength=-1);
2708 inline const UChar *getBuffer()
const;
2743 inline const UChar *getTerminatedBuffer();
2842 #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
2862 #if !UCONFIG_NO_CONVERSION
2881 UnicodeString(
const char *codepageData,
const char *codepage);
2924 const char *src,
int32_t srcLength,
3140 char *target,
int32_t capacity)
const;
3152 const UChar *srcChars,
3157 doCompareCodePointOrder(
int32_t start,
3165 const UChar *srcChars,
3180 const UChar *srcChars,
3206 inline void doExtract(
int32_t start,
3220 const UChar *srcChars,
3228 int32_t doHashCode(
void)
const;
3232 inline UChar* getArrayStart(
void);
3233 inline const UChar* getArrayStart(
void)
const;
3237 inline UBool isWritable()
const;
3240 inline UBool isBufferWritable()
const;
3243 inline void setLength(
int32_t len);
3244 inline void setToEmpty();
3245 inline void setToStackBuffer(
int32_t len);
3255 void releaseArray(
void);
3264 inline void pinIndex(
int32_t& start)
const;
3265 inline void pinIndices(
int32_t& start,
3268 #if !UCONFIG_NO_CONVERSION
3272 char *dest,
int32_t destCapacity,
3286 void doCodepageCreate(
const char *codepageData,
3288 const char *codepage);
3295 doCodepageCreate(
const char *codepageData,
3316 int32_t **pBufferToDelete = 0,
3336 US_STACKBUF_SIZE=
sizeof(
void *)==4 ? 13 : 15,
3337 kInvalidUChar=0xffff,
3344 kUsingStackBuffer=2,
3346 kBufferIsReadonly=8,
3351 kShortString=kUsingStackBuffer,
3352 kLongString=kRefCounted,
3353 kReadonlyAlias=kBufferIsReadonly,
3357 friend class StringThreadTest;
3359 union StackBufferOrFields;
3360 friend union StackBufferOrFields;
3376 union StackBufferOrFields {
3379 UChar fStackBuffer [US_STACKBUF_SIZE];
3409 UnicodeString::pinIndex(
int32_t& start)
const
3414 }
else if(start >
length()) {
3420 UnicodeString::pinIndices(
int32_t& start,
3427 }
else if(start > len) {
3432 }
else if(_length > (len - start)) {
3433 _length = (len - start);
3438 UnicodeString::getArrayStart()
3439 {
return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.fArray; }
3442 UnicodeString::getArrayStart()
const
3443 {
return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.fArray; }
3450 {
return fShortLength>=0 ? fShortLength : fUnion.fFields.fLength; }
3454 {
return (fFlags&kUsingStackBuffer) ? US_STACKBUF_SIZE : fUnion.fFields.fCapacity; }
3458 {
return doHashCode(); }
3462 {
return (
UBool)(fFlags & kIsBogus); }
3465 UnicodeString::isWritable()
const
3466 {
return (
UBool)!(fFlags&(kOpenGetBuffer|kIsBogus)); }
3469 UnicodeString::isBufferWritable()
const
3472 !(fFlags&(kOpenGetBuffer|kIsBogus|kBufferIsReadonly)) &&
3473 (!(fFlags&kRefCounted) || refCount()==1));
3476 inline const UChar *
3478 if(fFlags&(kIsBogus|kOpenGetBuffer)) {
3480 }
else if(fFlags&kUsingStackBuffer) {
3481 return fUnion.fStackBuffer;
3483 return fUnion.fFields.fArray;
3491 UnicodeString::doCompare(
int32_t start,
3498 return (
int8_t)!isBogus();
3500 srcText.pinIndices(srcStart, srcLength);
3501 return doCompare(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
3514 len == textLength &&
3515 doCompare(0, len, text, 0, textLength) == 0;
3521 {
return (!
operator==(text)); }
3525 {
return doCompare(0,
length(), text, 0, text.
length()) == 1; }
3529 {
return doCompare(0,
length(), text, 0, text.
length()) == -1; }
3533 {
return doCompare(0,
length(), text, 0, text.
length()) != -1; }
3537 {
return doCompare(0,
length(), text, 0, text.
length()) != 1; }
3541 {
return doCompare(0,
length(), text, 0, text.
length()); }
3547 {
return doCompare(start, _length, srcText, 0, srcText.
length()); }
3552 {
return doCompare(0,
length(), srcChars, 0, srcLength); }
3560 {
return doCompare(start, _length, srcText, srcStart, srcLength); }
3565 const UChar *srcChars)
const
3566 {
return doCompare(start, _length, srcChars, 0, _length); }
3571 const UChar *srcChars,
3574 {
return doCompare(start, _length, srcChars, srcStart, srcLength); }
3582 {
return doCompare(start, limit - start,
3583 srcText, srcStart, srcLimit - srcStart); }
3586 UnicodeString::doCompareCodePointOrder(
int32_t start,
3593 return (
int8_t)!isBogus();
3595 srcText.pinIndices(srcStart, srcLength);
3596 return doCompareCodePointOrder(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
3602 {
return doCompareCodePointOrder(0,
length(), text, 0, text.
length()); }
3608 {
return doCompareCodePointOrder(start, _length, srcText, 0, srcText.
length()); }
3613 {
return doCompareCodePointOrder(0,
length(), srcChars, 0, srcLength); }
3621 {
return doCompareCodePointOrder(start, _length, srcText, srcStart, srcLength); }
3626 const UChar *srcChars)
const
3627 {
return doCompareCodePointOrder(start, _length, srcChars, 0, _length); }
3632 const UChar *srcChars,
3635 {
return doCompareCodePointOrder(start, _length, srcChars, srcStart, srcLength); }
3643 {
return doCompareCodePointOrder(start, limit - start,
3644 srcText, srcStart, srcLimit - srcStart); }
3647 UnicodeString::doCaseCompare(
int32_t start,
3655 return (
int8_t)!isBogus();
3657 srcText.pinIndices(srcStart, srcLength);
3658 return doCaseCompare(start, thisLength, srcText.getArrayStart(), srcStart, srcLength, options);
3664 return doCaseCompare(0,
length(), text, 0, text.
length(), options);
3672 return doCaseCompare(start, _length, srcText, 0, srcText.
length(), options);
3679 return doCaseCompare(0,
length(), srcChars, 0, srcLength, options);
3689 return doCaseCompare(start, _length, srcText, srcStart, srcLength, options);
3695 const UChar *srcChars,
3697 return doCaseCompare(start, _length, srcChars, 0, _length, options);
3703 const UChar *srcChars,
3707 return doCaseCompare(start, _length, srcChars, srcStart, srcLength, options);
3717 return doCaseCompare(start, limit - start, srcText, srcStart, srcLimit - srcStart, options);
3728 srcText.pinIndices(srcStart, srcLength);
3730 return indexOf(srcText.getArrayStart(), srcStart, srcLength, start, _length);
3738 {
return indexOf(text, 0, text.
length(), 0,
length()); }
3744 return indexOf(text, 0, text.
length(), start,
length() - start);
3751 {
return indexOf(text, 0, text.
length(), start, _length); }
3758 return indexOf(srcChars, 0, srcLength, start,
length() - start);
3766 {
return indexOf(srcChars, 0, srcLength, start, _length); }
3772 {
return doIndexOf(c, start, _length); }
3778 {
return doIndexOf(c, start, _length); }
3782 {
return doIndexOf(c, 0,
length()); }
3786 {
return indexOf(c, 0,
length()); }
3792 return doIndexOf(c, start,
length() - start);
3799 return indexOf(c, start,
length() - start);
3807 {
return lastIndexOf(srcChars, 0, srcLength, start, _length); }
3814 return lastIndexOf(srcChars, 0, srcLength, start,
length() - start);
3825 srcText.pinIndices(srcStart, srcLength);
3827 return lastIndexOf(srcText.getArrayStart(), srcStart, srcLength, start, _length);
3837 {
return lastIndexOf(text, 0, text.
length(), start, _length); }
3843 return lastIndexOf(text, 0, text.
length(), start,
length() - start);
3848 {
return lastIndexOf(text, 0, text.
length(), 0,
length()); }
3854 {
return doLastIndexOf(c, start, _length); }
3860 return doLastIndexOf(c, start, _length);
3865 {
return doLastIndexOf(c, 0,
length()); }
3869 return lastIndexOf(c, 0,
length());
3876 return doLastIndexOf(c, start,
length() - start);
3883 return lastIndexOf(c, start,
length() - start);
3888 {
return compare(0, text.
length(), text, 0, text.
length()) == 0; }
3894 {
return doCompare(0, srcLength, srcText, srcStart, srcLength) == 0; }
3899 {
return doCompare(0, srcLength, srcChars, 0, srcLength) == 0; }
3905 {
return doCompare(0, srcLength, srcChars, srcStart, srcLength) == 0;}
3910 text, 0, text.
length()) == 0; }
3916 srcText.pinIndices(srcStart, srcLength);
3917 return doCompare(
length() - srcLength, srcLength,
3918 srcText, srcStart, srcLength) == 0;
3927 return doCompare(
length() - srcLength, srcLength,
3928 srcChars, 0, srcLength) == 0;
3936 srcLength =
u_strlen(srcChars + srcStart);
3938 return doCompare(
length() - srcLength, srcLength,
3939 srcChars, srcStart, srcLength) == 0;
3949 {
return doReplace(start, _length, srcText, 0, srcText.
length()); }
3957 {
return doReplace(start, _length, srcText, srcStart, srcLength); }
3962 const UChar *srcChars,
3964 {
return doReplace(start, _length, srcChars, 0, srcLength); }
3969 const UChar *srcChars,
3972 {
return doReplace(start, _length, srcChars, srcStart, srcLength); }
3978 {
return doReplace(start, _length, &srcChar, 0, 1); }
3988 return doReplace(start, _length, buffer, 0, count);
3995 {
return doReplace(start, limit - start, srcText, 0, srcText.
length()); }
4003 {
return doReplace(start, limit - start, srcText, srcStart, srcLimit - srcStart); }
4008 {
return findAndReplace(0,
length(), oldText, 0, oldText.
length(),
4009 newText, 0, newText.
length()); }
4016 {
return findAndReplace(start, _length, oldText, 0, oldText.
length(),
4017 newText, 0, newText.
length()); }
4023 UnicodeString::doExtract(
int32_t start,
4026 { target.
replace(0, target.
length(), *
this, start, _length); }
4033 { doExtract(start, _length, target, targetStart); }
4039 { doExtract(start, _length, target); }
4041 #if !UCONFIG_NO_CONVERSION
4047 const char *codepage)
const
4051 return extract(start, _length, dst, dst!=0 ? (((
size_t)dst >= ((
size_t)-1) -
UINT32_MAX) ? (((
char*)
UINT32_MAX) - dst) :
UINT32_MAX) : 0, codepage);
4063 doExtract(start, limit - start, dst, dstStart);
4067 UnicodeString::doCharAt(
int32_t offset)
const
4070 return getArrayStart()[offset];
4072 return kInvalidUChar;
4078 {
return doCharAt(offset); }
4082 {
return doCharAt(offset); }
4089 const UChar *array = getArrayStart();
4091 U16_GET(array, 0, offset, len, c);
4094 return kInvalidUChar;
4101 const UChar *array = getArrayStart();
4113 const UChar *array = getArrayStart();
4123 return fShortLength == 0;
4130 UnicodeString::setLength(
int32_t len) {
4132 fShortLength = (
int8_t)len;
4134 fShortLength = (
int8_t)-1;
4135 fUnion.fFields.fLength = len;
4140 UnicodeString::setToEmpty() {
4142 fFlags = kShortString;
4146 UnicodeString::setToStackBuffer(
int32_t len) {
4147 fShortLength = (
int8_t)len;
4148 fFlags = kShortString;
4154 fUnion.fFields.fArray = array;
4155 fUnion.fFields.fCapacity = capacity;
4158 inline const UChar *
4163 UChar *array = getArrayStart();
4166 if(len < getCapacity() && array[len] == 0) {
4170 if(cloneArrayIfNeeded(len+1)) {
4171 array = getArrayStart();
4182 {
return doReplace(0,
length(), &ch, 0, 1); }
4186 {
return replace(0,
length(), ch); }
4194 return doReplace(0,
length(), srcText, srcStart, srcLength);
4202 srcText.pinIndex(srcStart);
4203 return doReplace(0,
length(), srcText, srcStart, srcText.
length() - srcStart);
4210 return doReplace(0,
length(), srcText, 0, srcText.
length());
4218 return doReplace(0,
length(), srcChars, 0, srcLength);
4225 return doReplace(0,
length(), &srcChar, 0, 1);
4232 return replace(0,
length(), srcChar);
4239 {
return doReplace(
length(), 0, srcText, srcStart, srcLength); }
4243 {
return doReplace(
length(), 0, srcText, 0, srcText.
length()); }
4249 {
return doReplace(
length(), 0, srcChars, srcStart, srcLength); }
4254 {
return doReplace(
length(), 0, srcChars, 0, srcLength); }
4258 {
return doReplace(
length(), 0, &srcChar, 0, 1); }
4266 return doReplace(
length(), 0, buffer, 0, _length);
4271 {
return doReplace(
length(), 0, &ch, 0, 1); }
4280 {
return doReplace(
length(), 0, srcText, 0, srcText.
length()); }
4287 {
return doReplace(start, 0, srcText, srcStart, srcLength); }
4292 {
return doReplace(start, 0, srcText, 0, srcText.
length()); }
4296 const UChar *srcChars,
4299 {
return doReplace(start, 0, srcChars, srcStart, srcLength); }
4303 const UChar *srcChars,
4305 {
return doReplace(start, 0, srcChars, 0, srcLength); }
4310 {
return doReplace(start, 0, &srcChar, 0, 1); }
4315 {
return replace(start, 0, srcChar); }
4334 if(start <= 0 && _length ==
INT32_MAX) {
4338 return doReplace(start, _length,
NULL, 0, 0);
4344 {
return doReplace(start, limit - start,
NULL, 0, 0); }
4349 if(isBogus() && targetLength == 0) {
4354 setLength(targetLength);
4363 {
return doReverse(0,
length()); }
4368 {
return doReverse(start, _length); }
void extract(int32_t start, int32_t length, UChar *dst, int32_t dstStart=0) const
Copy the characters in the range [start, start + length) into the array dst, beginning at dstStart...
int32_t getChar32Start(int32_t offset) const
Adjust a random-access offset so that it points to the beginning of a Unicode character.
int8_t caseCompareBetween(int32_t start, int32_t limit, const UnicodeString &srcText, int32_t srcStart, int32_t srcLimit, uint32_t options) const
Compare two strings case-insensitively using full case folding.
int8_t caseCompare(const UnicodeString &text, uint32_t options) const
Compare two strings case-insensitively using full case folding.
The BreakIterator class implements methods for finding the location of boundaries in text...
A ByteSink can be filled with bytes.
#define U16_GET(s, start, i, length, c)
Get a code point from a string at a random-access offset, without changing the offset.
int32_t hashCode(void) const
Generate a hash code for this object.
UBool operator>(const UnicodeString &text) const
Greater than operator.
const UChar * getBuffer() const
Get a read-only pointer to the internal buffer.
int32_t length() const
Returns the number of 16-bit code units in the text.
#define U16_SET_CP_START(s, start, i)
Adjust a random-access offset to a code point boundary at the start of a code point.
UBool operator!=(const UnicodeString &text) const
Inequality operator.
A string-like object that points to a sized piece of memory.
virtual UChar32 getChar32At(int32_t offset) const =0
Virtual version of char32At().
UnicodeString & reverse(void)
Reverse this UnicodeString in place.
int32_t getCapacity(void) const
Return the capacity of the internal buffer of the UnicodeString object.
UnicodeString & replace(int32_t start, int32_t length, const UnicodeString &srcText, int32_t srcStart, int32_t srcLength)
Replace the characters in the range [start, start + length) with the characters in srcText in the ran...
Replaceable is an abstract base class representing a string of characters that supports the replaceme...
int8_t compareCodePointOrder(const UnicodeString &text) const
Compare two Unicode strings in code point order.
unsigned char uint8_t
Define 64 bit limits.
unsigned int uint32_t
Define 64 bit limits.
virtual int32_t getLength() const =0
Virtual version of length().
UChar operator[](int32_t offset) const
Return the code unit at offset offset.
UBool truncate(int32_t targetLength)
Truncate this UnicodeString to the targetLength.
EInvariant
Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor which constructs a ...
UChar charAt(int32_t offset) const
Return the code unit at offset offset.
UnicodeString & append(const UnicodeString &srcText, int32_t srcStart, int32_t srcLength)
Append the characters in srcText in the range [srcStart, srcStart + srcLength) to the UnicodeString o...
int8_t compareCodePointOrderBetween(int32_t start, int32_t limit, const UnicodeString &srcText, int32_t srcStart, int32_t srcLimit) const
Compare two Unicode strings in code point order.
UnicodeString & findAndReplace(const UnicodeString &oldText, const UnicodeString &newText)
Replace all occurrences of characters in oldText with the characters in newText.
virtual void extractBetween(int32_t start, int32_t limit, UnicodeString &target) const =0
Copies characters in the range [start, limit) into the UnicodeString target.
virtual void copy(int32_t start, int32_t limit, int32_t dest)=0
Copies a substring of this object, retaining metadata.
C++ API: StringPiece: Read-only byte string wrapper class.
UnicodeString & remove(void)
Remove all characters from the UnicodeString object.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
C++ API: Interface for writing bytes, and implementation classes.
#define U16_MAX_LENGTH
The maximum number of 16-bit code units per Unicode code point (U+0000..U+10ffff).
int8_t compare(const UnicodeString &text) const
Compare the characters bitwise in this UnicodeString to the characters in text.
int32_t getChar32Limit(int32_t offset) const
Adjust a random-access offset so that it points behind a Unicode character.
#define U16_SET_CP_LIMIT(s, start, i, length)
Adjust a random-access offset to a code point boundary after a code point.
int32_t lastIndexOf(const UnicodeString &text) const
Locate in this the last occurrence of the characters in text, using bitwise comparison.
int32_t indexOf(const UnicodeString &text) const
Locate in this the first occurrence of the characters in text, using bitwise comparison.
virtual Replaceable * clone() const
Clone this object, an instance of a subclass of Replaceable.
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
virtual UChar getCharAt(int32_t offset) const =0
Virtual version of charAt().
#define NULL
Define NULL if necessary, to 0 for C++ and to ((void *)0) for C.
UBool isBogus(void) const
Determine if this object contains a valid string.
C++ API: Central ICU header for including the C++ standard <string> header and for related definition...
UBool startsWith(const UnicodeString &text) const
Determine if this starts with the characters in text
UnicodeString & removeBetween(int32_t start, int32_t limit=(int32_t) INT32_MAX)
Remove the characters in the range [start, limit) from the UnicodeString object.
UnicodeString & operator+=(UChar ch)
Append operator.
virtual UBool hasMetaData() const
Returns true if this object contains metadata.
int32_t length(void) const
Return the length of the UnicodeString object.
#define TRUE
The TRUE value of a UBool.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UBool endsWith(const UnicodeString &text) const
Determine if this ends with the characters in text
U_COMMON_API UnicodeString operator+(const UnicodeString &s1, const UnicodeString &s2)
Create a new UnicodeString with the concatenation of two others.
A concrete subclass of CharacterIterator that iterates over the characters (code units or code points...
uint16_t UChar
Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned.
int8_t compareBetween(int32_t start, int32_t limit, const UnicodeString &srcText, int32_t srcStart, int32_t srcLimit) const
Compare the characters bitwise in the range [start, limit) with the characters in srcText in the rang...
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API If the compiler doesn't support namespaces...
virtual void handleReplaceBetween(int32_t start, int32_t limit, const UnicodeString &text)=0
Replaces a substring of this object with the given text.
UBool operator<=(const UnicodeString &text) const
Less than or equal operator.
signed char int8_t
Define 64 bit limits.
const UChar * getTerminatedBuffer()
Get a read-only pointer to the internal buffer, making sure that it is NUL-terminated.
UnicodeString & operator=(const UnicodeString &srcText)
Assignment operator.
struct UConverter UConverter
#define INT32_MAX
The largest value a 32 bit signed integer can hold.
void * UClassID
UClassID is used to identify classes without using RTTI, since RTTI is not yet supported by all C++ c...
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
UChar32 char32At(int32_t offset) const
Return the code point that contains the code unit at offset offset.
UChar charAt(int32_t offset) const
Returns the 16-bit code unit at the given offset into the text.
UnicodeString & insert(int32_t start, const UnicodeString &srcText, int32_t srcStart, int32_t srcLength)
Insert the characters in srcText in the range [srcStart, srcStart + srcLength) into the UnicodeString...
UnicodeString & setTo(const UnicodeString &srcText, int32_t srcStart)
Set the text in the UnicodeString object to the characters in srcText in the range [srcStart...
#define UINT32_MAX
The largest value a 32 bit unsigned integer can hold.
unsigned short uint16_t
Define 64 bit limits.
UBool operator<(const UnicodeString &text) const
Less than operator.
Basic definitions for ICU, for both C and C++ APIs.
UBool isEmpty(void) const
Determine if this string is empty.
int32_t u_strlen(const UChar *s)
Determine the length of an array of UChar.
#define FALSE
The FALSE value of a UBool.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside...
#define U16_APPEND(s, i, capacity, c, isError)
Append a code point to a string, overwriting 1 or 2 code units.
UChar32 char32At(int32_t offset) const
Returns the 32-bit code point at the given 16-bit offset into the text.
A Locale object represents a specific geographical, political, or cultural region.
UBool operator==(const UnicodeString &text) const
Equality operator.
virtual UClassID getDynamicClassID() const =0
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
UBool operator>=(const UnicodeString &text) const
Greater than or equal operator.
void extractBetween(int32_t start, int32_t limit, UChar *dst, int32_t dstStart=0) const
Copy the characters in the range [start, limit) into the array dst, beginning at dstStart.
signed int int32_t
Define 64 bit limits.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
int8_t UBool
The ICU boolean type.
UnicodeString & replaceBetween(int32_t start, int32_t limit, const UnicodeString &srcText)
Replace the characters in the range [start, limit) with the characters in srcText.
C++ API: Replaceable String.