24 #ifndef INCLUDED_RTL_USTRBUF_HXX
25 #define INCLUDED_RTL_USTRBUF_HXX
34 #if defined LIBO_INTERNAL_ONLY
35 #include <string_view>
36 #include <type_traits>
44 #ifdef LIBO_INTERNAL_ONLY
45 #include "rtl/stringconcat.hxx"
48 #ifdef RTL_STRING_UNITTEST
49 extern bool rtl_string_unittest_invalid_conversion;
57 #ifdef RTL_STRING_UNITTEST
58 #define rtl rtlunittest
64 #ifdef RTL_STRING_UNITTEST
93 , nCapacity( value.nCapacity )
106 , nCapacity( length )
110 #if defined LIBO_INTERNAL_ONLY
112 explicit OUStringBuffer(T length, std::enable_if_t<std::is_integral_v<T>,
int> = 0)
117 &&
static_cast<std::make_unsigned_t<T>
>(length)
118 <=
static_cast<std::make_unsigned_t<sal_Int32>
>(
119 std::numeric_limits<sal_Int32>::max()));
122 explicit OUStringBuffer(
bool) =
delete;
123 explicit OUStringBuffer(
char) =
delete;
124 explicit OUStringBuffer(
wchar_t) =
delete;
125 #if defined __cpp_char8_t
126 explicit OUStringBuffer(char8_t) =
delete;
128 explicit OUStringBuffer(char16_t) =
delete;
129 explicit OUStringBuffer(char32_t) =
delete;
142 #if defined LIBO_INTERNAL_ONLY
143 OUStringBuffer(std::u16string_view sv)
145 , nCapacity( sv.length() + 16 )
147 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
148 throw std::bad_alloc();
155 , nCapacity( value.getLength() + 16 )
161 template<
typename T >
164 , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
172 #ifdef RTL_STRING_UNITTEST
173 rtl_string_unittest_const_literal =
true;
177 #if defined LIBO_INTERNAL_ONLY
186 nCapacity(libreoffice_internal::ConstCharArrayDetector<T>::length + 16)
195 #if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST
201 template<
typename T >
202 OUStringBuffer( T&,
typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
207 rtl_string_unittest_invalid_conversion =
true;
213 template<
typename T >
214 OUStringBuffer(
const T&,
typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
219 rtl_string_unittest_invalid_conversion =
true;
224 #ifdef LIBO_INTERNAL_ONLY
229 template< typename T1, typename T2 >
230 OUStringBuffer( OUStringConcat< T1, T2 >&& c )
232 const sal_Int32 l = c.length();
244 template<
typename T >
245 OUStringBuffer( OUStringNumber< T >&& n )
247 , nCapacity( n.length + 16 )
253 #if defined LIBO_INTERNAL_ONLY
254 operator std::u16string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
266 nCapacity = value.nCapacity;
271 #if defined LIBO_INTERNAL_ONLY
279 nCapacity = value.nCapacity;
280 value.pData =
nullptr;
291 #if defined LIBO_INTERNAL_ONLY
292 OUStringBuffer & operator =(std::u16string_view
string) {
293 sal_Int32 n =
string.length();
294 if (n >= nCapacity) {
295 ensureCapacity(n + 16);
298 pData->buffer,
string.data(),
300 pData->buffer[n] =
'\0';
307 if (n >= nCapacity) {
308 ensureCapacity(n + 16);
311 pData->buffer,
string.pData->buffer,
325 operator =(T & literal) {
330 if (n >= nCapacity) {
331 ensureCapacity(n + 16);
337 for (sal_Int32 i = 0; i <= n; ++i) {
344 #if defined LIBO_INTERNAL_ONLY
349 operator =(T & literal) {
352 if (n >= nCapacity) {
353 ensureCapacity(n + 16);
360 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
362 pData->buffer[n] =
'\0';
368 #if defined LIBO_INTERNAL_ONLY
370 template<
typename T1,
typename T2>
371 OUStringBuffer & operator =(OUStringConcat<T1, T2> && concat) {
372 sal_Int32
const n = concat.length();
373 if (n >= nCapacity) {
374 ensureCapacity(n + 16);
376 *concat.addData(pData->buffer) = 0;
383 OUStringBuffer & operator =(OUStringNumber<T> && n)
385 *
this = OUStringBuffer( std::move( n ) );
420 return pData->length;
433 return pData->length == 0;
487 assert(newLength >= 0);
489 if( newLength != pData->length )
491 if( newLength > nCapacity )
494 pData->buffer[newLength] = 0;
495 pData->length = newLength;
515 assert(index >= 0 && index < pData->length);
516 return pData->buffer[ index ];
532 assert(index >= 0 && index < pData->length);
533 pData->buffer[ index ] = ch;
553 assert(index >= 0 && index < pData->length);
554 return pData->buffer[index];
568 assert(index >= 0 && index < pData->length);
569 return pData->buffer[index];
578 return OUString(pData->buffer, pData->length);
591 #if !defined LIBO_INTERNAL_ONLY
598 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
599 throw std::bad_alloc();
601 return append(sv.data(), sv.size());
605 #if !defined LIBO_INTERNAL_ONLY
639 #if defined LIBO_INTERNAL_ONLY
642 append(T
const & str)
665 assert( len == 0 || str != NULL );
675 template<
typename T >
685 #if defined LIBO_INTERNAL_ONLY
688 append(T & value) {
return append(
static_cast<sal_Unicode *
>(value)); }
692 typename libreoffice_internal::ConstCharArrayDetector<
693 T, OUStringBuffer &>::TypeUtf16
694 append(T & literal) {
696 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
697 libreoffice_internal::ConstCharArrayDetector<T>::length);
701 #ifdef LIBO_INTERNAL_ONLY
706 template< typename T1, typename T2 >
707 OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
709 sal_Int32 l = c.length();
714 sal_Unicode* end = c.addData( pData->buffer + pData->length );
724 template<
typename T >
725 OUStringBuffer& append( OUStringNumber< T >&& c )
727 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;
992 #if defined LIBO_INTERNAL_ONLY
993 OUStringBuffer & insert(sal_Int32 offset, std::u16string_view str)
995 return insert( offset, str.data(), str.length() );
1046 assert( len == 0 || str != NULL );
1056 template<
typename T >
1062 &pData, &nCapacity, offset,
1068 #if defined LIBO_INTERNAL_ONLY
1070 template<
typename T>
1073 insert(sal_Int32 offset, T & literal) {
1150 return insert( offset, &u, 1 );
1171 return insert( offset, &c, 1 );
1338 sal_Int32 index = 0;
1339 while((index = indexOf(oldChar, index)) >= 0)
1341 pData->buffer[ index ] = newChar;
1362 sal_Int32 ** pInternalCapacity)
1364 *pInternalData = &pData;
1365 *pInternalCapacity = &nCapacity;
1386 assert( fromIndex >= 0 && fromIndex <= pData->length );
1388 return (ret < 0 ? ret : ret+fromIndex);
1423 assert( fromIndex >= 0 && fromIndex <= pData->length );
1444 #if defined LIBO_INTERNAL_ONLY
1445 sal_Int32 indexOf( std::u16string_view str, sal_Int32 fromIndex = 0 )
const
1447 assert( fromIndex >= 0 && fromIndex <= pData->length );
1449 str.data(), str.length() );
1450 return (ret < 0 ? ret : ret+fromIndex);
1455 assert( fromIndex >= 0 && fromIndex <= pData->length );
1457 str.pData->buffer, str.pData->length );
1458 return (ret < 0 ? ret : ret+fromIndex);
1468 template<
typename T >
1474 pData->buffer + fromIndex, pData->length - fromIndex,
1477 return n < 0 ? n : n + fromIndex;
1480 #if defined LIBO_INTERNAL_ONLY
1482 template<
typename T>
1485 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
1486 assert(fromIndex >= 0);
1488 pData->buffer + fromIndex, pData->length - fromIndex,
1491 return n < 0 ? n : n + fromIndex;
1512 #if defined LIBO_INTERNAL_ONLY
1513 sal_Int32 lastIndexOf( std::u16string_view str )
const
1516 str.data(), str.length() );
1522 str.pData->buffer, str.pData->length );
1545 #if defined LIBO_INTERNAL_ONLY
1546 sal_Int32 lastIndexOf( std::u16string_view str, sal_Int32 fromIndex )
const
1548 assert( fromIndex >= 0 && fromIndex <= pData->length );
1550 str.data(), str.length() );
1555 assert( fromIndex >= 0 && fromIndex <= pData->length );
1557 str.pData->buffer, str.pData->length );
1566 template<
typename T >
1572 pData->buffer, pData->length,
1577 #if defined LIBO_INTERNAL_ONLY
1579 template<
typename T>
1582 lastIndexOf(T & literal)
const {
1584 pData->buffer, pData->length,
1602 for(index = 0; index < getLength() ; index++)
1604 if(pData->buffer[ index ] != c)
1627 sal_Int32 result = getLength();
1629 for(index = getLength(); index > 0 ; index--)
1631 if(pData->buffer[ index - 1 ] != c)
1636 if(index < getLength())
1640 return result - getLength();
1653 return stripStart(c) + stripEnd(c);
1656 #if defined LIBO_INTERNAL_ONLY
1669 assert(beginIndex >= 0);
1670 assert(beginIndex <= getLength());
1671 return subView(beginIndex, getLength() - beginIndex);
1688 assert(beginIndex >= 0);
1690 assert(beginIndex <= getLength());
1691 assert(count <= getLength() - beginIndex);
1692 return std::u16string_view(pData->buffer, sal_uInt32(pData->length)).substr(beginIndex, count);
1709 return copy( beginIndex, getLength() - beginIndex );
1727 assert(beginIndex >= 0 && beginIndex <= getLength());
1728 assert(count >= 0 && count <= getLength() - beginIndex);
1729 rtl_uString *pNew = NULL;
1738 nCapacity = capacity;
1744 rtl_uString * pData;
1749 sal_Int32 nCapacity;
1752 #if defined LIBO_INTERNAL_ONLY
1753 template<>
struct ToStringHelper<OUStringBuffer> {
1754 static std::size_t length(OUStringBuffer
const & s) {
return s.
getLength(); }
1757 {
return addDataHelper(buffer, s.getStr(), s.getLength()); }
1759 static constexpr
bool allowOStringConcat =
false;
1760 static constexpr
bool allowOUStringConcat =
true;
1764 #if defined LIBO_INTERNAL_ONLY
1771 return operator=(str.toString());
1773 return internalAppend(str.pData);
1783 #ifdef RTL_STRING_UNITTEST
1786 typedef rtlunittest::OUStringBuffer OUStringBuffer;
1790 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
1791 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: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 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.
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 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: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
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:71
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:1421
sal_Int32 stripStart(sal_Unicode c=' ')
Strip the given character from the start of the buffer.
Definition: ustrbuf.hxx:1599
OUStringBuffer & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition: ustrbuf.hxx:952
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1707
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition: ustrbuf.hxx:618
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition: ustrbuf.hxx:1336
bool isEmpty() const
Checks if a string buffer is empty.
Definition: ustrbuf.hxx:431
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition: ustrbuf.hxx:998
OUStringBuffer copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1725
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:1021
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: ustrbuf.hxx:446
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: ustrbuf.hxx:418
OUStringBuffer & append(rtl_uString *str)
Definition: ustrbuf.hxx:810
OUStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition: ustrbuf.hxx:916
OUStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: ustrbuf.hxx:933
OUStringBuffer & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
Definition: ustrbuf.hxx:644
OUStringBuffer & appendAscii(const char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:770
sal_Int32 strip(sal_Unicode c=' ')
Strip the given character from the both end of the buffer.
Definition: ustrbuf.hxx:1651
OUStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters.
Definition: ustrbuf.hxx:78
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition: ustrbuf.hxx:1287
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
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:1453
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition: ustrbuf.hxx:540
OUStringBuffer & append(const OUString &str)
Appends the string to this string buffer.
Definition: ustrbuf.hxx:592
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:1218
OUStringBuffer & appendAscii(const char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:747
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: ustrbuf.hxx:485
OUStringBuffer(const OUStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition: ustrbuf.hxx:91
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:1044
OUStringBuffer(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition: ustrbuf.hxx:162
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:1384
OUStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer.
Definition: ustrbuf.hxx:1266
OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition: ustrbuf.hxx:576
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:663
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:104
OUStringBuffer insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: ustrbuf.hxx:1242
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:1553
sal_Int32 stripEnd(sal_Unicode c=' ')
Strip the given character from the end of the buffer.
Definition: ustrbuf.hxx:1625
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:1193
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition: ustrbuf.hxx:860
OUStringBuffer & remove(sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
Definition: ustrbuf.hxx:1304
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:1469
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:676
OUStringBuffer & insert(sal_Int32 offset, char c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1147
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition: ustrbuf.hxx:1320
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustrbuf.hxx:1402
OUStringBuffer(const OUString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition: ustrbuf.hxx:153
~OUStringBuffer()
Release the string data.
Definition: ustrbuf.hxx:393
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:1057
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:1567
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition: ustrbuf.hxx:462
OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: ustrbuf.hxx:1098
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition: ustrbuf.hxx:844
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1169
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: ustrbuf.hxx:1123
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_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustrbuf.hxx:1519
OUStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: ustrbuf.hxx:826
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: ustrbuf.hxx:406
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
void accessInternals(rtl_uString ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OUStringBuffer, for effective manipulation.
Definition: ustrbuf.hxx:1361
OUStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: ustrbuf.hxx:789
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:829
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:678
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:807
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