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 "o3tl/safeint.hxx"
47#include "rtl/stringconcat.hxx"
50#ifdef RTL_STRING_UNITTEST
51extern bool rtl_string_unittest_invalid_conversion;
59#ifdef RTL_STRING_UNITTEST
60#define rtl rtlunittest
66#ifdef RTL_STRING_UNITTEST
95 , nCapacity( value.nCapacity )
108 , nCapacity( length )
112#if defined LIBO_INTERNAL_ONLY
114 explicit OUStringBuffer(T length, std::enable_if_t<std::is_integral_v<T>,
int> = 0)
117 assert(libreoffice_internal::IsValidStrLen(length));
120 explicit OUStringBuffer(
bool) =
delete;
121 explicit OUStringBuffer(
char) =
delete;
122 explicit OUStringBuffer(
wchar_t) =
delete;
123#if !(defined _MSC_VER && _MSC_VER >= 1930 && _MSC_VER <= 1939 && defined _MANAGED)
124 explicit OUStringBuffer(
char8_t) =
delete;
126 explicit OUStringBuffer(
char16_t) =
delete;
127 explicit OUStringBuffer(
char32_t) =
delete;
140#if defined LIBO_INTERNAL_ONLY
141 OUStringBuffer(std::u16string_view sv)
143 , nCapacity(libreoffice_internal::ThrowIfInvalidStrLen(sv.length(), 16) + 16)
156 template<
typename T >
167#ifdef RTL_STRING_UNITTEST
168 rtl_string_unittest_const_literal =
true;
172#if defined LIBO_INTERNAL_ONLY
190#if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST
196 template<
typename T >
197 OUStringBuffer( T&,
typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
202 rtl_string_unittest_invalid_conversion =
true;
208 template<
typename T >
209 OUStringBuffer(
const T&,
typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
214 rtl_string_unittest_invalid_conversion =
true;
219#ifdef LIBO_INTERNAL_ONLY
224 template<
typename T1,
typename T2 >
225 OUStringBuffer( OUStringConcat< T1, T2 >&& c )
227 const sal_Int32 l = c.length();
239 template< std::
size_t N >
240 OUStringBuffer( OUStringNumber< N >&& n )
241 : OUStringBuffer(std::u16string_view(n))
246#if defined LIBO_INTERNAL_ONLY
247 operator std::u16string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
259 nCapacity = value.nCapacity;
264#if defined LIBO_INTERNAL_ONLY
272 nCapacity = value.nCapacity;
273 value.pData =
nullptr;
284#if defined LIBO_INTERNAL_ONLY
285 OUStringBuffer & operator =(std::u16string_view
string) {
286 sal_Int32 n =
string.length();
287 if (n >= nCapacity) {
288 ensureCapacity(n + 16);
291 pData->buffer,
string.data(),
293 pData->buffer[n] =
'\0';
299 sal_Int32 n =
string.getLength();
300 if (n >= nCapacity) {
304 pData->buffer,
string.pData->buffer,
318 operator =(T & literal) {
323 if (n >= nCapacity) {
330 for (sal_Int32 i = 0; i <= n; ++i) {
337#if defined LIBO_INTERNAL_ONLY
342 operator =(T & literal) {
349#if defined LIBO_INTERNAL_ONLY
351 template<
typename T1,
typename T2>
352 OUStringBuffer & operator =(OUStringConcat<T1, T2> && concat) {
353 sal_Int32
const n = concat.length();
354 if (n >= nCapacity) {
355 ensureCapacity(n + 16);
357 *concat.addData(pData->buffer) = 0;
363 template<std::
size_t N>
364 OUStringBuffer & operator =(OUStringNumber<N> && n)
366 return operator =(std::u16string_view(n));
400 return pData->length;
413 return pData->length == 0;
467 assert(newLength >= 0);
469 if( newLength != pData->length )
471 if( newLength > nCapacity )
474 pData->buffer[newLength] = 0;
475 pData->length = newLength;
495 assert(index >= 0 && index < pData->length);
496 return pData->buffer[ index ];
512 assert(index >= 0 && index < pData->length);
513 pData->buffer[ index ] = ch;
533 assert(index >= 0 && index < pData->length);
534 return pData->buffer[index];
548 assert(index >= 0 && index < pData->length);
549 return pData->buffer[index];
558 return OUString(pData->buffer, pData->length);
571#if !defined LIBO_INTERNAL_ONLY
580#if !defined LIBO_INTERNAL_ONLY
614#if defined LIBO_INTERNAL_ONLY
617 append(T
const & str)
648 template<
typename T >
654#if defined LIBO_INTERNAL_ONLY
657 append(T & value) {
return append(
static_cast<sal_Unicode *
>(value)); }
661 typename libreoffice_internal::ConstCharArrayDetector<
662 T, OUStringBuffer &>::TypeUtf16
663 append(T & literal) {
664 return insert(getLength(), literal);
668#ifdef LIBO_INTERNAL_ONLY
673 template<
typename T1,
typename T2 >
674 OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
676 return insert(getLength(), std::move(c));
746 template<
typename T >
792 assert(
static_cast< unsigned char >(c) <= 0x7F);
811#if defined LIBO_INTERNAL_ONLY
812 void append(sal_uInt16) =
delete;
916 return pData->buffer + n;
919#if defined LIBO_INTERNAL_ONLY
929 return append(std::forward<T>(rValue));
948#if defined LIBO_INTERNAL_ONLY
949 OUStringBuffer & insert(sal_Int32 offset, std::u16string_view str)
951 return insert(offset, str.data(), libreoffice_internal::ThrowIfInvalidStrLen(str.length()));
960#ifdef LIBO_INTERNAL_ONLY
965 template <
typename T1,
typename T2>
966 OUStringBuffer& insert(sal_Int32 offset, OUStringConcat<T1, T2>&& c)
968 const size_t l = c.length();
971 if (l > o3tl::make_unsigned(std::numeric_limits<sal_Int32>::max() - pData->length))
972 throw std::bad_alloc();
977 c.addData(pData->buffer + offset);
1024 assert( len == 0 || str != NULL );
1034 template<
typename T >
1040 &pData, &nCapacity, offset,
1046#if defined LIBO_INTERNAL_ONLY
1048 template<
typename T>
1051 insert(sal_Int32 offset, T & literal) {
1148 return insert( offset, &c, 1 );
1321 sal_Int32 index = 0;
1322 while((index =
indexOf(oldChar, index)) >= 0)
1324 pData->buffer[ index ] = newChar;
1345 sal_Int32 ** pInternalCapacity)
1347 *pInternalData = &pData;
1348 *pInternalCapacity = &nCapacity;
1369 assert( fromIndex >= 0 && fromIndex <= pData->length );
1371 return (ret < 0 ? ret : ret+fromIndex);
1406 assert( fromIndex >= 0 && fromIndex <= pData->length );
1427#if defined LIBO_INTERNAL_ONLY
1428 sal_Int32 indexOf( std::u16string_view str, sal_Int32 fromIndex = 0 )
const
1430 assert( fromIndex >= 0 && fromIndex <= pData->length );
1432 str.data(), str.length() );
1433 return (ret < 0 ? ret : ret+fromIndex);
1438 assert( fromIndex >= 0 && fromIndex <= pData->length );
1440 str.pData->buffer, str.pData->length );
1441 return (ret < 0 ? ret : ret+fromIndex);
1451 template<
typename T >
1457 pData->buffer + fromIndex, pData->length - fromIndex,
1460 return n < 0 ? n : n + fromIndex;
1463#if defined LIBO_INTERNAL_ONLY
1465 template<
typename T>
1468 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
1493#if defined LIBO_INTERNAL_ONLY
1494 sal_Int32 lastIndexOf( std::u16string_view str )
const
1497 str.data(), str.length() );
1503 str.pData->buffer, str.pData->length );
1526#if defined LIBO_INTERNAL_ONLY
1527 sal_Int32 lastIndexOf( std::u16string_view str, sal_Int32 fromIndex )
const
1529 assert( fromIndex >= 0 && fromIndex <= pData->length );
1531 str.data(), str.length() );
1536 assert( fromIndex >= 0 && fromIndex <= pData->length );
1538 str.pData->buffer, str.pData->length );
1547 template<
typename T >
1553 pData->buffer, pData->length,
1558#if defined LIBO_INTERNAL_ONLY
1560 template<
typename T>
1563 lastIndexOf(T & literal)
const {
1582 for(index = 0; index <
getLength() ; index++)
1584 if(pData->buffer[ index ] != c)
1609 for(index =
getLength(); index > 0 ; index--)
1611 if(pData->buffer[ index - 1 ] != c)
1636#if defined LIBO_INTERNAL_ONLY
1649 assert(beginIndex >= 0);
1650 assert(beginIndex <= getLength());
1651 return subView(beginIndex, getLength() - beginIndex);
1668 assert(beginIndex >= 0);
1670 assert(beginIndex <= getLength());
1671 assert(count <= getLength() - beginIndex);
1672 return std::u16string_view(pData->buffer, sal_uInt32(pData->length)).substr(beginIndex, count);
1707 assert(beginIndex >= 0 && beginIndex <=
getLength());
1708 assert(count >= 0 && count <=
getLength() - beginIndex);
1709 rtl_uString *pNew = NULL;
1718 nCapacity = capacity;
1724 rtl_uString * pData;
1729 sal_Int32 nCapacity;
1732#if defined LIBO_INTERNAL_ONLY
1734 static std::size_t length(OUStringBuffer
const & s) {
return s.
getLength(); }
1737 {
return addDataHelper(buffer, s.getStr(), s.getLength()); }
1741#if defined LIBO_INTERNAL_ONLY
1748 return operator=(str.toString());
1750 return internalAppend(str.pData);
1760#ifdef RTL_STRING_UNITTEST
1767#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition types.h:492
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition types.h:396
@ SAL_NO_ACQUIRE
definition of a no acquire enum for ctors
Definition types.h:374
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 used.
Definition types.h:288
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition types.h:611
#define SAL_N_ELEMENTS(arr)
Definition macros.h:51
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_math_doubleToUString(rtl_uString **pResult, sal_Int32 *pResultCapacity, sal_Int32 nResultOffset, double fValue, enum rtl_math_StringFormat eFormat, sal_Int32 nDecPlaces, sal_Unicode cDecSeparator, sal_Int32 const *pGroups, sal_Unicode cGroupSeparator, sal_Bool bEraseTrailingDecZeros) SAL_THROW_EXTERN_C()
Conversions analogous to sprintf() using internal rounding.
@ rtl_math_StringFormat_G
Like sprintf() G, 'F' or 'E' format is used depending on which one is more compact.
Definition math.h:53
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.
#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:2702
Definition stringutils.hxx:119
Definition stringutils.hxx:178
Definition stringutils.hxx:181
static const bool ok
Definition stringutils.hxx:182
Definition stringutils.hxx:205
Definition stringutils.hxx:233
static const bool ok
Definition stringutils.hxx:396
Definition stringutils.hxx:414
A string buffer implements a mutable sequence of characters.
Definition ustrbuf.hxx:73
OUStringBuffer & setCharAt(sal_Int32 index, sal_Unicode ch)
The character at the specified index of this string buffer is set to ch.
Definition ustrbuf.hxx:510
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:1404
sal_Int32 stripStart(sal_Unicode c=' ')
Strip the given character from the start of the buffer.
Definition ustrbuf.hxx:1579
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:1035
OUStringBuffer & append(rtl_uString *str)
Definition ustrbuf.hxx:757
OUStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition ustrbuf.hxx:737
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition ustrbuf.hxx:1687
bool isEmpty() const
Checks if a string buffer is empty.
Definition ustrbuf.hxx:411
OUStringBuffer copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string buffer that is a substring of this string.
Definition ustrbuf.hxx:1705
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition ustrbuf.hxx:790
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition ustrbuf.hxx:426
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition ustrbuf.hxx:398
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition ustrbuf.hxx:1101
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition ustrbuf.hxx:1319
OUStringBuffer & insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition ustrbuf.hxx:1219
sal_Int32 strip(sal_Unicode c=' ')
Strip the given character from the both end of the buffer.
Definition ustrbuf.hxx:1631
OUStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters.
Definition ustrbuf.hxx:80
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:1436
OUStringBuffer & appendAscii(const char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition ustrbuf.hxx:718
OUStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition ustrbuf.hxx:773
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition ustrbuf.hxx:465
OUStringBuffer(const OUStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition ustrbuf.hxx:93
OUStringBuffer(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition ustrbuf.hxx:157
OUStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition ustrbuf.hxx:876
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:1367
OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition ustrbuf.hxx:556
OUStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition ustrbuf.hxx:844
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition ustrbuf.hxx:806
OUStringBuffer & append(const OUString &str)
Appends the string to this string buffer.
Definition ustrbuf.hxx:572
OUStringBuffer & remove(sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
Definition ustrbuf.hxx:1287
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:106
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:827
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:913
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:1534
sal_Int32 stripEnd(sal_Unicode c=' ')
Strip the given character from the end of the buffer.
Definition ustrbuf.hxx:1605
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition ustrbuf.hxx:1146
OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition ustrbuf.hxx:1076
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:1452
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition ustrbuf.hxx:593
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:638
OUStringBuffer & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition ustrbuf.hxx:894
OUStringBuffer & appendAscii(const char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition ustrbuf.hxx:696
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition ustrbuf.hxx:1385
OUStringBuffer(const OUString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition ustrbuf.hxx:148
~OUStringBuffer()
Release the string data.
Definition ustrbuf.hxx:373
friend class OUString
Definition ustrbuf.hxx:74
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:649
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:1170
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:999
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition ustrbuf.hxx:1303
OUStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition ustrbuf.hxx:860
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:1548
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition ustrbuf.hxx:442
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition ustrbuf.hxx:954
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:1022
OUStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer.
Definition ustrbuf.hxx:1246
OUStringBuffer & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
Definition ustrbuf.hxx:619
OUStringBuffer & insert(sal_Int32 offset, char c)
Inserts the string representation of the char argument into this string buffer.
Definition ustrbuf.hxx:1125
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition ustrbuf.hxx:520
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:1195
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition ustrbuf.hxx:1500
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition ustrbuf.hxx:386
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition ustrbuf.hxx:1270
void accessInternals(rtl_uString ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OUStringBuffer, for effective manipulation.
Definition ustrbuf.hxx:1344
sal_Unicode charAt(sal_Int32 index) const
Returns the character at a specific index in this string buffer.
Definition ustrbuf.hxx:493
This String class provides base functionality for C++ like Unicode character array handling.
Definition ustring.hxx:172
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition ustring.hxx:843
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition ustring.hxx:560
sal_Int32 getLength() const
Returns the length of this string.
Definition ustring.hxx:821
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition ustring.hxx:692