24#ifndef INCLUDED_RTL_USTRBUF_HXX
25#define INCLUDED_RTL_USTRBUF_HXX
34#if defined LIBO_INTERNAL_ONLY
45#ifdef LIBO_INTERNAL_ONLY
46#include "rtl/stringconcat.hxx"
49#ifdef RTL_STRING_UNITTEST
50extern bool rtl_string_unittest_invalid_conversion;
58#ifdef RTL_STRING_UNITTEST
59#define rtl rtlunittest
65#ifdef RTL_STRING_UNITTEST
94 , nCapacity( value.nCapacity )
107 , nCapacity( length )
111#if defined LIBO_INTERNAL_ONLY
113 explicit OUStringBuffer(T length, std::enable_if_t<std::is_integral_v<T>,
int> = 0)
118 &&
static_cast<std::make_unsigned_t<T>
>(length)
119 <=
static_cast<std::make_unsigned_t<sal_Int32>
>(
120 std::numeric_limits<sal_Int32>::max()));
123 explicit OUStringBuffer(
bool) =
delete;
124 explicit OUStringBuffer(
char) =
delete;
125 explicit OUStringBuffer(
wchar_t) =
delete;
126#if defined __cpp_char8_t
127 explicit OUStringBuffer(
char8_t) =
delete;
129 explicit OUStringBuffer(
char16_t) =
delete;
130 explicit OUStringBuffer(
char32_t) =
delete;
143#if defined LIBO_INTERNAL_ONLY
144 OUStringBuffer(std::u16string_view sv)
146 , nCapacity( sv.length() + 16 )
148 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
149 throw std::bad_alloc();
156 , nCapacity( value.getLength() + 16 )
162 template<
typename T >
165 , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
173#ifdef RTL_STRING_UNITTEST
174 rtl_string_unittest_const_literal =
true;
178#if defined LIBO_INTERNAL_ONLY
187 nCapacity(libreoffice_internal::ConstCharArrayDetector<T>::length + 16)
196#if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST
202 template<
typename T >
203 OUStringBuffer( T&,
typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
208 rtl_string_unittest_invalid_conversion =
true;
214 template<
typename T >
215 OUStringBuffer(
const T&,
typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
220 rtl_string_unittest_invalid_conversion =
true;
225#ifdef LIBO_INTERNAL_ONLY
230 template< typename T1, typename T2 >
231 OUStringBuffer( OUStringConcat< T1, T2 >&& c )
233 const sal_Int32 l = c.length();
245 template<
typename T, std::
size_t N >
246 OUStringBuffer( StringNumberBase< sal_Unicode, T, N >&& n )
248 , nCapacity( n.length + 16 )
254#if defined LIBO_INTERNAL_ONLY
255 operator std::u16string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
267 nCapacity = value.nCapacity;
272#if defined LIBO_INTERNAL_ONLY
280 nCapacity = value.nCapacity;
281 value.pData =
nullptr;
292#if defined LIBO_INTERNAL_ONLY
293 OUStringBuffer & operator =(std::u16string_view
string) {
294 sal_Int32 n =
string.length();
295 if (n >= nCapacity) {
296 ensureCapacity(n + 16);
299 pData->buffer,
string.data(),
301 pData->buffer[n] =
'\0';
308 if (n >= nCapacity) {
309 ensureCapacity(n + 16);
312 pData->buffer,
string.pData->buffer,
326 operator =(T & literal) {
331 if (n >= nCapacity) {
332 ensureCapacity(n + 16);
338 for (sal_Int32 i = 0; i <= n; ++i) {
345#if defined LIBO_INTERNAL_ONLY
350 operator =(T & literal) {
353 if (n >= nCapacity) {
354 ensureCapacity(n + 16);
361 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
363 pData->buffer[n] =
'\0';
369#if defined LIBO_INTERNAL_ONLY
371 template<
typename T1,
typename T2>
372 OUStringBuffer & operator =(OUStringConcat<T1, T2> && concat) {
373 sal_Int32
const n = concat.length();
374 if (n >= nCapacity) {
375 ensureCapacity(n + 16);
377 *concat.addData(pData->buffer) = 0;
383 template<
typename T, std::
size_t N>
384 OUStringBuffer & operator =(StringNumberBase<sal_Unicode, T, N> && n)
386 *
this = OUStringBuffer( std::move( n ) );
421 return pData->length;
434 return pData->length == 0;
488 assert(newLength >= 0);
490 if( newLength != pData->length )
492 if( newLength > nCapacity )
495 pData->buffer[newLength] = 0;
496 pData->length = newLength;
516 assert(index >= 0 && index < pData->length);
517 return pData->buffer[ index ];
533 assert(index >= 0 && index < pData->length);
534 pData->buffer[ index ] = ch;
554 assert(index >= 0 && index < pData->length);
555 return pData->buffer[index];
569 assert(index >= 0 && index < pData->length);
570 return pData->buffer[index];
579 return OUString(pData->buffer, pData->length);
592#if !defined LIBO_INTERNAL_ONLY
599 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
600 throw std::bad_alloc();
602 return append(sv.data(), sv.size());
606#if !defined LIBO_INTERNAL_ONLY
640#if defined LIBO_INTERNAL_ONLY
643 append(T
const & str)
666 assert( len == 0 || str != NULL );
676 template<
typename T >
686#if defined LIBO_INTERNAL_ONLY
689 append(T & value) {
return append(
static_cast<sal_Unicode *
>(value)); }
693 typename libreoffice_internal::ConstCharArrayDetector<
694 T, OUStringBuffer &>::TypeUtf16
695 append(T & literal) {
697 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
698 libreoffice_internal::ConstCharArrayDetector<T>::length);
702#ifdef LIBO_INTERNAL_ONLY
707 template< typename T1, typename T2 >
708 OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
710 sal_Int32 l = c.length();
715 sal_Unicode* end = c.addData( pData->buffer + pData->length );
725 template<
typename T, std::
size_t N >
726 OUStringBuffer& append( StringNumberBase< sal_Unicode, T, N >&& c )
728 return append( c.buf, c.length );
799 template<
typename T >
846 assert(
static_cast< unsigned char >(c) <= 0x7F);
862 return append( &c, 1 );
865#if defined LIBO_INTERNAL_ONLY
866 void append(sal_uInt16) =
delete;
953 return insertUtf32(getLength(), c);
972 sal_Int32 n = getLength();
974 return pData->buffer + n;
977#if defined LIBO_INTERNAL_ONLY
987 return append(std::forward<T>(rValue));
1006#if defined LIBO_INTERNAL_ONLY
1007 OUStringBuffer & insert(sal_Int32 offset, std::u16string_view str)
1009 return insert( offset, str.data(), str.length() );
1060 assert( len == 0 || str != NULL );
1070 template<
typename T >
1076 &pData, &nCapacity, offset,
1082#if defined LIBO_INTERNAL_ONLY
1084 template<
typename T>
1087 insert(sal_Int32 offset, T & literal) {
1164 return insert( offset, &u, 1 );
1185 return insert( offset, &c, 1 );
1352 sal_Int32 index = 0;
1353 while((index = indexOf(oldChar, index)) >= 0)
1355 pData->buffer[ index ] = newChar;
1376 sal_Int32 ** pInternalCapacity)
1378 *pInternalData = &pData;
1379 *pInternalCapacity = &nCapacity;
1400 assert( fromIndex >= 0 && fromIndex <= pData->length );
1402 return (ret < 0 ? ret : ret+fromIndex);
1437 assert( fromIndex >= 0 && fromIndex <= pData->length );
1458#if defined LIBO_INTERNAL_ONLY
1459 sal_Int32 indexOf( std::u16string_view str, sal_Int32 fromIndex = 0 )
const
1461 assert( fromIndex >= 0 && fromIndex <= pData->length );
1463 str.data(), str.length() );
1464 return (ret < 0 ? ret : ret+fromIndex);
1469 assert( fromIndex >= 0 && fromIndex <= pData->length );
1471 str.pData->buffer, str.pData->length );
1472 return (ret < 0 ? ret : ret+fromIndex);
1482 template<
typename T >
1488 pData->buffer + fromIndex, pData->length - fromIndex,
1491 return n < 0 ? n : n + fromIndex;
1494#if defined LIBO_INTERNAL_ONLY
1496 template<
typename T>
1499 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
1500 assert(fromIndex >= 0);
1502 pData->buffer + fromIndex, pData->length - fromIndex,
1505 return n < 0 ? n : n + fromIndex;
1526#if defined LIBO_INTERNAL_ONLY
1527 sal_Int32 lastIndexOf( std::u16string_view str )
const
1530 str.data(), str.length() );
1536 str.pData->buffer, str.pData->length );
1559#if defined LIBO_INTERNAL_ONLY
1560 sal_Int32 lastIndexOf( std::u16string_view str, sal_Int32 fromIndex )
const
1562 assert( fromIndex >= 0 && fromIndex <= pData->length );
1564 str.data(), str.length() );
1569 assert( fromIndex >= 0 && fromIndex <= pData->length );
1571 str.pData->buffer, str.pData->length );
1580 template<
typename T >
1586 pData->buffer, pData->length,
1591#if defined LIBO_INTERNAL_ONLY
1593 template<
typename T>
1596 lastIndexOf(T & literal)
const {
1598 pData->buffer, pData->length,
1616 for(index = 0; index < getLength() ; index++)
1618 if(pData->buffer[ index ] != c)
1641 sal_Int32 result = getLength();
1643 for(index = getLength(); index > 0 ; index--)
1645 if(pData->buffer[ index - 1 ] != c)
1650 if(index < getLength())
1654 return result - getLength();
1667 return stripStart(c) + stripEnd(c);
1670#if defined LIBO_INTERNAL_ONLY
1683 assert(beginIndex >= 0);
1684 assert(beginIndex <= getLength());
1685 return subView(beginIndex, getLength() - beginIndex);
1702 assert(beginIndex >= 0);
1704 assert(beginIndex <= getLength());
1705 assert(count <= getLength() - beginIndex);
1706 return std::u16string_view(pData->buffer, sal_uInt32(pData->length)).substr(beginIndex, count);
1723 return copy( beginIndex, getLength() - beginIndex );
1741 assert(beginIndex >= 0 && beginIndex <= getLength());
1742 assert(count >= 0 && count <= getLength() - beginIndex);
1743 rtl_uString *pNew = NULL;
1752 nCapacity = capacity;
1758 rtl_uString * pData;
1763 sal_Int32 nCapacity;
1766#if defined LIBO_INTERNAL_ONLY
1767template<>
struct ToStringHelper<OUStringBuffer> {
1768 static std::size_t length(OUStringBuffer
const & s) {
return s.
getLength(); }
1771 {
return addDataHelper(buffer, s.getStr(), s.getLength()); }
1775#if defined LIBO_INTERNAL_ONLY
1782 return operator=(str.toString());
1784 return internalAppend(str.pData);
1794#ifdef RTL_STRING_UNITTEST
1797typedef rtlunittest::OUStringBuffer OUStringBuffer;
1801#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
1802using ::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
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.
SAL_DLLPUBLIC void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
#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
Definition: bootstrap.hxx:34
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, OString const &rString)
Support for rtl::OString in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO macros,...
Definition: string.hxx:2325
Definition: stringutils.hxx:140
Definition: stringutils.hxx:143
Definition: stringutils.hxx:167
Definition: stringutils.hxx:195
Definition: stringutils.hxx:356
Definition: stringutils.hxx:375
A string buffer implements a mutable sequence of characters.
Definition: ustrbuf.hxx:72
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:1435
sal_Int32 stripStart(sal_Unicode c=' ')
Strip the given character from the start of the buffer.
Definition: ustrbuf.hxx:1613
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:1071
OUStringBuffer & append(rtl_uString *str)
Definition: ustrbuf.hxx:810
OUStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: ustrbuf.hxx:789
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1721
bool isEmpty() const
Checks if a string buffer is empty.
Definition: ustrbuf.hxx:432
OUStringBuffer copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1739
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition: ustrbuf.hxx:844
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: ustrbuf.hxx:447
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: ustrbuf.hxx:419
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: ustrbuf.hxx:1137
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition: ustrbuf.hxx:1350
sal_Int32 strip(sal_Unicode c=' ')
Strip the given character from the both end of the buffer.
Definition: ustrbuf.hxx:1665
OUStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters.
Definition: ustrbuf.hxx:79
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:1467
OUStringBuffer & appendAscii(const char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:770
OUStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: ustrbuf.hxx:826
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: ustrbuf.hxx:486
OUStringBuffer(const OUStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition: ustrbuf.hxx:92
OUStringBuffer(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition: ustrbuf.hxx:163
OUStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: ustrbuf.hxx:933
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:1398
OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition: ustrbuf.hxx:577
OUStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition: ustrbuf.hxx:899
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition: ustrbuf.hxx:860
OUStringBuffer & append(const OUString &str)
Appends the string to this string buffer.
Definition: ustrbuf.hxx:593
OUStringBuffer & remove(sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
Definition: ustrbuf.hxx:1318
OUStringBuffer(sal_Int32 length)
Constructs a string buffer with no characters in it and an initial capacity specified by the length a...
Definition: ustrbuf.hxx:105
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:881
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:971
OUStringBuffer insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: ustrbuf.hxx:1256
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:1567
sal_Int32 stripEnd(sal_Unicode c=' ')
Strip the given character from the end of the buffer.
Definition: ustrbuf.hxx:1639
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1183
OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: ustrbuf.hxx:1112
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:1483
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition: ustrbuf.hxx:619
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:664
OUStringBuffer & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition: ustrbuf.hxx:952
OUStringBuffer & appendAscii(const char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:748
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustrbuf.hxx:1416
OUStringBuffer(const OUString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition: ustrbuf.hxx:154
~OUStringBuffer()
Release the string data.
Definition: ustrbuf.hxx:394
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:677
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:1207
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:1035
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition: ustrbuf.hxx:1334
OUStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition: ustrbuf.hxx:916
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:1581
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition: ustrbuf.hxx:463
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition: ustrbuf.hxx:1012
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:1058
OUStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer.
Definition: ustrbuf.hxx:1280
OUStringBuffer & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
Definition: ustrbuf.hxx:645
OUStringBuffer & insert(sal_Int32 offset, char c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1161
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition: ustrbuf.hxx:541
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:1232
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustrbuf.hxx:1533
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: ustrbuf.hxx:407
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition: ustrbuf.hxx:1301
void accessInternals(rtl_uString ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OUStringBuffer, for effective manipulation.
Definition: ustrbuf.hxx:1375
This String class provides base functionality for C++ like Unicode character array handling.
Definition: ustring.hxx:203
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:826
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition: ustring.hxx:540
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:804
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:675