24#ifndef INCLUDED_RTL_USTRBUF_HXX
25#define INCLUDED_RTL_USTRBUF_HXX
34#if defined LIBO_INTERNAL_ONLY
43#ifdef LIBO_INTERNAL_ONLY
44#include "rtl/stringconcat.hxx"
47#ifdef RTL_STRING_UNITTEST
48extern bool rtl_string_unittest_invalid_conversion;
56#ifdef RTL_STRING_UNITTEST
57#define rtl rtlunittest
63#ifdef RTL_STRING_UNITTEST
92 , nCapacity( value.nCapacity )
105 , nCapacity( length )
109#if __cplusplus >= 201103L
114#if SAL_TYPES_SIZEOFLONG == 4
116 explicit OUStringBuffer(
long length)
117 : OUStringBuffer(static_cast<int>(length))
120 explicit OUStringBuffer(
unsigned long length)
121 : OUStringBuffer(static_cast<int>(length))
126 explicit OUStringBuffer(
char) =
delete;
140#if defined LIBO_INTERNAL_ONLY
141 explicit OUStringBuffer(std::u16string_view sv)
143 , nCapacity( sv.length() + 16 )
145 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
146 throw std::bad_alloc();
153 , nCapacity( value.getLength() + 16 )
158 template<
typename T >
161 , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
169#ifdef RTL_STRING_UNITTEST
170 rtl_string_unittest_const_literal =
true;
174#if defined LIBO_INTERNAL_ONLY
183 nCapacity(libreoffice_internal::ConstCharArrayDetector<T>::length + 16)
192 template<std::
size_t N> OUStringBuffer(OUStringLiteral<N>
const & literal):
193 pData(nullptr), nCapacity(literal.getLength() + 16)
199#if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST
205 template<
typename T >
206 OUStringBuffer( T&,
typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
211 rtl_string_unittest_invalid_conversion =
true;
217 template<
typename T >
218 OUStringBuffer(
const T&,
typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
223 rtl_string_unittest_invalid_conversion =
true;
228#ifdef LIBO_INTERNAL_ONLY
233 template< typename T1, typename T2 >
234 OUStringBuffer( OUStringConcat< T1, T2 >&& c )
236 const sal_Int32 l = c.length();
248 template<
typename T >
249 OUStringBuffer( OUStringNumber< T >&& n )
251 , nCapacity( n.length + 16 )
257#if defined LIBO_INTERNAL_ONLY
258 operator std::u16string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
270 nCapacity = value.nCapacity;
279#if defined LIBO_INTERNAL_ONLY
281 sal_Int32 n =
string.length();
282 if (n >= nCapacity) {
283 ensureCapacity(n + 16);
286 pData->buffer,
string.data(),
294 if (n >= nCapacity) {
295 ensureCapacity(n + 16);
298 pData->buffer,
string.pData->buffer,
311 operator =(T & literal) {
316 if (n >= nCapacity) {
317 ensureCapacity(n + 16);
323 for (sal_Int32 i = 0; i <= n; ++i) {
330#if defined LIBO_INTERNAL_ONLY
335 operator =(T & literal) {
338 if (n >= nCapacity) {
339 ensureCapacity(n + 16);
343 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
350 template<std::
size_t N> OUStringBuffer & operator =(OUStringLiteral<N>
const & literal) {
351 sal_Int32
const n = literal.getLength();
352 if (n >= nCapacity) {
353 ensureCapacity(n + 16);
356 pData->buffer, literal.getStr(),
363#if defined LIBO_INTERNAL_ONLY
365 template<
typename T1,
typename T2>
366 OUStringBuffer & operator =(OUStringConcat<T1, T2> && concat) {
367 sal_Int32
const n = concat.length();
368 if (n >= nCapacity) {
369 ensureCapacity(n + 16);
371 *concat.addData(pData->buffer) = 0;
378 OUStringBuffer & operator =(OUStringNumber<T> && n)
380 *
this = OUStringBuffer( std::move( n ) );
415 return pData->length;
428 return pData->length == 0;
482 assert(newLength >= 0);
484 if( newLength != pData->length )
486 if( newLength > nCapacity )
489 pData->buffer[newLength] = 0;
490 pData->length = newLength;
510 assert(index >= 0 && index < pData->length);
511 return pData->buffer[ index ];
527 assert(index >= 0 && index < pData->length);
528 pData->buffer[ index ] = ch;
548 assert(index >= 0 && index < pData->length);
549 return pData->buffer[index];
563 assert(index >= 0 && index < pData->length);
564 return pData->buffer[index];
573 return OUString(pData->buffer, pData->length);
591#if defined LIBO_INTERNAL_ONLY
593 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
594 throw std::bad_alloc();
596 return append(sv.data(), sv.size());
632#if defined LIBO_INTERNAL_ONLY
635 append(T
const & str)
658 assert( len == 0 || str != NULL );
668 template<
typename T >
678#if defined LIBO_INTERNAL_ONLY
681 append(T & value) {
return append(
static_cast<sal_Unicode *
>(value)); }
685 typename libreoffice_internal::ConstCharArrayDetector<
686 T, OUStringBuffer &>::TypeUtf16
687 append(T & literal) {
689 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
690 libreoffice_internal::ConstCharArrayDetector<T>::length);
694 template<std::
size_t N> OUStringBuffer & append(OUStringLiteral<N>
const & literal) {
695 return append(literal.getStr(), literal.getLength());
699#ifdef LIBO_INTERNAL_ONLY
704 template< typename T1, typename T2 >
705 OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
707 sal_Int32 l = c.length();
712 sal_Unicode* end = c.addData( pData->buffer + pData->length );
722 template<
typename T >
723 OUStringBuffer& append( OUStringNumber< T >&& c )
725 return append( c.buf, c.length );
797 template<
typename T >
844 assert(
static_cast< unsigned char >(c) <= 0x7F);
860 return append( &c, 1 );
863#if defined LIBO_INTERNAL_ONLY
864 void append(sal_uInt16) =
delete;
951 return insertUtf32(getLength(), c);
970 sal_Int32 n = getLength();
972 return pData->buffer + n;
990#if defined LIBO_INTERNAL_ONLY
991 OUStringBuffer & insert(sal_Int32 offset, std::u16string_view str)
993 return insert( offset, str.data(), str.length() );
1043 assert( len == 0 || str != NULL );
1053 template<
typename T >
1059 &pData, &nCapacity, offset,
1065#if defined LIBO_INTERNAL_ONLY
1067 template<
typename T>
1070 insert(sal_Int32 offset, T & literal) {
1078 template<std::
size_t N>
1079 OUStringBuffer & insert(sal_Int32 offset, OUStringLiteral<N>
const & literal) {
1080 return insert(offset, literal.getStr(), literal.getLength());
1153 return insert( offset, &u, 1 );
1174 return insert( offset, &c, 1 );
1341 sal_Int32 index = 0;
1342 while((index = indexOf(oldChar, index)) >= 0)
1344 pData->buffer[ index ] = newChar;
1365 sal_Int32 ** pInternalCapacity)
1367 *pInternalData = &pData;
1368 *pInternalCapacity = &nCapacity;
1389 assert( fromIndex >= 0 && fromIndex <= pData->length );
1391 return (ret < 0 ? ret : ret+fromIndex);
1426 assert( fromIndex >= 0 && fromIndex <= pData->length );
1447#if defined LIBO_INTERNAL_ONLY
1448 sal_Int32 indexOf( std::u16string_view str, sal_Int32 fromIndex = 0 )
const
1450 assert( fromIndex >= 0 && fromIndex <= pData->length );
1452 str.data(), str.length() );
1453 return (ret < 0 ? ret : ret+fromIndex);
1458 assert( fromIndex >= 0 && fromIndex <= pData->length );
1460 str.pData->buffer, str.pData->length );
1461 return (ret < 0 ? ret : ret+fromIndex);
1470 template<
typename T >
1476 pData->buffer + fromIndex, pData->length - fromIndex,
1479 return n < 0 ? n : n + fromIndex;
1482#if defined LIBO_INTERNAL_ONLY
1484 template<
typename T>
1487 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
1488 assert(fromIndex >= 0);
1490 pData->buffer + fromIndex, pData->length - fromIndex,
1493 return n < 0 ? n : n + fromIndex;
1497 template<std::
size_t N>
1498 sal_Int32 indexOf(OUStringLiteral<N>
const & literal, sal_Int32 fromIndex = 0)
1502 pData->buffer + fromIndex, pData->length - fromIndex, literal.getStr(),
1503 literal.getLength());
1504 return n < 0 ? n : n + fromIndex;
1525#if defined LIBO_INTERNAL_ONLY
1526 sal_Int32 lastIndexOf( std::u16string_view str )
const
1529 str.data(), str.length() );
1535 str.pData->buffer, str.pData->length );
1559 assert( fromIndex >= 0 && fromIndex <= pData->length );
1561 str.pData->buffer, str.pData->length );
1569 template<
typename T >
1575 pData->buffer, pData->length,
1580#if defined LIBO_INTERNAL_ONLY
1582 template<
typename T>
1585 lastIndexOf(T & literal)
const {
1587 pData->buffer, pData->length,
1593 template<std::
size_t N> sal_Int32 lastIndexOf(OUStringLiteral<N>
const & literal)
const {
1595 pData->buffer, pData->length, literal.getStr(), literal.getLength());
1611 for(index = 0; index < getLength() ; index++)
1613 if(pData->buffer[ index ] != c)
1636 sal_Int32 result = getLength();
1638 for(index = getLength(); index > 0 ; index--)
1640 if(pData->buffer[ index - 1 ] != c)
1645 if(index < getLength())
1649 return result - getLength();
1662 return stripStart(c) + stripEnd(c);
1665#if defined LIBO_INTERNAL_ONLY
1678 assert(beginIndex >= 0);
1679 assert(beginIndex <= getLength());
1680 return subView(beginIndex, getLength() - beginIndex);
1697 assert(beginIndex >= 0);
1699 assert(beginIndex <= getLength());
1700 assert(count <= getLength() - beginIndex);
1701 return std::u16string_view(pData->buffer, sal_uInt32(pData->length)).substr(beginIndex, count);
1718 return copy( beginIndex, getLength() - beginIndex );
1736 assert(beginIndex >= 0 && beginIndex <= getLength());
1737 assert(count >= 0 && count <= getLength() - beginIndex);
1738 rtl_uString *pNew = NULL;
1747 nCapacity = capacity;
1753 rtl_uString * pData;
1758 sal_Int32 nCapacity;
1761#if defined LIBO_INTERNAL_ONLY
1762template<>
struct ToStringHelper<OUStringBuffer> {
1763 static std::size_t length(OUStringBuffer
const & s) {
return s.
getLength(); }
1766 {
return addDataHelper(buffer, s.getStr(), s.getLength()); }
1768 static constexpr bool allowOStringConcat =
false;
1769 static constexpr bool allowOUStringConcat =
true;
1773#if defined LIBO_INTERNAL_ONLY
1780 return operator=(str.toString());
1782 return internalAppend(str.pData);
1787#ifdef RTL_STRING_UNITTEST
1790typedef rtlunittest::OUStringBuffer OUStringBuffer;
1794#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
1795using ::rtl::OUStringBuffer;
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:474
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:378
@ SAL_NO_ACQUIRE
definition of a no acquire enum for ctors
Definition: types.h:356
unsigned char sal_Bool
Definition: types.h:38
sal_uInt16 sal_Unicode
Definition: types.h:123
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:284
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:587
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1026
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1045
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:984
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 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 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:919
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:961
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 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 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 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.
Definition: unotype.hxx:47
Definition: stringutils.hxx:136
Definition: stringutils.hxx:139
Definition: stringutils.hxx:163
Definition: stringutils.hxx:191
Definition: stringutils.hxx:352
Definition: stringutils.hxx:371
A string buffer implements a mutable sequence of characters.
Definition: ustrbuf.hxx:70
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:1424
sal_Int32 stripStart(sal_Unicode c=' ')
Strip the given character from the start of the buffer.
Definition: ustrbuf.hxx:1608
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:1054
OUStringBuffer & append(rtl_uString *str)
Definition: ustrbuf.hxx:808
OUStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: ustrbuf.hxx:787
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1716
bool isEmpty() const
Checks if a string buffer is empty.
Definition: ustrbuf.hxx:426
OUStringBuffer copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1734
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition: ustrbuf.hxx:842
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: ustrbuf.hxx:441
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: ustrbuf.hxx:413
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: ustrbuf.hxx:1126
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition: ustrbuf.hxx:1339
sal_Int32 strip(sal_Unicode c=' ')
Strip the given character from the both end of the buffer.
Definition: ustrbuf.hxx:1660
OUStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters.
Definition: ustrbuf.hxx:77
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:1456
OUStringBuffer & appendAscii(const char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:768
OUStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: ustrbuf.hxx:824
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: ustrbuf.hxx:480
OUStringBuffer(const OUStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition: ustrbuf.hxx:90
OUStringBuffer(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition: ustrbuf.hxx:159
OUStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: ustrbuf.hxx:931
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:1387
OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition: ustrbuf.hxx:571
OUStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition: ustrbuf.hxx:897
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition: ustrbuf.hxx:858
OUStringBuffer & append(const OUString &str)
Appends the string to this string buffer.
Definition: ustrbuf.hxx:586
OUStringBuffer & remove(sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
Definition: ustrbuf.hxx:1307
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:879
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:969
OUStringBuffer insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: ustrbuf.hxx:1245
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:1557
sal_Int32 stripEnd(sal_Unicode c=' ')
Strip the given character from the end of the buffer.
Definition: ustrbuf.hxx:1634
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1172
OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: ustrbuf.hxx:1101
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:1471
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition: ustrbuf.hxx:612
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:656
OUStringBuffer & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition: ustrbuf.hxx:950
OUStringBuffer & appendAscii(const char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:745
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustrbuf.hxx:1405
OUStringBuffer(const OUString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition: ustrbuf.hxx:151
~OUStringBuffer()
Release the string data.
Definition: ustrbuf.hxx:388
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:669
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:1196
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:1018
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition: ustrbuf.hxx:1323
OUStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition: ustrbuf.hxx:914
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:1570
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition: ustrbuf.hxx:457
OUStringBuffer(int length)
Constructs a string buffer with no characters in it and an initial capacity specified by the length a...
Definition: ustrbuf.hxx:103
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition: ustrbuf.hxx:996
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:1041
OUStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer.
Definition: ustrbuf.hxx:1269
OUStringBuffer & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
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:1150
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition: ustrbuf.hxx:535
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:1221
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustrbuf.hxx:1532
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: ustrbuf.hxx:401
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition: ustrbuf.hxx:1290
void accessInternals(rtl_uString ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OUStringBuffer, for effective manipulation.
Definition: ustrbuf.hxx:1364
This String class provides base functionality for C++ like Unicode character array handling.
Definition: ustring.hxx:169
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:781
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:759
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:630