37 class StringThreadTest;
39 #ifndef U_COMPARE_CODE_POINT_ORDER
46 #define U_COMPARE_CODE_POINT_ORDER 0x8000
57 #ifndef U_HIDE_INTERNAL_API
63 #ifndef U_STRING_CASE_MAPPER_DEFINED
64 #define U_STRING_CASE_MAPPER_DEFINED
72 UChar *dest, int32_t destCapacity,
73 const UChar *src, int32_t srcLength,
83 class StringCharacterIterator;
84 class UnicodeStringAppendable;
98 #define US_INV icu::UnicodeString::kInvariant
117 #if defined(U_DECLARE_UTF16)
118 # define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)U_DECLARE_UTF16(cs), _length)
119 #elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16)))
120 # define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)L ## cs, _length)
121 #elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
122 # define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const UChar *)cs, _length)
124 # define UNICODE_STRING(cs, _length) icu::UnicodeString(cs, _length, US_INV)
140 #define UNICODE_STRING_SIMPLE(cs) UNICODE_STRING(cs, -1)
149 #ifndef UNISTR_FROM_CHAR_EXPLICIT
150 # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
152 # define UNISTR_FROM_CHAR_EXPLICIT explicit
155 # define UNISTR_FROM_CHAR_EXPLICIT
169 #ifndef UNISTR_FROM_STRING_EXPLICIT
170 # if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
172 # define UNISTR_FROM_STRING_EXPLICIT explicit
175 # define UNISTR_FROM_STRING_EXPLICIT
355 inline int8_t compare(int32_t start,
376 inline int8_t compare(int32_t start,
380 int32_t srcLength)
const;
394 inline int8_t compare(
const UChar *srcChars,
395 int32_t srcLength)
const;
411 inline int8_t compare(int32_t start,
413 const UChar *srcChars)
const;
432 inline int8_t compare(int32_t start,
434 const UChar *srcChars,
436 int32_t srcLength)
const;
455 inline int8_t compareBetween(int32_t start,
459 int32_t srcLimit)
const;
478 inline int8_t compareCodePointOrder(
const UnicodeString& text)
const;
499 inline int8_t compareCodePointOrder(int32_t start,
524 inline int8_t compareCodePointOrder(int32_t start,
528 int32_t srcLength)
const;
548 inline int8_t compareCodePointOrder(
const UChar *srcChars,
549 int32_t srcLength)
const;
570 inline int8_t compareCodePointOrder(int32_t start,
572 const UChar *srcChars)
const;
595 inline int8_t compareCodePointOrder(int32_t start,
597 const UChar *srcChars,
599 int32_t srcLength)
const;
622 inline int8_t compareCodePointOrderBetween(int32_t start,
626 int32_t srcLimit)
const;
646 inline int8_t caseCompare(
const UnicodeString& text, uint32_t options)
const;
668 inline int8_t caseCompare(int32_t start,
671 uint32_t options)
const;
695 inline int8_t caseCompare(int32_t start,
700 uint32_t options)
const;
721 inline int8_t caseCompare(
const UChar *srcChars,
723 uint32_t options)
const;
745 inline int8_t caseCompare(int32_t start,
747 const UChar *srcChars,
748 uint32_t options)
const;
772 inline int8_t caseCompare(int32_t start,
774 const UChar *srcChars,
777 uint32_t options)
const;
801 inline int8_t caseCompareBetween(int32_t start,
806 uint32_t options)
const;
829 int32_t srcLength)
const;
839 inline UBool startsWith(
const UChar *srcChars,
840 int32_t srcLength)
const;
851 inline UBool startsWith(
const UChar *srcChars,
853 int32_t srcLength)
const;
876 int32_t srcLength)
const;
887 int32_t srcLength)
const;
901 int32_t srcLength)
const;
926 int32_t start)
const;
941 int32_t length)
const;
963 int32_t length)
const;
976 inline int32_t indexOf(
const UChar *srcChars,
978 int32_t start)
const;
992 inline int32_t indexOf(
const UChar *srcChars,
995 int32_t length)
const;
1013 int32_t indexOf(
const UChar *srcChars,
1017 int32_t length)
const;
1026 inline int32_t indexOf(
UChar c)
const;
1036 inline int32_t indexOf(
UChar32 c)
const;
1046 inline int32_t indexOf(
UChar c,
1047 int32_t start)
const;
1058 inline int32_t indexOf(
UChar32 c,
1059 int32_t start)
const;
1071 inline int32_t indexOf(
UChar c,
1073 int32_t length)
const;
1086 inline int32_t indexOf(
UChar32 c,
1088 int32_t length)
const;
1098 inline int32_t lastIndexOf(
const UnicodeString& text)
const;
1110 int32_t start)
const;
1125 int32_t length)
const;
1147 int32_t length)
const;
1159 inline int32_t lastIndexOf(
const UChar *srcChars,
1161 int32_t start)
const;
1175 inline int32_t lastIndexOf(
const UChar *srcChars,
1178 int32_t length)
const;
1196 int32_t lastIndexOf(
const UChar *srcChars,
1200 int32_t length)
const;
1209 inline int32_t lastIndexOf(
UChar c)
const;
1219 inline int32_t lastIndexOf(
UChar32 c)
const;
1229 inline int32_t lastIndexOf(
UChar c,
1230 int32_t start)
const;
1241 inline int32_t lastIndexOf(
UChar32 c,
1242 int32_t start)
const;
1254 inline int32_t lastIndexOf(
UChar c,
1256 int32_t length)
const;
1269 inline int32_t lastIndexOf(
UChar32 c,
1271 int32_t length)
const;
1293 inline UChar operator[] (int32_t offset)
const;
1323 int32_t getChar32Start(int32_t offset)
const;
1341 int32_t getChar32Limit(int32_t offset)
const;
1393 int32_t moveIndex32(int32_t index, int32_t delta)
const;
1412 inline void extract(int32_t start,
1415 int32_t dstStart = 0)
const;
1439 extract(
UChar *dest, int32_t destCapacity,
1452 inline void extract(int32_t start,
1470 int32_t dstStart = 0)
const;
1506 int32_t extract(int32_t start,
1507 int32_t startLength,
1509 int32_t targetCapacity,
1510 enum EInvariant inv)
const;
1512 #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
1533 int32_t extract(int32_t start,
1534 int32_t startLength,
1536 uint32_t targetLength)
const;
1540 #if !UCONFIG_NO_CONVERSION
1567 inline int32_t extract(int32_t start,
1568 int32_t startLength,
1570 const char *codepage = 0)
const;
1601 int32_t extract(int32_t start,
1602 int32_t startLength,
1604 uint32_t targetLength,
1605 const char *codepage)
const;
1624 int32_t extract(
char *dest, int32_t destCapacity,
1670 #if U_HAVE_STD_STRING
1684 template<
typename StringClass>
1720 inline int32_t
length(
void)
const;
1736 countChar32(int32_t start=0, int32_t length=
INT32_MAX)
const;
1762 hasMoreChar32Than(int32_t start, int32_t length, int32_t number)
const;
1769 inline UBool isEmpty(
void)
const;
1780 inline int32_t getCapacity(
void)
const;
1789 inline int32_t hashCode(
void)
const;
1803 inline UBool isBogus(
void)
const;
1960 int32_t textLength);
1983 int32_t buffCapacity);
2185 const UChar *srcChars,
2199 const UChar *srcChars,
2285 const UChar *srcChars,
2303 const UChar *srcChars,
2403 virtual void copy(int32_t start, int32_t limit, int32_t dest);
2516 UBool padLeading(int32_t targetLength,
2517 UChar padChar = 0x0020);
2530 UBool padTrailing(int32_t targetLength,
2531 UChar padChar = 0x0020);
2539 inline UBool truncate(int32_t targetLength);
2603 #if !UCONFIG_NO_BREAK_ITERATION
2759 UChar *getBuffer(int32_t minCapacity);
2781 void releaseBuffer(int32_t newLength=-1);
2813 inline const UChar *getBuffer()
const;
2848 inline const UChar *getTerminatedBuffer();
2914 int32_t textLength);
2940 int32_t textLength);
2962 #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
2993 UnicodeString(
const char *codepageData, int32_t dataLength);
2997 #if !UCONFIG_NO_CONVERSION
3016 UnicodeString(
const char *codepageData,
const char *codepage);
3035 UnicodeString(
const char *codepageData, int32_t dataLength,
const char *codepage);
3059 const char *src, int32_t srcLength,
3089 UnicodeString(
const char *src, int32_t length,
enum EInvariant inv);
3224 UChar32 unescapeAt(int32_t &offset)
const;
3231 static UClassID U_EXPORT2 getStaticClassID();
3274 toUTF8(int32_t start, int32_t len,
3275 char *target, int32_t capacity)
const;
3284 doCompare(int32_t start,
3288 int32_t srcLength)
const;
3290 int8_t doCompare(int32_t start,
3292 const UChar *srcChars,
3294 int32_t srcLength)
const;
3297 doCompareCodePointOrder(int32_t start,
3301 int32_t srcLength)
const;
3303 int8_t doCompareCodePointOrder(int32_t start,
3305 const UChar *srcChars,
3307 int32_t srcLength)
const;
3310 doCaseCompare(int32_t start,
3315 uint32_t options)
const;
3318 doCaseCompare(int32_t start,
3320 const UChar *srcChars,
3323 uint32_t options)
const;
3325 int32_t doIndexOf(
UChar c,
3327 int32_t length)
const;
3331 int32_t length)
const;
3333 int32_t doLastIndexOf(
UChar c,
3335 int32_t length)
const;
3337 int32_t doLastIndexOf(
UChar32 c,
3339 int32_t length)
const;
3341 void doExtract(int32_t start,
3344 int32_t dstStart)
const;
3346 inline void doExtract(int32_t start,
3350 inline UChar doCharAt(int32_t offset)
const;
3360 const UChar *srcChars,
3368 int32_t doHashCode(
void)
const;
3372 inline UChar* getArrayStart(
void);
3373 inline const UChar* getArrayStart(
void)
const;
3377 inline UBool isWritable()
const;
3380 inline UBool isBufferWritable()
const;
3383 inline void setLength(int32_t len);
3384 inline void setToEmpty();
3385 inline void setArray(
UChar *array, int32_t len, int32_t capacity);
3391 UBool allocate(int32_t capacity);
3394 void releaseArray(
void);
3403 inline void pinIndex(int32_t& start)
const;
3404 inline void pinIndices(int32_t& start,
3405 int32_t& length)
const;
3407 #if !UCONFIG_NO_CONVERSION
3410 int32_t doExtract(int32_t start, int32_t length,
3411 char *dest, int32_t destCapacity,
3425 void doCodepageCreate(
const char *codepageData,
3427 const char *codepage);
3434 doCodepageCreate(
const char *codepageData,
3452 UBool cloneArrayIfNeeded(int32_t newCapacity = -1,
3453 int32_t growCapacity = -1,
3455 int32_t **pBufferToDelete = 0,
3468 int32_t removeRef(
void);
3469 int32_t refCount(
void)
const;
3475 US_STACKBUF_SIZE=
sizeof(
void *)==4 ? 13 : 15,
3476 kInvalidUChar=0xffff,
3483 kUsingStackBuffer=2,
3485 kBufferIsReadonly=8,
3490 kShortString=kUsingStackBuffer,
3491 kLongString=kRefCounted,
3492 kReadonlyAlias=kBufferIsReadonly,
3496 friend class StringThreadTest;
3499 union StackBufferOrFields;
3500 friend union StackBufferOrFields;
3537 union StackBufferOrFields {
3540 UChar fStackBuffer[8];
3547 UChar fRestOfStackBuffer[US_STACKBUF_SIZE-8];
3548 int8_t fShortLength;
3561 operator+ (
const UnicodeString &s1,
const UnicodeString &s2);
3572 UnicodeString::pinIndex(int32_t& start)
const
3577 }
else if(start >
length()) {
3583 UnicodeString::pinIndices(int32_t& start,
3584 int32_t& _length)
const
3590 }
else if(start > len) {
3595 }
else if(_length > (len - start)) {
3596 _length = (len - start);
3601 UnicodeString::getArrayStart()
3602 {
return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.fArray; }
3605 UnicodeString::getArrayStart()
const
3606 {
return (fFlags&kUsingStackBuffer) ? fUnion.fStackBuffer : fUnion.fFields.fArray; }
3613 UnicodeString::UnicodeString()
3615 fFlags(kShortString)
3623 {
return fShortLength>=0 ? fShortLength : fUnion.fFields.fLength; }
3627 {
return (fFlags&kUsingStackBuffer) ? US_STACKBUF_SIZE : fUnion.fFields.fCapacity; }
3631 {
return doHashCode(); }
3635 {
return (
UBool)(fFlags & kIsBogus); }
3638 UnicodeString::isWritable()
const
3639 {
return (
UBool)!(fFlags&(kOpenGetBuffer|kIsBogus)); }
3642 UnicodeString::isBufferWritable()
const
3645 !(fFlags&(kOpenGetBuffer|kIsBogus|kBufferIsReadonly)) &&
3646 (!(fFlags&kRefCounted) || refCount()==1));
3649 inline const UChar *
3651 if(fFlags&(kIsBogus|kOpenGetBuffer)) {
3653 }
else if(fFlags&kUsingStackBuffer) {
3654 return fUnion.fStackBuffer;
3656 return fUnion.fFields.fArray;
3664 UnicodeString::doCompare(int32_t start,
3668 int32_t srcLength)
const
3673 srcText.pinIndices(srcStart, srcLength);
3674 return doCompare(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
3685 return !text.
isBogus() && len == textLength && doEquals(text, len);
3691 {
return (!
operator==(text)); }
3695 {
return doCompare(0,
length(), text, 0, text.
length()) == 1; }
3699 {
return doCompare(0,
length(), text, 0, text.
length()) == -1; }
3703 {
return doCompare(0,
length(), text, 0, text.
length()) != -1; }
3707 {
return doCompare(0,
length(), text, 0, text.
length()) != 1; }
3711 {
return doCompare(0,
length(), text, 0, text.
length()); }
3717 {
return doCompare(start, _length, srcText, 0, srcText.
length()); }
3721 int32_t srcLength)
const
3722 {
return doCompare(0,
length(), srcChars, 0, srcLength); }
3729 int32_t srcLength)
const
3730 {
return doCompare(start, _length, srcText, srcStart, srcLength); }
3735 const UChar *srcChars)
const
3736 {
return doCompare(start, _length, srcChars, 0, _length); }
3741 const UChar *srcChars,
3743 int32_t srcLength)
const
3744 {
return doCompare(start, _length, srcChars, srcStart, srcLength); }
3751 int32_t srcLimit)
const
3752 {
return doCompare(start, limit - start,
3753 srcText, srcStart, srcLimit - srcStart); }
3756 UnicodeString::doCompareCodePointOrder(int32_t start,
3760 int32_t srcLength)
const
3765 srcText.pinIndices(srcStart, srcLength);
3766 return doCompareCodePointOrder(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
3772 {
return doCompareCodePointOrder(0,
length(), text, 0, text.
length()); }
3778 {
return doCompareCodePointOrder(start, _length, srcText, 0, srcText.
length()); }
3782 int32_t srcLength)
const
3783 {
return doCompareCodePointOrder(0,
length(), srcChars, 0, srcLength); }
3790 int32_t srcLength)
const
3791 {
return doCompareCodePointOrder(start, _length, srcText, srcStart, srcLength); }
3796 const UChar *srcChars)
const
3797 {
return doCompareCodePointOrder(start, _length, srcChars, 0, _length); }
3802 const UChar *srcChars,
3804 int32_t srcLength)
const
3805 {
return doCompareCodePointOrder(start, _length, srcChars, srcStart, srcLength); }
3812 int32_t srcLimit)
const
3813 {
return doCompareCodePointOrder(start, limit - start,
3814 srcText, srcStart, srcLimit - srcStart); }
3817 UnicodeString::doCaseCompare(int32_t start,
3822 uint32_t options)
const
3827 srcText.pinIndices(srcStart, srcLength);
3828 return doCaseCompare(start, thisLength, srcText.getArrayStart(), srcStart, srcLength, options);
3834 return doCaseCompare(0,
length(), text, 0, text.
length(), options);
3841 uint32_t options)
const {
3842 return doCaseCompare(start, _length, srcText, 0, srcText.
length(), options);
3848 uint32_t options)
const {
3849 return doCaseCompare(0,
length(), srcChars, 0, srcLength, options);
3858 uint32_t options)
const {
3859 return doCaseCompare(start, _length, srcText, srcStart, srcLength, options);
3865 const UChar *srcChars,
3866 uint32_t options)
const {
3867 return doCaseCompare(start, _length, srcChars, 0, _length, options);
3873 const UChar *srcChars,
3876 uint32_t options)
const {
3877 return doCaseCompare(start, _length, srcChars, srcStart, srcLength, options);
3886 uint32_t options)
const {
3887 return doCaseCompare(start, limit - start, srcText, srcStart, srcLimit - srcStart, options);
3895 int32_t _length)
const
3898 srcText.pinIndices(srcStart, srcLength);
3900 return indexOf(srcText.getArrayStart(), srcStart, srcLength, start, _length);
3912 int32_t start)
const {
3920 int32_t _length)
const
3926 int32_t start)
const {
3928 return indexOf(srcChars, 0, srcLength, start,
length() - start);
3935 int32_t _length)
const
3936 {
return indexOf(srcChars, 0, srcLength, start, _length); }
3941 int32_t _length)
const
3942 {
return doIndexOf(c, start, _length); }
3947 int32_t _length)
const
3948 {
return doIndexOf(c, start, _length); }
3952 {
return doIndexOf(c, 0,
length()); }
3960 int32_t start)
const {
3962 return doIndexOf(c, start,
length() - start);
3967 int32_t start)
const {
3976 int32_t _length)
const
3977 {
return lastIndexOf(srcChars, 0, srcLength, start, _length); }
3982 int32_t start)
const {
3992 int32_t _length)
const
3995 srcText.pinIndices(srcStart, srcLength);
3997 return lastIndexOf(srcText.getArrayStart(), srcStart, srcLength, start, _length);
4006 int32_t _length)
const
4011 int32_t start)
const {
4023 int32_t _length)
const
4024 {
return doLastIndexOf(c, start, _length); }
4029 int32_t _length)
const {
4030 return doLastIndexOf(c, start, _length);
4035 {
return doLastIndexOf(c, 0,
length()); }
4044 int32_t start)
const {
4046 return doLastIndexOf(c, start,
length() - start);
4051 int32_t start)
const {
4063 int32_t srcLength)
const
4064 {
return doCompare(0, srcLength, srcText, srcStart, srcLength) == 0; }
4071 return doCompare(0, srcLength, srcChars, 0, srcLength) == 0;
4079 return doCompare(0, srcLength, srcChars, srcStart, srcLength) == 0;
4085 text, 0, text.
length()) == 0; }
4090 int32_t srcLength)
const {
4091 srcText.pinIndices(srcStart, srcLength);
4092 return doCompare(
length() - srcLength, srcLength,
4093 srcText, srcStart, srcLength) == 0;
4098 int32_t srcLength)
const {
4102 return doCompare(
length() - srcLength, srcLength,
4103 srcChars, 0, srcLength) == 0;
4109 int32_t srcLength)
const {
4111 srcLength =
u_strlen(srcChars + srcStart);
4113 return doCompare(
length() - srcLength, srcLength,
4114 srcChars, srcStart, srcLength) == 0;
4124 {
return doReplace(start, _length, srcText, 0, srcText.
length()); }
4132 {
return doReplace(start, _length, srcText, srcStart, srcLength); }
4137 const UChar *srcChars,
4139 {
return doReplace(start, _length, srcChars, 0, srcLength); }
4144 const UChar *srcChars,
4147 {
return doReplace(start, _length, srcChars, srcStart, srcLength); }
4153 {
return doReplace(start, _length, &srcChar, 0, 1); }
4159 {
return doReplace(start, limit - start, srcText, 0, srcText.
length()); }
4167 {
return doReplace(start, limit - start, srcText, srcStart, srcLimit - srcStart); }
4173 newText, 0, newText.
length()); }
4181 newText, 0, newText.
length()); }
4187 UnicodeString::doExtract(int32_t start,
4190 { target.
replace(0, target.
length(), *
this, start, _length); }
4196 int32_t targetStart)
const
4197 { doExtract(start, _length, target, targetStart); }
4203 { doExtract(start, _length, target); }
4205 #if !UCONFIG_NO_CONVERSION
4211 const char *codepage)
const
4215 return extract(start, _length, dst, dst!=0 ? 0xffffffff : 0, codepage);
4224 int32_t dstStart)
const {
4227 doExtract(start, limit - start, dst, dstStart);
4236 UnicodeString::doCharAt(int32_t offset)
const
4238 if((uint32_t)offset < (uint32_t)
length()) {
4239 return getArrayStart()[offset];
4241 return kInvalidUChar;
4247 {
return doCharAt(offset); }
4251 {
return doCharAt(offset); }
4255 return fShortLength == 0;
4262 UnicodeString::setLength(int32_t len) {
4264 fShortLength = (int8_t)len;
4266 fShortLength = (int8_t)-1;
4267 fUnion.fFields.fLength = len;
4272 UnicodeString::setToEmpty() {
4274 fFlags = kShortString;
4278 UnicodeString::setArray(
UChar *array, int32_t len, int32_t capacity) {
4280 fUnion.fFields.fArray = array;
4281 fUnion.fFields.fCapacity = capacity;
4284 inline const UChar *
4289 UChar *array = getArrayStart();
4291 if(len <
getCapacity() && ((fFlags&kRefCounted) == 0 || refCount() == 1)) {
4298 if(!(fFlags&kBufferIsReadonly)) {
4316 }
else if(cloneArrayIfNeeded(len+1)) {
4317 array = getArrayStart();
4328 {
return doReplace(0,
length(), &ch, 0, 1); }
4340 return doReplace(0,
length(), srcText, srcStart, srcLength);
4348 srcText.pinIndex(srcStart);
4349 return doReplace(0,
length(), srcText, srcStart, srcText.
length() - srcStart);
4355 return copyFrom(srcText);
4363 return doReplace(0,
length(), srcChars, 0, srcLength);
4370 return doReplace(0,
length(), &srcChar, 0, 1);
4384 {
return doReplace(
length(), 0, srcText, srcStart, srcLength); }
4388 {
return doReplace(
length(), 0, srcText, 0, srcText.
length()); }
4394 {
return doReplace(
length(), 0, srcChars, srcStart, srcLength); }
4399 {
return doReplace(
length(), 0, srcChars, 0, srcLength); }
4403 {
return doReplace(
length(), 0, &srcChar, 0, 1); }
4407 {
return doReplace(
length(), 0, &ch, 0, 1); }
4416 {
return doReplace(
length(), 0, srcText, 0, srcText.
length()); }
4423 {
return doReplace(start, 0, srcText, srcStart, srcLength); }
4428 {
return doReplace(start, 0, srcText, 0, srcText.
length()); }
4432 const UChar *srcChars,
4435 {
return doReplace(start, 0, srcChars, srcStart, srcLength); }
4439 const UChar *srcChars,
4441 {
return doReplace(start, 0, srcChars, 0, srcLength); }
4446 {
return doReplace(start, 0, &srcChar, 0, 1); }
4451 {
return replace(start, 0, srcChar); }
4460 if(fFlags & (kIsBogus|kBufferIsReadonly)) {
4472 if(start <= 0 && _length ==
INT32_MAX) {
4476 return doReplace(start, _length,
NULL, 0, 0);
4482 {
return doReplace(start, limit - start,
NULL, 0, 0); }
4487 return doReplace(0, start,
NULL, 0, 0);
4493 if(
isBogus() && targetLength == 0) {
4497 }
else if((uint32_t)targetLength < (uint32_t)
length()) {
4498 setLength(targetLength);
4499 if(fFlags&kBufferIsReadonly) {
4500 fUnion.fFields.fCapacity = targetLength;
4510 {
return doReverse(0,
length()); }
4515 {
return doReverse(start, _length); }