37 class StringThreadTest;
39 #ifndef U_COMPARE_CODE_POINT_ORDER
46 #define U_COMPARE_CODE_POINT_ORDER 0x8000
57 #ifndef U_STRING_CASE_MAPPER_DEFINED
58 #define U_STRING_CASE_MAPPER_DEFINED
66 UChar *dest, int32_t destCapacity,
67 const UChar *src, int32_t srcLength,
91 #define US_INV icu::UnicodeString::kInvariant
110 #if defined(U_DECLARE_UTF16)
111 # define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)U_DECLARE_UTF16(cs), _length)
112 #elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16)))
113 # define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)L ## cs, _length)
114 #elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
115 # define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)cs, _length)
117 # define UNICODE_STRING(cs, _length) icu::UnicodeString(cs, _length, US_INV)
133 #define UNICODE_STRING_SIMPLE(cs) UNICODE_STRING(cs, -1)
142 #ifndef UNISTR_FROM_CHAR_EXPLICIT
143 # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
145 # define UNISTR_FROM_CHAR_EXPLICIT explicit
148 # define UNISTR_FROM_CHAR_EXPLICIT
162 #ifndef UNISTR_FROM_STRING_EXPLICIT
163 # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
165 # define UNISTR_FROM_STRING_EXPLICIT explicit
168 # define UNISTR_FROM_STRING_EXPLICIT
348 inline int8_t compare(int32_t start,
369 inline int8_t compare(int32_t start,
373 int32_t srcLength)
const;
387 inline int8_t compare(
const UChar *srcChars,
388 int32_t srcLength)
const;
404 inline int8_t compare(int32_t start,
406 const UChar *srcChars)
const;
425 inline int8_t compare(int32_t start,
427 const UChar *srcChars,
429 int32_t srcLength)
const;
448 inline int8_t compareBetween(int32_t start,
452 int32_t srcLimit)
const;
471 inline int8_t compareCodePointOrder(
const UnicodeString& text)
const;
492 inline int8_t compareCodePointOrder(int32_t start,
517 inline int8_t compareCodePointOrder(int32_t start,
521 int32_t srcLength)
const;
541 inline int8_t compareCodePointOrder(
const UChar *srcChars,
542 int32_t srcLength)
const;
563 inline int8_t compareCodePointOrder(int32_t start,
565 const UChar *srcChars)
const;
588 inline int8_t compareCodePointOrder(int32_t start,
590 const UChar *srcChars,
592 int32_t srcLength)
const;
615 inline int8_t compareCodePointOrderBetween(int32_t start,
619 int32_t srcLimit)
const;
639 inline int8_t caseCompare(
const UnicodeString& text, uint32_t options)
const;
661 inline int8_t caseCompare(int32_t start,
664 uint32_t options)
const;
688 inline int8_t caseCompare(int32_t start,
693 uint32_t options)
const;
714 inline int8_t caseCompare(
const UChar *srcChars,
716 uint32_t options)
const;
738 inline int8_t caseCompare(int32_t start,
740 const UChar *srcChars,
741 uint32_t options)
const;
765 inline int8_t caseCompare(int32_t start,
767 const UChar *srcChars,
770 uint32_t options)
const;
794 inline int8_t caseCompareBetween(int32_t start,
799 uint32_t options)
const;
822 int32_t srcLength)
const;
832 inline UBool startsWith(
const UChar *srcChars,
833 int32_t srcLength)
const;
844 inline UBool startsWith(
const UChar *srcChars,
846 int32_t srcLength)
const;
869 int32_t srcLength)
const;
880 int32_t srcLength)
const;
894 int32_t srcLength)
const;
919 int32_t start)
const;
934 int32_t length)
const;
956 int32_t length)
const;
969 inline int32_t indexOf(
const UChar *srcChars,
971 int32_t start)
const;
985 inline int32_t indexOf(
const UChar *srcChars,
988 int32_t length)
const;
1006 int32_t indexOf(
const UChar *srcChars,
1010 int32_t length)
const;
1019 inline int32_t indexOf(
UChar c)
const;
1029 inline int32_t indexOf(
UChar32 c)
const;
1039 inline int32_t indexOf(
UChar c,
1040 int32_t start)
const;
1051 inline int32_t indexOf(
UChar32 c,
1052 int32_t start)
const;
1064 inline int32_t indexOf(
UChar c,
1066 int32_t length)
const;
1079 inline int32_t indexOf(
UChar32 c,
1081 int32_t length)
const;
1091 inline int32_t lastIndexOf(
const UnicodeString& text)
const;
1103 int32_t start)
const;
1118 int32_t length)
const;
1140 int32_t length)
const;
1152 inline int32_t lastIndexOf(
const UChar *srcChars,
1154 int32_t start)
const;
1168 inline int32_t lastIndexOf(
const UChar *srcChars,
1171 int32_t length)
const;
1189 int32_t lastIndexOf(
const UChar *srcChars,
1193 int32_t length)
const;
1202 inline int32_t lastIndexOf(
UChar c)
const;
1212 inline int32_t lastIndexOf(
UChar32 c)
const;
1222 inline int32_t lastIndexOf(
UChar c,
1223 int32_t start)
const;
1234 inline int32_t lastIndexOf(
UChar32 c,
1235 int32_t start)
const;
1247 inline int32_t lastIndexOf(
UChar c,
1249 int32_t length)
const;
1262 inline int32_t lastIndexOf(
UChar32 c,
1264 int32_t length)
const;
1286 inline UChar operator[] (int32_t offset)
const;
1316 int32_t getChar32Start(int32_t offset)
const;
1334 int32_t getChar32Limit(int32_t offset)
const;
1386 int32_t moveIndex32(int32_t index, int32_t delta)
const;
1405 inline void extract(int32_t start,
1408 int32_t dstStart = 0)
const;
1432 extract(
UChar *dest, int32_t destCapacity,
1445 inline void extract(int32_t start,
1463 int32_t dstStart = 0)
const;
1499 int32_t extract(int32_t start,
1500 int32_t startLength,
1502 int32_t targetCapacity,
1503 enum EInvariant inv)
const;
1505 #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
1526 int32_t extract(int32_t start,
1527 int32_t startLength,
1529 uint32_t targetLength)
const;
1533 #if !UCONFIG_NO_CONVERSION
1560 inline int32_t extract(int32_t start,
1561 int32_t startLength,
1563 const char *codepage = 0)
const;
1594 int32_t extract(int32_t start,
1595 int32_t startLength,
1597 uint32_t targetLength,
1598 const char *codepage)
const;
1617 int32_t extract(
char *dest, int32_t destCapacity,
1663 #if U_HAVE_STD_STRING
1677 template<
typename StringClass>
1678 StringClass &toUTF8String(StringClass &result)
const {
1679 StringByteSink<StringClass> sbs(&result);
1713 inline int32_t
length(
void)
const;
1729 countChar32(int32_t start=0, int32_t length=
INT32_MAX)
const;
1755 hasMoreChar32Than(int32_t start, int32_t length, int32_t number)
const;
1762 inline UBool isEmpty(
void)
const;
1773 inline int32_t getCapacity(
void)
const;
1782 inline int32_t hashCode(
void)
const;
1796 inline UBool isBogus(
void)
const;
1948 int32_t textLength);
1971 int32_t buffCapacity);
2173 const UChar *srcChars,
2187 const UChar *srcChars,
2273 const UChar *srcChars,
2291 const UChar *srcChars,
2391 virtual void copy(int32_t start, int32_t limit, int32_t dest);
2504 UBool padLeading(int32_t targetLength,
2505 UChar padChar = 0x0020);
2518 UBool padTrailing(int32_t targetLength,
2519 UChar padChar = 0x0020);
2527 inline UBool truncate(int32_t targetLength);
2591 #if !UCONFIG_NO_BREAK_ITERATION
2745 UChar *getBuffer(int32_t minCapacity);
2767 void releaseBuffer(int32_t newLength=-1);
2799 inline const UChar *getBuffer()
const;
2834 inline const UChar *getTerminatedBuffer();
2900 int32_t textLength);
2923 int32_t textLength);
2945 #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
2976 UnicodeString(
const char *codepageData, int32_t dataLength);
2980 #if !UCONFIG_NO_CONVERSION
2999 UnicodeString(
const char *codepageData,
const char *codepage);
3018 UnicodeString(
const char *codepageData, int32_t dataLength,
const char *codepage);
3042 const char *src, int32_t srcLength,
3072 UnicodeString(
const char *src, int32_t length,
enum EInvariant inv);
3207 UChar32 unescapeAt(int32_t &offset)
const;
3214 static UClassID U_EXPORT2 getStaticClassID();
3257 toUTF8(int32_t start, int32_t len,
3258 char *target, int32_t capacity)
const;
3262 doCompare(int32_t start,
3266 int32_t srcLength)
const;
3268 int8_t doCompare(int32_t start,
3270 const UChar *srcChars,
3272 int32_t srcLength)
const;
3275 doCompareCodePointOrder(int32_t start,
3279 int32_t srcLength)
const;
3281 int8_t doCompareCodePointOrder(int32_t start,
3283 const UChar *srcChars,
3285 int32_t srcLength)
const;
3288 doCaseCompare(int32_t start,
3293 uint32_t options)
const;
3296 doCaseCompare(int32_t start,
3298 const UChar *srcChars,
3301 uint32_t options)
const;
3303 int32_t doIndexOf(
UChar c,
3305 int32_t length)
const;
3309 int32_t length)
const;
3311 int32_t doLastIndexOf(
UChar c,
3313 int32_t length)
const;
3315 int32_t doLastIndexOf(
UChar32 c,
3317 int32_t length)
const;
3319 void doExtract(int32_t start,
3322 int32_t dstStart)
const;
3324 inline void doExtract(int32_t start,
3328 inline UChar doCharAt(int32_t offset)
const;
3338 const UChar *srcChars,
3346 int32_t doHashCode(
void)
const;
3350 inline UChar* getArrayStart(
void);
3351 inline const UChar* getArrayStart(
void)
const;
3355 inline UBool isWritable()
const;
3358 inline UBool isBufferWritable()
const;
3361 inline void setLength(int32_t len);
3362 inline void setToEmpty();
3363 inline void setArray(
UChar *array, int32_t len, int32_t capacity);
3369 UBool allocate(int32_t capacity);
3372 void releaseArray(
void);
3381 inline void pinIndex(int32_t& start)
const;
3382 inline void pinIndices(int32_t& start,
3383 int32_t& length)
const;
3385 #if !UCONFIG_NO_CONVERSION
3388 int32_t doExtract(int32_t start, int32_t length,
3389 char *dest, int32_t destCapacity,
3403 void doCodepageCreate(
const char *codepageData,
3405 const char *codepage);
3412 doCodepageCreate(
const char *codepageData,
3430 UBool cloneArrayIfNeeded(int32_t newCapacity = -1,
3431 int32_t growCapacity = -1,
3433 int32_t **pBufferToDelete = 0,
3446 int32_t removeRef(
void);
3447 int32_t refCount(
void)
const;
3453 US_STACKBUF_SIZE=
sizeof(
void *)==4 ? 13 : 15,
3454 kInvalidUChar=0xffff,
3461 kUsingStackBuffer=2,
3463 kBufferIsReadonly=8,
3468 kShortString=kUsingStackBuffer,
3469 kLongString=kRefCounted,
3470 kReadonlyAlias=kBufferIsReadonly,
3474 friend class StringThreadTest;
3477 union StackBufferOrFields;
3478 friend union StackBufferOrFields;
3515 union StackBufferOrFields {
3518 UChar fStackBuffer[8];
3525 UChar fRestOfStackBuffer[US_STACKBUF_SIZE-8];
3526 int8_t fShortLength;
3550 UnicodeString::pinIndex(int32_t& start)
const
3555 }
else if(start >
length()) {
3561 UnicodeString::pinIndices(int32_t& start,
3562 int32_t& _length)
const
3568 }
else if(start > len) {
3573 }
else if(_length > (len - start)) {
3574 _length = (len - start);
3579 UnicodeString::getArrayStart()
3580 {
return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.fArray; }
3583 UnicodeString::getArrayStart()
const
3584 {
return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.fArray; }
3591 {
return fShortLength>=0 ? fShortLength : fUnion.fFields.fLength; }
3595 {
return (fFlags&kUsingStackBuffer) ? US_STACKBUF_SIZE : fUnion.fFields.fCapacity; }
3599 {
return doHashCode(); }
3603 {
return (
UBool)(fFlags & kIsBogus); }
3606 UnicodeString::isWritable()
const
3607 {
return (
UBool)!(fFlags&(kOpenGetBuffer|kIsBogus)); }
3610 UnicodeString::isBufferWritable()
const
3613 !(fFlags&(kOpenGetBuffer|kIsBogus|kBufferIsReadonly)) &&
3614 (!(fFlags&kRefCounted) || refCount()==1));
3617 inline const UChar *
3619 if(fFlags&(kIsBogus|kOpenGetBuffer)) {
3621 }
else if(fFlags&kUsingStackBuffer) {
3622 return fUnion.fStackBuffer;
3624 return fUnion.fFields.fArray;
3632 UnicodeString::doCompare(int32_t start,
3636 int32_t srcLength)
const
3639 return (int8_t)!isBogus();
3641 srcText.pinIndices(srcStart, srcLength);
3642 return doCompare(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
3655 len == textLength &&
3656 doCompare(0, len, text, 0, textLength) == 0;
3662 {
return (!
operator==(text)); }
3666 {
return doCompare(0,
length(), text, 0, text.
length()) == 1; }
3670 {
return doCompare(0,
length(), text, 0, text.
length()) == -1; }
3674 {
return doCompare(0,
length(), text, 0, text.
length()) != -1; }
3678 {
return doCompare(0,
length(), text, 0, text.
length()) != 1; }
3682 {
return doCompare(0,
length(), text, 0, text.
length()); }
3688 {
return doCompare(start, _length, srcText, 0, srcText.
length()); }
3692 int32_t srcLength)
const
3693 {
return doCompare(0,
length(), srcChars, 0, srcLength); }
3700 int32_t srcLength)
const
3701 {
return doCompare(start, _length, srcText, srcStart, srcLength); }
3706 const UChar *srcChars)
const
3707 {
return doCompare(start, _length, srcChars, 0, _length); }
3712 const UChar *srcChars,
3714 int32_t srcLength)
const
3715 {
return doCompare(start, _length, srcChars, srcStart, srcLength); }
3722 int32_t srcLimit)
const
3723 {
return doCompare(start, limit - start,
3724 srcText, srcStart, srcLimit - srcStart); }
3727 UnicodeString::doCompareCodePointOrder(int32_t start,
3731 int32_t srcLength)
const
3734 return (int8_t)!isBogus();
3736 srcText.pinIndices(srcStart, srcLength);
3737 return doCompareCodePointOrder(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
3743 {
return doCompareCodePointOrder(0,
length(), text, 0, text.
length()); }
3749 {
return doCompareCodePointOrder(start, _length, srcText, 0, srcText.
length()); }
3753 int32_t srcLength)
const
3754 {
return doCompareCodePointOrder(0,
length(), srcChars, 0, srcLength); }
3761 int32_t srcLength)
const
3762 {
return doCompareCodePointOrder(start, _length, srcText, srcStart, srcLength); }
3767 const UChar *srcChars)
const
3768 {
return doCompareCodePointOrder(start, _length, srcChars, 0, _length); }
3773 const UChar *srcChars,
3775 int32_t srcLength)
const
3776 {
return doCompareCodePointOrder(start, _length, srcChars, srcStart, srcLength); }
3783 int32_t srcLimit)
const
3784 {
return doCompareCodePointOrder(start, limit - start,
3785 srcText, srcStart, srcLimit - srcStart); }
3788 UnicodeString::doCaseCompare(int32_t start,
3793 uint32_t options)
const
3796 return (int8_t)!isBogus();
3798 srcText.pinIndices(srcStart, srcLength);
3799 return doCaseCompare(start, thisLength, srcText.getArrayStart(), srcStart, srcLength, options);
3805 return doCaseCompare(0,
length(), text, 0, text.
length(), options);
3812 uint32_t options)
const {
3813 return doCaseCompare(start, _length, srcText, 0, srcText.
length(), options);
3819 uint32_t options)
const {
3820 return doCaseCompare(0,
length(), srcChars, 0, srcLength, options);
3829 uint32_t options)
const {
3830 return doCaseCompare(start, _length, srcText, srcStart, srcLength, options);
3836 const UChar *srcChars,
3837 uint32_t options)
const {
3838 return doCaseCompare(start, _length, srcChars, 0, _length, options);
3844 const UChar *srcChars,
3847 uint32_t options)
const {
3848 return doCaseCompare(start, _length, srcChars, srcStart, srcLength, options);
3857 uint32_t options)
const {
3858 return doCaseCompare(start, limit - start, srcText, srcStart, srcLimit - srcStart, options);
3866 int32_t _length)
const
3869 srcText.pinIndices(srcStart, srcLength);
3871 return indexOf(srcText.getArrayStart(), srcStart, srcLength, start, _length);
3879 {
return indexOf(text, 0, text.
length(), 0,
length()); }
3883 int32_t start)
const {
3885 return indexOf(text, 0, text.
length(), start,
length() - start);
3891 int32_t _length)
const
3892 {
return indexOf(text, 0, text.
length(), start, _length); }
3897 int32_t start)
const {
3899 return indexOf(srcChars, 0, srcLength, start,
length() - start);
3906 int32_t _length)
const
3907 {
return indexOf(srcChars, 0, srcLength, start, _length); }
3912 int32_t _length)
const
3913 {
return doIndexOf(c, start, _length); }
3918 int32_t _length)
const
3919 {
return doIndexOf(c, start, _length); }
3923 {
return doIndexOf(c, 0,
length()); }
3927 {
return indexOf(c, 0,
length()); }
3931 int32_t start)
const {
3933 return doIndexOf(c, start,
length() - start);
3938 int32_t start)
const {
3940 return indexOf(c, start,
length() - start);
3947 int32_t _length)
const
3948 {
return lastIndexOf(srcChars, 0, srcLength, start, _length); }
3953 int32_t start)
const {
3955 return lastIndexOf(srcChars, 0, srcLength, start,
length() - start);
3963 int32_t _length)
const
3966 srcText.pinIndices(srcStart, srcLength);
3968 return lastIndexOf(srcText.getArrayStart(), srcStart, srcLength, start, _length);
3977 int32_t _length)
const
3978 {
return lastIndexOf(text, 0, text.
length(), start, _length); }
3982 int32_t start)
const {
3984 return lastIndexOf(text, 0, text.
length(), start,
length() - start);
3989 {
return lastIndexOf(text, 0, text.
length(), 0,
length()); }
3994 int32_t _length)
const
3995 {
return doLastIndexOf(c, start, _length); }
4000 int32_t _length)
const {
4001 return doLastIndexOf(c, start, _length);
4006 {
return doLastIndexOf(c, 0,
length()); }
4010 return lastIndexOf(c, 0,
length());
4015 int32_t start)
const {
4017 return doLastIndexOf(c, start,
length() - start);
4022 int32_t start)
const {
4024 return lastIndexOf(c, start,
length() - start);
4029 {
return compare(0, text.
length(), text, 0, text.
length()) == 0; }
4034 int32_t srcLength)
const
4035 {
return doCompare(0, srcLength, srcText, srcStart, srcLength) == 0; }
4042 return doCompare(0, srcLength, srcChars, 0, srcLength) == 0;
4050 return doCompare(0, srcLength, srcChars, srcStart, srcLength) == 0;
4056 text, 0, text.
length()) == 0; }
4061 int32_t srcLength)
const {
4062 srcText.pinIndices(srcStart, srcLength);
4063 return doCompare(
length() - srcLength, srcLength,
4064 srcText, srcStart, srcLength) == 0;
4069 int32_t srcLength)
const {
4073 return doCompare(
length() - srcLength, srcLength,
4074 srcChars, 0, srcLength) == 0;
4080 int32_t srcLength)
const {
4082 srcLength =
u_strlen(srcChars + srcStart);
4084 return doCompare(
length() - srcLength, srcLength,
4085 srcChars, srcStart, srcLength) == 0;
4095 {
return doReplace(start, _length, srcText, 0, srcText.
length()); }
4103 {
return doReplace(start, _length, srcText, srcStart, srcLength); }
4108 const UChar *srcChars,
4110 {
return doReplace(start, _length, srcChars, 0, srcLength); }
4115 const UChar *srcChars,
4118 {
return doReplace(start, _length, srcChars, srcStart, srcLength); }
4124 {
return doReplace(start, _length, &srcChar, 0, 1); }
4130 {
return doReplace(start, limit - start, srcText, 0, srcText.
length()); }
4138 {
return doReplace(start, limit - start, srcText, srcStart, srcLimit - srcStart); }
4143 {
return findAndReplace(0,
length(), oldText, 0, oldText.
length(),
4144 newText, 0, newText.
length()); }
4151 {
return findAndReplace(start, _length, oldText, 0, oldText.
length(),
4152 newText, 0, newText.
length()); }
4158 UnicodeString::doExtract(int32_t start,
4161 { target.
replace(0, target.
length(), *
this, start, _length); }
4167 int32_t targetStart)
const
4168 { doExtract(start, _length, target, targetStart); }
4174 { doExtract(start, _length, target); }
4176 #if !UCONFIG_NO_CONVERSION
4182 const char *codepage)
const
4186 return extract(start, _length, dst, dst!=0 ? 0xffffffff : 0, codepage);
4195 int32_t dstStart)
const {
4198 doExtract(start, limit - start, dst, dstStart);
4203 return tempSubString(start, limit - start);
4207 UnicodeString::doCharAt(int32_t offset)
const
4209 if((uint32_t)offset < (uint32_t)
length()) {
4210 return getArrayStart()[offset];
4212 return kInvalidUChar;
4218 {
return doCharAt(offset); }
4222 {
return doCharAt(offset); }
4226 return fShortLength == 0;
4233 UnicodeString::setLength(int32_t len) {
4235 fShortLength = (int8_t)len;
4237 fShortLength = (int8_t)-1;
4238 fUnion.fFields.fLength = len;
4243 UnicodeString::setToEmpty() {
4245 fFlags = kShortString;
4249 UnicodeString::setArray(
UChar *array, int32_t len, int32_t capacity) {
4251 fUnion.fFields.fArray = array;
4252 fUnion.fFields.fCapacity = capacity;
4255 inline const UChar *
4260 UChar *array = getArrayStart();
4262 if(len < getCapacity() && ((fFlags&kRefCounted) == 0 || refCount() == 1)) {
4269 if(!(fFlags&kBufferIsReadonly)) {
4287 }
else if(cloneArrayIfNeeded(len+1)) {
4288 array = getArrayStart();
4299 {
return doReplace(0,
length(), &ch, 0, 1); }
4303 {
return replace(0,
length(), ch); }
4311 return doReplace(0,
length(), srcText, srcStart, srcLength);
4319 srcText.pinIndex(srcStart);
4320 return doReplace(0,
length(), srcText, srcStart, srcText.
length() - srcStart);
4326 return copyFrom(srcText);
4334 return doReplace(0,
length(), srcChars, 0, srcLength);
4341 return doReplace(0,
length(), &srcChar, 0, 1);
4348 return replace(0,
length(), srcChar);
4355 {
return doReplace(
length(), 0, srcText, srcStart, srcLength); }
4359 {
return doReplace(
length(), 0, srcText, 0, srcText.
length()); }
4365 {
return doReplace(
length(), 0, srcChars, srcStart, srcLength); }
4370 {
return doReplace(
length(), 0, srcChars, 0, srcLength); }
4374 {
return doReplace(
length(), 0, &srcChar, 0, 1); }
4378 {
return doReplace(
length(), 0, &ch, 0, 1); }
4387 {
return doReplace(
length(), 0, srcText, 0, srcText.
length()); }
4394 {
return doReplace(start, 0, srcText, srcStart, srcLength); }
4399 {
return doReplace(start, 0, srcText, 0, srcText.
length()); }
4403 const UChar *srcChars,
4406 {
return doReplace(start, 0, srcChars, srcStart, srcLength); }
4410 const UChar *srcChars,
4412 {
return doReplace(start, 0, srcChars, 0, srcLength); }
4417 {
return doReplace(start, 0, &srcChar, 0, 1); }
4422 {
return replace(start, 0, srcChar); }
4431 if(fFlags & (kIsBogus|kBufferIsReadonly)) {
4443 if(start <= 0 && _length ==
INT32_MAX) {
4447 return doReplace(start, _length,
NULL, 0, 0);
4453 {
return doReplace(start, limit - start,
NULL, 0, 0); }
4458 return doReplace(0, start,
NULL, 0, 0);
4464 if(isBogus() && targetLength == 0) {
4468 }
else if((uint32_t)targetLength < (uint32_t)
length()) {
4469 setLength(targetLength);
4470 if(fFlags&kBufferIsReadonly) {
4471 fUnion.fFields.fCapacity = targetLength;
4481 {
return doReverse(0,
length()); }
4486 {
return doReverse(start, _length); }