33#if U_SHOW_CPLUSPLUS_API
55#if !UCONFIG_NO_BREAK_ITERATION
74 char16_t *dest, int32_t destCapacity,
75 const char16_t *src, int32_t srcLength,
82class StringCharacterIterator;
83class UnicodeStringAppendable;
97#define US_INV icu::UnicodeString::kInvariant
116#if !U_CHAR16_IS_TYPEDEF
117# define UNICODE_STRING(cs, _length) icu::UnicodeString(true, u ## cs, _length)
119# define UNICODE_STRING(cs, _length) icu::UnicodeString(true, (const char16_t*)u ## cs, _length)
135#define UNICODE_STRING_SIMPLE(cs) UNICODE_STRING(cs, -1)
144#ifndef UNISTR_FROM_CHAR_EXPLICIT
145# if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
147# define UNISTR_FROM_CHAR_EXPLICIT explicit
150# define UNISTR_FROM_CHAR_EXPLICIT
164#ifndef UNISTR_FROM_STRING_EXPLICIT
165# if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
167# define UNISTR_FROM_STRING_EXPLICIT explicit
170# define UNISTR_FROM_STRING_EXPLICIT
207#ifndef UNISTR_OBJECT_SIZE
208# define UNISTR_OBJECT_SIZE 64
1074 inline int32_t indexOf(
char16_t c)
const;
1094 inline int32_t indexOf(
char16_t c,
1119 inline int32_t indexOf(
char16_t c,
1257 inline int32_t lastIndexOf(
char16_t c)
const;
1277 inline int32_t lastIndexOf(
char16_t c,
1302 inline int32_t lastIndexOf(
char16_t c,
1460 inline void extract(
int32_t start,
1499 inline void extract(
int32_t start,
1558#if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
1586#if !UCONFIG_NO_CONVERSION
1616 const char*
codepage =
nullptr)
const;
1728 template<
typename StringClass>
1811 inline UBool isEmpty()
const;
1822 inline int32_t getCapacity()
const;
1831 inline int32_t hashCode()
const;
1845 inline UBool isBogus()
const;
2682#if !UCONFIG_NO_BREAK_ITERATION
2891 inline const char16_t *getBuffer()
const;
2984#if !U_CHAR16_IS_TYPEDEF
2999#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
3037#if !U_CHAR16_IS_TYPEDEF
3049#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
3117#if !U_CHAR16_IS_TYPEDEF
3130#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
3154#if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
3189#if !UCONFIG_NO_CONVERSION
3482 char *target,
int32_t capacity)
const;
3491 doEqualsSubstring(
int32_t start,
3517 doCompareCodePointOrder(
int32_t start,
3553 int32_t doLastIndexOf(
char16_t c,
3566 inline void doExtract(
int32_t start,
3570 inline char16_t doCharAt(
int32_t offset)
const;
3595 inline char16_t* getArrayStart();
3596 inline const char16_t* getArrayStart()
const;
3598 inline UBool hasShortLength()
const;
3599 inline int32_t getShortLength()
const;
3603 inline UBool isWritable()
const;
3606 inline UBool isBufferWritable()
const;
3609 inline void setZeroLength();
3610 inline void setShortLength(
int32_t len);
3611 inline void setLength(
int32_t len);
3612 inline void setToEmpty();
3613 inline void setArray(
char16_t *array,
int32_t len,
int32_t capacity);
3623 void releaseArray();
3635 inline void pinIndex(
int32_t& start)
const;
3636 inline void pinIndices(
int32_t& start,
3639#if !UCONFIG_NO_CONVERSION
3715 kInvalidUChar=0xffff,
3721 kUsingStackBuffer=2,
3723 kBufferIsReadonly=8,
3726 kAllStorageFlags=0x1f,
3729 kLength1=1<<kLengthShift,
3730 kMaxShortLength=0x3ff,
3731 kLengthIsLarge=0xffe0,
3734 kShortString=kUsingStackBuffer,
3735 kLongString=kRefCounted,
3736 kReadonlyAlias=kBufferIsReadonly,
3742 union StackBufferOrFields;
3743 friend union StackBufferOrFields;
3786 union StackBufferOrFields {
3791 char16_t fBuffer[US_STACKBUF_SIZE];
3794 int16_t fLengthAndFlags;
3824UnicodeString::pinIndex(
int32_t& start)
const
3829 }
else if(start > length()) {
3835UnicodeString::pinIndices(int32_t& start,
3836 int32_t& _length)
const
3839 int32_t len = length();
3842 }
else if(start > len) {
3847 }
else if(_length > (len - start)) {
3848 _length = (len - start);
3853UnicodeString::getArrayStart() {
3854 return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
3855 fUnion.fStackFields.fBuffer : fUnion.fFields.fArray;
3858inline const char16_t*
3859UnicodeString::getArrayStart()
const {
3860 return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
3861 fUnion.fStackFields.fBuffer : fUnion.fFields.fArray;
3869UnicodeString::UnicodeString() {
3870 fUnion.fStackFields.fLengthAndFlags=kShortString;
3873inline UnicodeString::UnicodeString(
const std::nullptr_t ) {
3874 fUnion.fStackFields.fLengthAndFlags=kShortString;
3877inline UnicodeString::UnicodeString(
const std::nullptr_t ,
int32_t ) {
3878 fUnion.fStackFields.fLengthAndFlags=kShortString;
3882 fUnion.fStackFields.fLengthAndFlags=kShortString;
3889UnicodeString::hasShortLength()
const {
3890 return fUnion.fFields.fLengthAndFlags>=0;
3894UnicodeString::getShortLength()
const {
3897 return fUnion.fFields.fLengthAndFlags>>kLengthShift;
3901UnicodeString::length()
const {
3902 return hasShortLength() ? getShortLength() : fUnion.fFields.fLength;
3906UnicodeString::getCapacity()
const {
3907 return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
3908 US_STACKBUF_SIZE : fUnion.fFields.fCapacity;
3912UnicodeString::hashCode()
const
3913{
return doHashCode(); }
3916UnicodeString::isBogus()
const
3917{
return (
UBool)(fUnion.fFields.fLengthAndFlags & kIsBogus); }
3920UnicodeString::isWritable()
const
3921{
return (
UBool)!(fUnion.fFields.fLengthAndFlags&(kOpenGetBuffer|kIsBogus)); }
3924UnicodeString::isBufferWritable()
const
3927 !(fUnion.fFields.fLengthAndFlags&(kOpenGetBuffer|kIsBogus|kBufferIsReadonly)) &&
3928 (!(fUnion.fFields.fLengthAndFlags&kRefCounted) || refCount()==1));
3931inline const char16_t *
3932UnicodeString::getBuffer()
const {
3933 if(fUnion.fFields.fLengthAndFlags&(kIsBogus|kOpenGetBuffer)) {
3935 }
else if(fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) {
3936 return fUnion.fStackFields.fBuffer;
3938 return fUnion.fFields.fArray;
3946UnicodeString::doCompare(
int32_t start,
3953 return (
int8_t)!isBogus();
3955 srcText.pinIndices(srcStart, srcLength);
3956 return doCompare(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
3961UnicodeString::doEqualsSubstring(int32_t start,
3963 const UnicodeString& srcText,
3965 int32_t srcLength)
const
3967 if(srcText.isBogus()) {
3970 srcText.pinIndices(srcStart, srcLength);
3971 return !isBogus() && doEqualsSubstring(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
3982 return !text.
isBogus() && len == textLength && doEquals(text, len);
3988{
return (!
operator==(text)); }
3992{
return doCompare(0, length(), text, 0, text.
length()) == 1; }
3996{
return doCompare(0, length(), text, 0, text.
length()) == -1; }
4000{
return doCompare(0, length(), text, 0, text.
length()) != -1; }
4004{
return doCompare(0, length(), text, 0, text.
length()) != 1; }
4008{
return doCompare(0, length(), text, 0, text.
length()); }
4049{
return doCompare(start, limit - start,
4053UnicodeString::doCompareCodePointOrder(
int32_t start,
4060 return (
int8_t)!isBogus();
4062 srcText.pinIndices(srcStart, srcLength);
4063 return doCompareCodePointOrder(start, thisLength, srcText.getArrayStart(), srcStart, srcLength);
4069{
return doCompareCodePointOrder(0, length(), text, 0, text.
length()); }
4072UnicodeString::compareCodePointOrder(
int32_t start,
4083UnicodeString::compareCodePointOrder(
int32_t start,
4091UnicodeString::compareCodePointOrder(
int32_t start,
4097UnicodeString::compareCodePointOrder(
int32_t start,
4105UnicodeString::compareCodePointOrderBetween(
int32_t start,
4110{
return doCompareCodePointOrder(start, limit - start,
4114UnicodeString::doCaseCompare(
int32_t start,
4122 return (
int8_t)!isBogus();
4124 srcText.pinIndices(srcStart, srcLength);
4125 return doCaseCompare(start, thisLength, srcText.getArrayStart(), srcStart, srcLength, options);
4131 return doCaseCompare(0, length(), text, 0, text.
length(), options);
4205{
return indexOf(text, 0, text.
length(), 0, length()); }
4211 return indexOf(text, 0, text.
length(), start, length() - start);
4236UnicodeString::indexOf(
char16_t c,
4239{
return doIndexOf(c, start,
_length); }
4245{
return doIndexOf(c, start,
_length); }
4248UnicodeString::indexOf(
char16_t c)
const
4249{
return doIndexOf(c, 0, length()); }
4253{
return indexOf(c, 0, length()); }
4256UnicodeString::indexOf(
char16_t c,
4259 return doIndexOf(c, start, length() - start);
4266 return indexOf(c, start, length() - start);
4304{
return lastIndexOf(text, 0, text.
length(), start,
_length); }
4310 return lastIndexOf(text, 0, text.
length(), start, length() - start);
4315{
return lastIndexOf(text, 0, text.
length(), 0, length()); }
4318UnicodeString::lastIndexOf(
char16_t c,
4321{
return doLastIndexOf(c, start,
_length); }
4327 return doLastIndexOf(c, start,
_length);
4331UnicodeString::lastIndexOf(
char16_t c)
const
4332{
return doLastIndexOf(c, 0, length()); }
4336 return lastIndexOf(c, 0, length());
4340UnicodeString::lastIndexOf(
char16_t c,
4343 return doLastIndexOf(c, start, length() - start);
4350 return lastIndexOf(c, start, length() - start);
4355{
return doEqualsSubstring(0, text.
length(), text, 0, text.
length()); }
4381{
return doEqualsSubstring(length() - text.
length(), text.
length(),
4382 text, 0, text.
length()); }
4455{
return doReplace(start, limit - start,
srcText, 0,
srcText.length()); }
4468{
return findAndReplace(0, length(),
oldText, 0,
oldText.length(),
4483UnicodeString::doExtract(
int32_t start,
4499{ doExtract(start,
_length, target); }
4501#if !UCONFIG_NO_CONVERSION
4528 return tempSubString(start, limit - start);
4532UnicodeString::doCharAt(
int32_t offset)
const
4535 return getArrayStart()[offset];
4537 return kInvalidUChar;
4543{
return doCharAt(offset); }
4547{
return doCharAt(offset); }
4550UnicodeString::isEmpty()
const {
4552 return (fUnion.fFields.fLengthAndFlags>>kLengthShift) == 0;
4559UnicodeString::setZeroLength() {
4560 fUnion.fFields.fLengthAndFlags &= kAllStorageFlags;
4564UnicodeString::setShortLength(int32_t len) {
4566 fUnion.fFields.fLengthAndFlags =
4567 (int16_t)((fUnion.fFields.fLengthAndFlags & kAllStorageFlags) | (len << kLengthShift));
4571UnicodeString::setLength(int32_t len) {
4572 if(len <= kMaxShortLength) {
4573 setShortLength(len);
4575 fUnion.fFields.fLengthAndFlags |= kLengthIsLarge;
4576 fUnion.fFields.fLength = len;
4581UnicodeString::setToEmpty() {
4582 fUnion.fFields.fLengthAndFlags = kShortString;
4586UnicodeString::setArray(
char16_t *array, int32_t len, int32_t capacity) {
4588 fUnion.fFields.fArray = array;
4589 fUnion.fFields.fCapacity = capacity;
4592inline UnicodeString&
4593UnicodeString::operator= (
char16_t ch)
4594{
return doReplace(0, length(), &
ch, 0, 1); }
4598{
return replace(0, length(),
ch); }
4636 return doReplace(0, length(), &
srcChar, 0, 1);
4643 return replace(0, length(),
srcChar);
4669{
return doAppend(&
srcChar, 0, 1); }
4672UnicodeString::operator+= (
char16_t ch)
4673{
return doAppend(&
ch, 0, 1); }
4712{
return doReplace(start, 0, &
srcChar, 0, 1); }
4717{
return replace(start, 0,
srcChar); }
4721UnicodeString::remove()
4740 return doReplace(start,
_length,
nullptr, 0, 0);
4746{
return doReplace(start, limit - start,
nullptr, 0, 0); }
4751 return doReplace(0, start,
nullptr, 0, 0);
4770UnicodeString::reverse()
4771{
return doReverse(0, length()); }
4776{
return doReverse(start,
_length); }
C++ API: Interface for writing bytes, and implementation classes.
C++ API: char16_t pointer wrappers with implicit conversion from bit-compatible raw pointer types.
The BreakIterator class implements methods for finding the location of boundaries in text.
A ByteSink can be filled with bytes.
char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
Records lengths of string edits but not replacement text.
"Smart pointer" base class; do not use directly: use LocalPointer etc.
A Locale object represents a specific geographical, political, or cultural region.
Replaceable is an abstract base class representing a string of characters that supports the replaceme...
virtual void extractBetween(int32_t start, int32_t limit, UnicodeString &target) const =0
Copies characters in the range [start, limit) into the UnicodeString target.
char16_t charAt(int32_t offset) const
Returns the 16-bit code unit at the given offset into the text.
int32_t length() const
Returns the number of 16-bit code units in the text.
A string-like object that points to a sized piece of memory.
An Appendable implementation which writes to a UnicodeString.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
int32_t indexOf(const char16_t *srcChars, int32_t srcStart, int32_t srcLength, int32_t start, int32_t length) const
Locate in this the first occurrence in the range [start, start + length) of the characters in srcChar...
UnicodeString(const UnicodeString &that)
Copy constructor.
void swap(UnicodeString &other) noexcept
Swap strings.
virtual char16_t getCharAt(int32_t offset) const override
The change in Replaceable to use virtual getCharAt() allows UnicodeString::charAt() to be inline agai...
virtual int32_t getLength() const override
Implement Replaceable::getLength() (see jitterbug 1027).
UnicodeString & setTo(char16_t *buffer, int32_t buffLength, int32_t buffCapacity)
Aliasing setTo() function, analogous to the writable-aliasing char16_t* constructor.
UnicodeString & operator=(UnicodeString &&src) noexcept
Move assignment operator; might leave src in bogus state.
UChar32 unescapeAt(int32_t &offset) const
Unescape a single escape sequence and return the represented character.
UnicodeString(const wchar_t *text, int32_t textLength)
wchar_t * constructor.
virtual void handleReplaceBetween(int32_t start, int32_t limit, const UnicodeString &text) override
Replace a substring of this object with the given text.
UBool hasMoreChar32Than(int32_t start, int32_t length, int32_t number) const
Check if the length char16_t code units of the string contain more Unicode code points than a certain...
UnicodeString(const UnicodeString &src, int32_t srcStart, int32_t srcLength)
'Substring' constructor from subrange of source string.
virtual ~UnicodeString()
Destructor.
UnicodeString(const char *codepageData, int32_t dataLength, const char *codepage)
char* constructor.
UnicodeString(const char *codepageData, const char *codepage)
char* constructor.
UnicodeString(UBool isTerminated, ConstChar16Ptr text, int32_t textLength)
Readonly-aliasing char16_t* constructor.
UnicodeString & toTitle(BreakIterator *titleIter, const Locale &locale, uint32_t options)
Titlecase this string, with options.
UnicodeString & append(UChar32 srcChar)
Append the code point srcChar to the UnicodeString object.
EInvariant
Constant to be used in the UnicodeString(char *, int32_t, EInvariant) constructor which constructs a ...
UnicodeString unescape() const
Unescape a string of characters and return a string containing the result.
UnicodeString(const UnicodeString &src, int32_t srcStart)
'Substring' constructor from tail of source string.
int32_t getChar32Limit(int32_t offset) const
Adjust a random-access offset so that it points behind a Unicode character.
UnicodeString(char16_t *buffer, int32_t buffLength, int32_t buffCapacity)
Writable-aliasing char16_t* constructor.
UnicodeString & findAndReplace(int32_t start, int32_t length, const UnicodeString &oldText, int32_t oldStart, int32_t oldLength, const UnicodeString &newText, int32_t newStart, int32_t newLength)
Replace all occurrences of characters in oldText in the range [oldStart, oldStart + oldLength) with t...
UnicodeString(int32_t capacity, UChar32 c, int32_t count)
Construct a UnicodeString with capacity to hold capacity char16_ts.
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const uint16_t *text)
uint16_t * constructor.
int32_t extract(int32_t start, int32_t startLength, char *target, uint32_t targetLength, const char *codepage) const
Copy the characters in the range [start, start + length) into an array of characters in a specified c...
virtual void copy(int32_t start, int32_t limit, int32_t dest) override
Copy a substring of this object, retaining attribute (out-of-band) information.
virtual void extractBetween(int32_t start, int32_t limit, UnicodeString &target) const override
Copy the characters in the range [start, limit) into the UnicodeString target.
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...
UnicodeString & toTitle(BreakIterator *titleIter)
Titlecase this string, convenience function using the default locale.
UnicodeString & fastCopyFrom(const UnicodeString &src)
Almost the same as the assignment operator.
virtual UnicodeString * clone() const override
Clone this object, an instance of a subclass of Replaceable.
UBool padLeading(int32_t targetLength, char16_t padChar=0x0020)
Pad the start of this UnicodeString with the character padChar.
int32_t getChar32Start(int32_t offset) const
Adjust a random-access offset so that it points to the beginning of a Unicode character.
UChar32 char32At(int32_t offset) const
Return the code point that contains the code unit at offset offset.
UnicodeString(const char *src, int32_t textLength, enum EInvariant inv)
Constructs a Unicode string from an invariant-character char * string.
UnicodeString tempSubString(int32_t start=0, int32_t length=INT32_MAX) const
Create a temporary substring for the specified range.
int32_t extract(Char16Ptr dest, int32_t destCapacity, UErrorCode &errorCode) const
Copy the contents of the string into dest.
int32_t length() const
Return the length of the UnicodeString object.
virtual UChar32 getChar32At(int32_t offset) const override
The change in Replaceable to use virtual getChar32At() allows UnicodeString::char32At() to be inline ...
int32_t extract(int32_t start, int32_t startLength, char *target, uint32_t targetLength) const
Copy the characters in the range [start, start + length) into an array of characters in the platform'...
static UnicodeString fromUTF8(StringPiece utf8)
Create a UnicodeString from a UTF-8 string.
UNISTR_FROM_CHAR_EXPLICIT UnicodeString(char16_t ch)
Single char16_t (code unit) constructor.
int32_t lastIndexOf(const char16_t *srcChars, int32_t srcStart, int32_t srcLength, int32_t start, int32_t length) const
Locate in this the last occurrence in the range [start, start + length) of the characters in srcChars...
UnicodeString(wchar_t *buffer, int32_t buffLength, int32_t buffCapacity)
Writable-aliasing wchar_t * constructor.
void setToBogus()
Make this UnicodeString object invalid.
friend void swap(UnicodeString &s1, UnicodeString &s2) noexcept
Non-member UnicodeString swap function.
int32_t moveIndex32(int32_t index, int32_t delta) const
Move the code unit index along the string by delta code points.
static UnicodeString fromUTF32(const UChar32 *utf32, int32_t length)
Create a UnicodeString from a UTF-32 string.
UnicodeString & replace(int32_t start, int32_t length, UChar32 srcChar)
Replace the characters in the range [start, start + length) with the code point srcChar.
int32_t countChar32(int32_t start=0, int32_t length=INT32_MAX) const
Count Unicode code points in the length char16_t code units of the string.
UNISTR_FROM_CHAR_EXPLICIT UnicodeString(UChar32 ch)
Single UChar32 (code point) constructor.
UnicodeString & trim()
Trims leading and trailing whitespace from this UnicodeString.
UnicodeString & operator=(const UnicodeString &srcText)
Assignment operator.
UnicodeString & setTo(UBool isTerminated, ConstChar16Ptr text, int32_t textLength)
Aliasing setTo() function, analogous to the readonly-aliasing char16_t* constructor.
int32_t extract(char *dest, int32_t destCapacity, UConverter *cnv, UErrorCode &errorCode) const
Convert the UnicodeString into a codepage string using an existing UConverter.
StringClass & toUTF8String(StringClass &result) const
Convert the UnicodeString to UTF-8 and append the result to a standard string.
UnicodeString(UnicodeString &&src) noexcept
Move constructor; might leave src in bogus state.
UnicodeString & toUpper()
Convert the characters in this to UPPER CASE following the conventions of the default locale.
UnicodeString(const char16_t *text, int32_t textLength)
char16_t* constructor.
UnicodeString(const char *src, int32_t srcLength, UConverter *cnv, UErrorCode &errorCode)
char * / UConverter constructor.
UnicodeString(const char *codepageData, int32_t dataLength)
char* constructor.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
UnicodeString(uint16_t *buffer, int32_t buffLength, int32_t buffCapacity)
Writable-aliasing uint16_t * constructor.
int32_t toUTF32(UChar32 *utf32, int32_t capacity, UErrorCode &errorCode) const
Convert the UnicodeString to UTF-32.
UBool isBogus() const
Determine if this object contains a valid string.
UnicodeString & toLower(const Locale &locale)
Convert the characters in this to lower case following the conventions of a specific locale.
UnicodeString & toTitle(BreakIterator *titleIter, const Locale &locale)
Titlecase this string.
UnicodeString & foldCase(uint32_t options=0)
Case-folds the characters in this string.
const char16_t * getTerminatedBuffer()
Get a read-only pointer to the internal buffer, making sure that it is NUL-terminated.
UnicodeString(const uint16_t *text, int32_t textLength)
uint16_t * constructor.
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const char16_t *text)
char16_t* constructor.
UnicodeString & toUpper(const Locale &locale)
Convert the characters in this to UPPER CASE following the conventions of a specific locale.
UnicodeString & setCharAt(int32_t offset, char16_t ch)
Set the character at the specified offset to the specified character.
virtual UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
int32_t extract(int32_t start, int32_t startLength, char *target, int32_t targetCapacity, enum EInvariant inv) const
Copy the characters in the range [start, start + startLength) into an array of characters.
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const wchar_t *text)
wchar_t * constructor.
char16_t * getBuffer(int32_t minCapacity)
Get a read/write pointer to the internal buffer.
UnicodeString & toLower()
Convert the characters in this to lower case following the conventions of the default locale.
UBool padTrailing(int32_t targetLength, char16_t padChar=0x0020)
Pad the end of this UnicodeString with the character padChar.
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const char *codepageData)
char* constructor.
void releaseBuffer(int32_t newLength=-1)
Release a read/write buffer on a UnicodeString object with an "open" getBuffer(minCapacity).
void toUTF8(ByteSink &sink) const
Convert the UnicodeString to UTF-8 and write the result to a ByteSink.
virtual UBool hasMetaData() const override
Replaceable API.
U_CAPI int32_t u_strlen(const UChar *s)
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
bool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
const UChar * toUCharPtr(const char16_t *p)
Converts from const char16_t * to const UChar *.
C++ API: Replaceable String.
C++ API: Central ICU header for including the C++ standard <string> header and for related definition...
C++ API: StringPiece: Read-only byte string wrapper class.
struct UConverter UConverter
#define UCONFIG_NO_BREAK_ITERATION
This switch turns off break iteration.
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
#define INT32_MAX
The largest value a 32 bit signed integer can hold.
int8_t UBool
The ICU boolean type, a signed-byte integer.
#define U_CAPI
This is used to declare a function as a public ICU C API.
char16_t UChar
The base type for UTF-16 code units and pointers.
#define U_SIZEOF_UCHAR
Number of bytes in a UChar (always 2).
#define UNISTR_FROM_CHAR_EXPLICIT
This can be defined to be empty or "explicit".
int32_t UStringCaseMapper(int32_t caseLocale, uint32_t options, icu::BreakIterator *iter, char16_t *dest, int32_t destCapacity, const char16_t *src, int32_t srcLength, icu::Edits *edits, UErrorCode &errorCode)
Internal string case mapping function type.
#define UNISTR_FROM_STRING_EXPLICIT
This can be defined to be empty or "explicit".
#define UNISTR_OBJECT_SIZE
Desired sizeof(UnicodeString) in bytes.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.