20 #ifndef INCLUDED_RTL_USTRBUF_HXX
21 #define INCLUDED_RTL_USTRBUF_HXX
30 #if defined LIBO_INTERNAL_ONLY
31 #include <string_view>
39 #ifdef LIBO_INTERNAL_ONLY
40 #include "rtl/stringconcat.hxx"
43 #ifdef RTL_STRING_UNITTEST
44 extern bool rtl_string_unittest_invalid_conversion;
52 #ifdef RTL_STRING_UNITTEST
53 #define rtl rtlunittest
59 #ifdef RTL_STRING_UNITTEST
88 , nCapacity( value.nCapacity )
101 , nCapacity( length )
105 #if __cplusplus >= 201103L
110 #if SAL_TYPES_SIZEOFLONG == 4
112 explicit OUStringBuffer(
long length)
113 : OUStringBuffer(static_cast<int>(length))
116 explicit OUStringBuffer(
unsigned long length)
117 : OUStringBuffer(static_cast<int>(length))
122 explicit OUStringBuffer(
char) =
delete;
138 , nCapacity( value.getLength() + 16 )
143 template<
typename T >
146 , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
154 #ifdef RTL_STRING_UNITTEST
155 rtl_string_unittest_const_literal =
true;
159 #if defined LIBO_INTERNAL_ONLY
168 nCapacity(libreoffice_internal::ConstCharArrayDetector<T>::length + 16)
177 template<std::
size_t N> OUStringBuffer(OUStringLiteral<N>
const & literal):
178 pData(nullptr), nCapacity(literal.getLength() + 16)
184 #if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST
190 template<
typename T >
191 OUStringBuffer( T&,
typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
196 rtl_string_unittest_invalid_conversion =
true;
202 template<
typename T >
203 OUStringBuffer(
const T&,
typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
208 rtl_string_unittest_invalid_conversion =
true;
213 #ifdef LIBO_INTERNAL_ONLY
218 template< typename T1, typename T2 >
219 OUStringBuffer( OUStringConcat< T1, T2 >&& c )
221 const sal_Int32 l = c.length();
234 template<
typename T >
235 OUStringBuffer( OUStringNumber< T >&& n )
237 , nCapacity( n.length + 16 )
251 nCapacity = value.nCapacity;
262 if (n >= nCapacity) {
263 ensureCapacity(n + 16);
266 pData->buffer,
string.pData->buffer,
279 operator =(T & literal) {
284 if (n >= nCapacity) {
285 ensureCapacity(n + 16);
291 for (sal_Int32 i = 0; i <= n; ++i) {
298 #if defined LIBO_INTERNAL_ONLY
303 operator =(T & literal) {
306 if (n >= nCapacity) {
307 ensureCapacity(n + 16);
311 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
318 template<std::
size_t N> OUStringBuffer & operator =(OUStringLiteral<N>
const & literal) {
319 sal_Int32
const n = literal.getLength();
320 if (n >= nCapacity) {
321 ensureCapacity(n + 16);
324 pData->buffer, literal.getStr(),
331 #if defined LIBO_INTERNAL_ONLY
333 template<
typename T1,
typename T2>
334 OUStringBuffer & operator =(OUStringConcat<T1, T2> && concat) {
335 sal_Int32
const n = concat.length();
336 if (n >= nCapacity) {
337 ensureCapacity(n + 16);
339 *concat.addData(pData->buffer) = 0;
346 OUStringBuffer & operator =(OUStringNumber<T> && n)
348 *
this = OUStringBuffer( std::move( n ) );
383 return pData->length;
396 return pData->length == 0;
450 assert(newLength >= 0);
452 if( newLength != pData->length )
454 if( newLength > nCapacity )
457 pData->buffer[newLength] = 0;
458 pData->length = newLength;
478 assert(index >= 0 && index < pData->length);
479 return pData->buffer[ index ];
495 assert(index >= 0 && index < pData->length);
496 pData->buffer[ index ] = ch;
516 assert(index >= 0 && index < pData->length);
517 return pData->buffer[index];
531 assert(index >= 0 && index < pData->length);
532 return pData->buffer[index];
541 return OUString(pData->buffer, pData->length);
559 #if defined LIBO_INTERNAL_ONLY
561 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
562 throw std::bad_alloc();
564 return append(sv.data(), sv.size());
600 #if defined LIBO_INTERNAL_ONLY
603 append(T
const & str)
626 assert( len == 0 || str != NULL );
636 template<
typename T >
646 #if defined LIBO_INTERNAL_ONLY
649 append(T & value) {
return append(
static_cast<sal_Unicode *
>(value)); }
653 typename libreoffice_internal::ConstCharArrayDetector<
654 T, OUStringBuffer &>::TypeUtf16
655 append(T & literal) {
657 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
658 libreoffice_internal::ConstCharArrayDetector<T>::length);
662 template<std::
size_t N> OUStringBuffer & append(OUStringLiteral<N>
const & literal) {
663 return append(literal.getStr(), literal.getLength());
667 #ifdef LIBO_INTERNAL_ONLY
672 template< typename T1, typename T2 >
673 OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
675 sal_Int32 l = c.length();
680 sal_Unicode* end = c.addData( pData->buffer + pData->length );
690 template<
typename T >
691 OUStringBuffer& append( OUStringNumber< T >&& c )
693 return append( c.buf, c.length );
765 template<
typename T >
812 assert(
static_cast< unsigned char >(c) <= 0x7F);
828 return append( &c, 1 );
831 #if defined LIBO_INTERNAL_ONLY
832 void append(sal_uInt16) =
delete;
919 return insertUtf32(getLength(), c);
938 sal_Int32 n = getLength();
940 return pData->buffer + n;
1005 assert( len == 0 || str != NULL );
1015 template<
typename T >
1021 &pData, &nCapacity, offset,
1027 #if defined LIBO_INTERNAL_ONLY
1029 template<
typename T>
1032 insert(sal_Int32 offset, T & literal) {
1040 template<std::
size_t N>
1041 OUStringBuffer & insert(sal_Int32 offset, OUStringLiteral<N>
const & literal) {
1042 return insert(offset, literal.getStr(), literal.getLength());
1115 return insert( offset, &u, 1 );
1136 return insert( offset, &c, 1 );
1303 sal_Int32 index = 0;
1304 while((index = indexOf(oldChar, index)) >= 0)
1306 pData->buffer[ index ] = newChar;
1327 sal_Int32 ** pInternalCapacity)
1329 *pInternalData = &pData;
1330 *pInternalCapacity = &nCapacity;
1351 assert( fromIndex >= 0 && fromIndex <= pData->length );
1353 return (ret < 0 ? ret : ret+fromIndex);
1388 assert( fromIndex >= 0 && fromIndex <= pData->length );
1411 assert( fromIndex >= 0 && fromIndex <= pData->length );
1413 str.pData->buffer, str.pData->length );
1414 return (ret < 0 ? ret : ret+fromIndex);
1423 template<
typename T >
1429 pData->buffer + fromIndex, pData->length - fromIndex,
1432 return n < 0 ? n : n + fromIndex;
1435 #if defined LIBO_INTERNAL_ONLY
1437 template<
typename T>
1440 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
1441 assert(fromIndex >= 0);
1443 pData->buffer + fromIndex, pData->length - fromIndex,
1446 return n < 0 ? n : n + fromIndex;
1450 template<std::
size_t N>
1451 sal_Int32 indexOf(OUStringLiteral<N>
const & literal, sal_Int32 fromIndex = 0)
1455 pData->buffer + fromIndex, pData->length - fromIndex, literal.getStr(),
1456 literal.getLength());
1457 return n < 0 ? n : n + fromIndex;
1481 str.pData->buffer, str.pData->length );
1505 assert( fromIndex >= 0 && fromIndex <= pData->length );
1507 str.pData->buffer, str.pData->length );
1515 template<
typename T >
1521 pData->buffer, pData->length,
1526 #if defined LIBO_INTERNAL_ONLY
1528 template<
typename T>
1531 lastIndexOf(T & literal)
const {
1533 pData->buffer, pData->length,
1539 template<std::
size_t N> sal_Int32 lastIndexOf(OUStringLiteral<N>
const & literal)
const {
1541 pData->buffer, pData->length, literal.getStr(), literal.getLength());
1557 for(index = 0; index < getLength() ; index++)
1559 if(pData->buffer[ index ] != c)
1582 sal_Int32 result = getLength();
1584 for(index = getLength(); index > 0 ; index--)
1586 if(pData->buffer[ index - 1 ] != c)
1591 if(index < getLength())
1595 return result - getLength();
1608 return stripStart(c) + stripEnd(c);
1623 return copy( beginIndex, getLength() - beginIndex );
1641 assert(beginIndex >= 0 && beginIndex <= getLength());
1642 assert(count >= 0 && count <= getLength() - beginIndex);
1643 rtl_uString *pNew = NULL;
1652 nCapacity = capacity;
1658 rtl_uString * pData;
1663 sal_Int32 nCapacity;
1666 #if defined LIBO_INTERNAL_ONLY
1667 template<>
struct ToStringHelper<OUStringBuffer> {
1668 static std::size_t length(OUStringBuffer
const & s) {
return s.
getLength(); }
1671 {
return addDataHelper(buffer, s.getStr(), s.getLength()); }
1673 static constexpr
bool allowOStringConcat =
false;
1674 static constexpr
bool allowOUStringConcat =
true;
1678 #if defined LIBO_INTERNAL_ONLY
1685 return operator=(str.toString());
1687 return internalAppend(str.pData);
1692 #ifdef RTL_STRING_UNITTEST
1695 typedef rtlunittest::OUStringBuffer OUStringBuffer;
1699 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
1700 using ::rtl::OUStringBuffer;
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:445
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:374
@ SAL_NO_ACQUIRE
definition of a no acquire enum for ctors
Definition: types.h:352
unsigned char sal_Bool
Definition: types.h:34
sal_uInt16 sal_Unicode
Definition: types.h:119
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:280
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:558
SAL_DLLPUBLIC sal_Int32 rtl_str_getLength(const char *str) SAL_THROW_EXTERN_C()
Return the length of a string.
SAL_DLLPUBLIC void rtl_uStringbuffer_insert_ascii(rtl_uString **This, sal_Int32 *capacity, sal_Int32 offset, const char *str, sal_Int32 len)
Inserts the 8-Bit ASCII string representation of the str array argument into this string buffer.
SAL_DLLPUBLIC void rtl_uStringbuffer_remove(rtl_uString **This, sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
SAL_DLLPUBLIC void rtl_uStringbuffer_insertUtf32(rtl_uString **pThis, sal_Int32 *capacity, sal_Int32 offset, sal_uInt32 c) SAL_THROW_EXTERN_C()
Inserts a single UTF-32 character into this string buffer.
SAL_DLLPUBLIC void rtl_uStringbuffer_newFromStr_WithLength(rtl_uString **newStr, const sal_Unicode *value, sal_Int32 count)
Allocates a new String that contains characters from the character array argument.
SAL_DLLPUBLIC rtl_uString * rtl_uStringBuffer_makeStringAndClear(rtl_uString **ppThis, sal_Int32 *nCapacity) SAL_RETURNS_NONNULL
Returns an immutable rtl_uString object, while clearing the string buffer.
SAL_DLLPUBLIC sal_Int32 rtl_uStringbuffer_newFromStringBuffer(rtl_uString **newStr, sal_Int32 capacity, rtl_uString *oldStr)
Allocates a new String that contains the same sequence of characters as the string argument.
SAL_DLLPUBLIC void rtl_uStringbuffer_ensureCapacity(rtl_uString **This, sal_Int32 *capacity, sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
SAL_DLLPUBLIC void rtl_uStringbuffer_insert(rtl_uString **This, sal_Int32 *capacity, sal_Int32 offset, const sal_Unicode *str, sal_Int32 len)
Inserts the string representation of the str array argument into this string buffer.
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1022
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1041
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
#define RTL_USTR_MAX_VALUEOFINT64
Definition: ustring.h:980
SAL_DLLPUBLIC rtl_uString * rtl_uString_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C()
Allocate a new string containing space for a given number of characters.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_indexOfStr_WithLength(const sal_Unicode *str, sal_Int32 len, const sal_Unicode *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the first occurrence of a substring within a string.
SAL_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_getLength(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return the length of a string.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfInt64(sal_Unicode *str, sal_Int64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of a long integer.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfAscii_WithLength(sal_Unicode const *str, sal_Int32 len, char const *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the last occurrence of an ASCII substring within a string.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_indexOfAscii_WithLength(sal_Unicode const *str, sal_Int32 len, char const *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the first occurrence of an ASCII substring within a string.
SAL_DLLPUBLIC void rtl_uString_new_WithLength(rtl_uString **newStr, sal_Int32 nLen) SAL_THROW_EXTERN_C()
Allocate a new string containing space for a given number of characters.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfChar_WithLength(const sal_Unicode *str, sal_Int32 len, sal_Unicode ch) SAL_THROW_EXTERN_C()
Search for the last occurrence of a character within a string.
#define RTL_USTR_MAX_VALUEOFBOOLEAN
Definition: ustring.h:915
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfInt32(sal_Unicode *str, sal_Int32 i, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an integer.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_lastIndexOfStr_WithLength(const sal_Unicode *str, sal_Int32 len, const sal_Unicode *subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
Search for the last occurrence of a substring within a string.
SAL_DLLPUBLIC sal_Int32 rtl_ustr_indexOfChar_WithLength(const sal_Unicode *str, sal_Int32 len, sal_Unicode ch) SAL_THROW_EXTERN_C()
Search for the first occurrence of a character within a string.
#define RTL_USTR_MAX_VALUEOFINT32
Definition: ustring.h:957
Definition: bootstrap.hxx:30
Definition: stringutils.hxx:131
Definition: stringutils.hxx:134
Definition: stringutils.hxx:158
Definition: stringutils.hxx:186
Definition: stringutils.hxx:347
Definition: stringutils.hxx:366
A string buffer implements a mutable sequence of characters.
Definition: ustrbuf.hxx:66
sal_Int32 lastIndexOf(sal_Unicode ch, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustrbuf.hxx:1386
sal_Int32 stripStart(sal_Unicode c=' ')
Strip the given character from the start of the buffer.
Definition: ustrbuf.hxx:1554
OUStringBuffer & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition: ustrbuf.hxx:918
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1621
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition: ustrbuf.hxx:580
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition: ustrbuf.hxx:1301
bool isEmpty() const
Checks if a string buffer is empty.
Definition: ustrbuf.hxx:394
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition: ustrbuf.hxx:958
OUStringBuffer copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1639
OUStringBuffer & insert(sal_Int32 offset, const sal_Unicode *str)
Inserts the string representation of the char array argument into this string buffer.
Definition: ustrbuf.hxx:980
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: ustrbuf.hxx:409
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: ustrbuf.hxx:381
OUStringBuffer & append(rtl_uString *str)
Definition: ustrbuf.hxx:776
OUStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition: ustrbuf.hxx:882
OUStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: ustrbuf.hxx:899
OUStringBuffer & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
Definition: ustrbuf.hxx:605
OUStringBuffer & appendAscii(const char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:736
sal_Int32 strip(sal_Unicode c=' ')
Strip the given character from the both end of the buffer.
Definition: ustrbuf.hxx:1606
OUStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters.
Definition: ustrbuf.hxx:73
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition: ustrbuf.hxx:1252
OUStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition: ustrbuf.hxx:865
sal_Int32 indexOf(const OUString &str, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified substring,...
Definition: ustrbuf.hxx:1409
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition: ustrbuf.hxx:503
OUStringBuffer & append(const OUString &str)
Appends the string to this string buffer.
Definition: ustrbuf.hxx:554
OUStringBuffer & insert(sal_Int32 offset, sal_Int64 l, sal_Int16 radix=10)
Inserts the string representation of the long argument into this string buffer.
Definition: ustrbuf.hxx:1183
OUStringBuffer & appendAscii(const char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:713
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: ustrbuf.hxx:448
OUStringBuffer(const OUStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition: ustrbuf.hxx:86
OUStringBuffer & insert(sal_Int32 offset, const sal_Unicode *str, sal_Int32 len)
Inserts the string representation of the char array argument into this string buffer.
Definition: ustrbuf.hxx:1003
OUStringBuffer(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition: ustrbuf.hxx:144
sal_Int32 indexOf(sal_Unicode ch, sal_Int32 fromIndex=0) const
Returns the index within this string of the first occurrence of the specified character,...
Definition: ustrbuf.hxx:1349
OUStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer.
Definition: ustrbuf.hxx:1231
OUStringBuffer & append(const sal_Unicode *str, sal_Int32 len)
Appends the string representation of the char array argument to this string buffer.
Definition: ustrbuf.hxx:624
OUStringBuffer insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: ustrbuf.hxx:1207
sal_Int32 lastIndexOf(const OUString &str, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustrbuf.hxx:1503
sal_Int32 stripEnd(sal_Unicode c=' ')
Strip the given character from the end of the buffer.
Definition: ustrbuf.hxx:1580
OUStringBuffer & insert(sal_Int32 offset, sal_Int32 i, sal_Int16 radix=10)
Inserts the string representation of the second sal_Int32 argument into this string buffer.
Definition: ustrbuf.hxx:1158
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition: ustrbuf.hxx:826
OUStringBuffer & remove(sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
Definition: ustrbuf.hxx:1269
libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type indexOf(T &literal, sal_Int32 fromIndex=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustrbuf.hxx:1424
libreoffice_internal::ConstCharArrayDetector< T, OUStringBuffer & >::Type append(T &literal)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustrbuf.hxx:637
OUStringBuffer & insert(sal_Int32 offset, char c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1112
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition: ustrbuf.hxx:1285
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustrbuf.hxx:1367
OUStringBuffer(const OUString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition: ustrbuf.hxx:136
~OUStringBuffer()
Release the string data.
Definition: ustrbuf.hxx:356
libreoffice_internal::ConstCharArrayDetector< T, OUStringBuffer & >::Type insert(sal_Int32 offset, T &literal)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustrbuf.hxx:1016
libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type lastIndexOf(T &literal) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: ustrbuf.hxx:1516
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition: ustrbuf.hxx:425
OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: ustrbuf.hxx:1063
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition: ustrbuf.hxx:810
OUStringBuffer(int length)
Constructs a string buffer with no characters in it and an initial capacity specified by the length a...
Definition: ustrbuf.hxx:99
const OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition: ustrbuf.hxx:539
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1134
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: ustrbuf.hxx:1088
OUStringBuffer & append(sal_Int32 i, sal_Int16 radix=10)
Appends the string representation of the sal_Int32 argument to this string buffer.
Definition: ustrbuf.hxx:847
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustrbuf.hxx:1478
OUStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: ustrbuf.hxx:792
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: ustrbuf.hxx:369
sal_Unicode * appendUninitialized(sal_Int32 length) SAL_RETURNS_NONNULL
Unsafe way to make space for a fixed amount of characters to be appended into this OUStringBuffer.
Definition: ustrbuf.hxx:937
void accessInternals(rtl_uString ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OUStringBuffer, for effective manipulation.
Definition: ustrbuf.hxx:1326
OUStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: ustrbuf.hxx:755
This String class provides base functionality for C++ like Unicode character array handling.
Definition: ustring.hxx:161
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:774
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:623
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:752