24 #ifndef INCLUDED_RTL_USTRBUF_HXX
25 #define INCLUDED_RTL_USTRBUF_HXX
34 #if defined LIBO_INTERNAL_ONLY
35 #include <string_view>
43 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
44 #include "rtl/stringconcat.hxx"
47 #ifdef RTL_STRING_UNITTEST
48 extern 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 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 )
159 template<
typename T >
162 , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
170 #ifdef RTL_STRING_UNITTEST
171 rtl_string_unittest_const_literal =
true;
175 #if defined LIBO_INTERNAL_ONLY
184 nCapacity(libreoffice_internal::ConstCharArrayDetector<T>::length + 16)
193 #if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST
199 template<
typename T >
200 OUStringBuffer( T&,
typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
205 rtl_string_unittest_invalid_conversion =
true;
211 template<
typename T >
212 OUStringBuffer(
const T&,
typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
217 rtl_string_unittest_invalid_conversion =
true;
222 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
227 template<
typename T1,
typename T2 >
228 OUStringBuffer( OUStringConcat< T1, T2 >&& c )
230 const sal_Int32 l = c.length();
242 template<
typename T >
243 OUStringBuffer( OUStringNumber< T >&& n )
245 , nCapacity( n.length + 16 )
251 #if defined LIBO_INTERNAL_ONLY
252 operator std::u16string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
264 nCapacity = value.nCapacity;
269 #if defined LIBO_INTERNAL_ONLY
277 nCapacity = value.nCapacity;
278 value.pData =
nullptr;
289 #if defined LIBO_INTERNAL_ONLY
290 OUStringBuffer & operator =(std::u16string_view
string) {
291 sal_Int32 n =
string.length();
292 if (n >= nCapacity) {
293 ensureCapacity(n + 16);
296 pData->buffer,
string.data(),
304 if (n >= nCapacity) {
305 ensureCapacity(n + 16);
308 pData->buffer,
string.pData->buffer,
322 operator =(T & literal) {
327 if (n >= nCapacity) {
328 ensureCapacity(n + 16);
334 for (sal_Int32 i = 0; i <= n; ++i) {
341 #if defined LIBO_INTERNAL_ONLY
346 operator =(T & literal) {
349 if (n >= nCapacity) {
350 ensureCapacity(n + 16);
354 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
361 #if defined LIBO_INTERNAL_ONLY
363 template<
typename T1,
typename T2>
364 OUStringBuffer & operator =(OUStringConcat<T1, T2> && concat) {
365 sal_Int32
const n = concat.length();
366 if (n >= nCapacity) {
367 ensureCapacity(n + 16);
369 *concat.addData(pData->buffer) = 0;
376 OUStringBuffer & operator =(OUStringNumber<T> && n)
378 *
this = OUStringBuffer( std::move( n ) );
413 return pData->length;
426 return pData->length == 0;
480 assert(newLength >= 0);
482 if( newLength != pData->length )
484 if( newLength > nCapacity )
487 pData->buffer[newLength] = 0;
488 pData->length = newLength;
508 assert(index >= 0 && index < pData->length);
509 return pData->buffer[ index ];
525 assert(index >= 0 && index < pData->length);
526 pData->buffer[ index ] = ch;
546 assert(index >= 0 && index < pData->length);
547 return pData->buffer[index];
561 assert(index >= 0 && index < pData->length);
562 return pData->buffer[index];
571 return OUString(pData->buffer, pData->length);
584 #if !defined LIBO_INTERNAL_ONLY
591 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
592 throw std::bad_alloc();
594 return append(sv.data(), sv.size());
598 #if !defined LIBO_INTERNAL_ONLY
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 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
699 template<
typename T1,
typename T2 >
700 OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
702 sal_Int32 l = c.length();
707 sal_Unicode* end = c.addData( pData->buffer + pData->length );
717 template<
typename T >
718 OUStringBuffer& append( OUStringNumber< T >&& c )
720 return append( c.buf, c.length );
792 template<
typename T >
839 assert(static_cast< unsigned char >(c) <= 0x7F);
855 return append( &c, 1 );
858 #if defined LIBO_INTERNAL_ONLY
859 void append(sal_uInt16) =
delete;
946 return insertUtf32(getLength(), c);
965 sal_Int32 n = getLength();
967 return pData->buffer + n;
985 #if defined LIBO_INTERNAL_ONLY
986 OUStringBuffer & insert(sal_Int32 offset, std::u16string_view str)
988 return insert( offset, str.data(), str.length() );
1039 assert( len == 0 || str != NULL );
1049 template<
typename T >
1055 &pData, &nCapacity, offset,
1061 #if defined LIBO_INTERNAL_ONLY
1063 template<
typename T>
1066 insert(sal_Int32 offset, T & literal) {
1143 return insert( offset, &u, 1 );
1164 return insert( offset, &c, 1 );
1331 sal_Int32 index = 0;
1332 while((index = indexOf(oldChar, index)) >= 0)
1334 pData->buffer[ index ] = newChar;
1355 sal_Int32 ** pInternalCapacity)
1357 *pInternalData = &pData;
1358 *pInternalCapacity = &nCapacity;
1379 assert( fromIndex >= 0 && fromIndex <= pData->length );
1381 return (ret < 0 ? ret : ret+fromIndex);
1416 assert( fromIndex >= 0 && fromIndex <= pData->length );
1437 #if defined LIBO_INTERNAL_ONLY
1438 sal_Int32 indexOf( std::u16string_view str, sal_Int32 fromIndex = 0 )
const
1440 assert( fromIndex >= 0 && fromIndex <= pData->length );
1442 str.data(), str.length() );
1443 return (ret < 0 ? ret : ret+fromIndex);
1448 assert( fromIndex >= 0 && fromIndex <= pData->length );
1451 return (ret < 0 ? ret : ret+fromIndex);
1461 template<
typename T >
1467 pData->buffer + fromIndex, pData->length - fromIndex,
1470 return n < 0 ? n : n + fromIndex;
1473 #if defined LIBO_INTERNAL_ONLY
1475 template<
typename T>
1478 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
1479 assert(fromIndex >= 0);
1481 pData->buffer + fromIndex, pData->length - fromIndex,
1484 return n < 0 ? n : n + fromIndex;
1505 #if defined LIBO_INTERNAL_ONLY
1506 sal_Int32 lastIndexOf( std::u16string_view str )
const
1509 str.data(), str.length() );
1538 #if defined LIBO_INTERNAL_ONLY
1539 sal_Int32 lastIndexOf( std::u16string_view str, sal_Int32 fromIndex )
const
1541 assert( fromIndex >= 0 && fromIndex <= pData->length );
1543 str.data(), str.length() );
1548 assert( fromIndex >= 0 && fromIndex <= pData->length );
1559 template<
typename T >
1565 pData->buffer, pData->length,
1570 #if defined LIBO_INTERNAL_ONLY
1572 template<
typename T>
1575 lastIndexOf(T & literal)
const {
1577 pData->buffer, pData->length,
1595 for(index = 0; index < getLength() ; index++)
1597 if(pData->buffer[ index ] != c)
1620 sal_Int32 result = getLength();
1622 for(index = getLength(); index > 0 ; index--)
1624 if(pData->buffer[ index - 1 ] != c)
1629 if(index < getLength())
1633 return result - getLength();
1646 return stripStart(c) + stripEnd(c);
1649 #if defined LIBO_INTERNAL_ONLY
1662 assert(beginIndex >= 0);
1663 assert(beginIndex <= getLength());
1664 return subView(beginIndex, getLength() - beginIndex);
1681 assert(beginIndex >= 0);
1683 assert(beginIndex <= getLength());
1684 assert(count <= getLength() - beginIndex);
1685 return std::u16string_view(pData->buffer, sal_uInt32(pData->length)).substr(beginIndex, count);
1702 return copy( beginIndex, getLength() - beginIndex );
1720 assert(beginIndex >= 0 && beginIndex <= getLength());
1721 assert(count >= 0 && count <= getLength() - beginIndex);
1722 rtl_uString *pNew = NULL;
1731 nCapacity = capacity;
1737 rtl_uString * pData;
1742 sal_Int32 nCapacity;
1745 #if defined LIBO_INTERNAL_ONLY
1746 template<>
struct ToStringHelper<OUStringBuffer> {
1747 static std::size_t length(OUStringBuffer
const & s) {
return s.
getLength(); }
1750 {
return addDataHelper(buffer, s.getStr(), s.getLength()); }
1752 static constexpr
bool allowOStringConcat =
false;
1753 static constexpr
bool allowOUStringConcat =
true;
1757 #if defined LIBO_INTERNAL_ONLY
1764 return operator=(str.toString());
1766 return internalAppend(str.pData);
1771 #ifdef RTL_STRING_UNITTEST
1774 typedef rtlunittest::OUStringBuffer OUStringBuffer;
1778 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
1779 using ::rtl::OUStringBuffer;
1782 #endif // INCLUDED_RTL_USTRBUF_HXX
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.
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:663
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_VALUEOFINT32
Definition: ustring.h:961
#define RTL_USTR_MAX_VALUEOFBOOLEAN
Definition: ustring.h:919
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 & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: ustrbuf.hxx:819
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:874
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: ustrbuf.hxx:1091
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.
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
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:1462
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition: ustrbuf.hxx:991
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.
OUStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: ustrbuf.hxx:926
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:474
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.
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition: ustrbuf.hxx:1280
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: ustrbuf.hxx:478
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: ustrbuf.hxx:1116
sal_Int32 lastIndexOf(const OUString &str, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified substring, searching backward starting before the specified index.
Definition: ustrbuf.hxx:1546
OUStringBuffer & append(const OUString &str)
Appends the string to this string buffer.
Definition: ustrbuf.hxx:585
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:203
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.
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, double d)
Inserts the string representation of the double argument into this string buffer. ...
Definition: ustrbuf.hxx:1259
#define RTL_USTR_MAX_VALUEOFINT64
Definition: ustring.h:984
Definition: stringutils.hxx:370
void accessInternals(rtl_uString ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OUStringBuffer, for effective manipulation.
Definition: ustrbuf.hxx:1354
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
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: ustrbuf.hxx:411
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:284
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...
Definition: stringutils.hxx:190
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:1037
sal_Int32 stripStart(sal_Unicode c= ' ')
Strip the given character from the start of the buffer.
Definition: ustrbuf.hxx:1592
definition of a no acquire enum for ctors
Definition: types.h:356
OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition: ustrbuf.hxx:569
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_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.
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1162
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:814
OUStringBuffer & appendAscii(const char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:740
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: ustrbuf.hxx:439
Definition: stringutils.hxx:162
OUStringBuffer & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition: ustrbuf.hxx:945
pData
Definition: ustring.hxx:355
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition: ustrbuf.hxx:611
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:964
OUStringBuffer copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1718
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1700
Definition: stringutils.hxx:138
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.
bool isEmpty() const
Checks if a string buffer is empty.
Definition: ustrbuf.hxx:424
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 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_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the end.
Definition: ustrbuf.hxx:1512
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:1211
sal_Int32 lastIndexOf(sal_Unicode ch, sal_Int32 fromIndex) const
Returns the index within this string of the last occurrence of the specified character, searching backward starting before the specified index.
Definition: ustrbuf.hxx:1414
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
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, starting the search at the specified index.
Definition: ustrbuf.hxx:1377
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:1050
OUStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters...
Definition: ustrbuf.hxx:77
SAL_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
unsigned char sal_Bool
Definition: types.h:38
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, starting at the specified index.
Definition: ustrbuf.hxx:1446
sal_Int32 strip(sal_Unicode c= ' ')
Strip the given character from the both end of the buffer.
Definition: ustrbuf.hxx:1644
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition: ustrbuf.hxx:455
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: ustrbuf.hxx:399
OUStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition: ustrbuf.hxx:892
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_valueOfInt32(sal_Unicode *str, sal_Int32 i, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an integer.
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:792
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:1014
OUStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition: ustrbuf.hxx:909
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1026
SAL_DLLPUBLIC sal_Int32 rtl_ustr_getLength(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return the length of a string.
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
~OUStringBuffer()
Release the string data.
Definition: ustrbuf.hxx:386
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:378
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition: ustrbuf.hxx:853
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 & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: ustrbuf.hxx:782
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition: ustrbuf.hxx:1329
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:587
Definition: stringutils.hxx:351
Definition: stringutils.hxx:136
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1045
sal_Int32 stripEnd(sal_Unicode c= ' ')
Strip the given character from the end of the buffer.
Definition: ustrbuf.hxx:1618
OUStringBuffer & insert(sal_Int32 offset, char c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1140
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:1186
SAL_DLLPUBLIC void rtl_uStringbuffer_remove(rtl_uString **This, sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
OUStringBuffer & appendAscii(const char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:763
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:1560
OUStringBuffer insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: ustrbuf.hxx:1235
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition: ustrbuf.hxx:533
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...
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition: ustrbuf.hxx:1313
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_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
OUStringBuffer & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
Definition: ustrbuf.hxx:637
sal_uInt16 sal_Unicode
Definition: types.h:123
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition: ustrbuf.hxx:837
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character, searching backward starting at the end.
Definition: ustrbuf.hxx:1395
A string buffer implements a mutable sequence of characters.
Definition: ustrbuf.hxx:69