4 #ifndef INCLUDED_RTL_USTRBUF_HXX
5 #define INCLUDED_RTL_USTRBUF_HXX
14 #if defined LIBO_INTERNAL_ONLY
15 #include <string_view>
16 #include <type_traits>
25 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
26 #include "rtl/stringconcat.hxx"
29 #ifdef RTL_STRING_UNITTEST
30 extern bool rtl_string_unittest_invalid_conversion;
38 #ifdef RTL_STRING_UNITTEST
39 #define rtl rtlunittest
45 #ifdef RTL_STRING_UNITTEST
74 , nCapacity( value.nCapacity )
91 #if defined LIBO_INTERNAL_ONLY
93 explicit OUStringBuffer(T length, std::enable_if_t<std::is_integral_v<T>,
int> = 0)
98 &&
static_cast<std::make_unsigned_t<T>
>(length)
99 <=
static_cast<std::make_unsigned_t<sal_Int32>
>(
100 std::numeric_limits<sal_Int32>::max()));
103 explicit OUStringBuffer(
bool) =
delete;
104 explicit OUStringBuffer(
char) =
delete;
105 explicit OUStringBuffer(
wchar_t) =
delete;
106 #if defined __cpp_char8_t
107 explicit OUStringBuffer(char8_t) =
delete;
109 explicit OUStringBuffer(char16_t) =
delete;
110 explicit OUStringBuffer(char32_t) =
delete;
123 #if defined LIBO_INTERNAL_ONLY
124 OUStringBuffer(std::u16string_view sv)
126 , nCapacity( sv.length() + 16 )
128 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
129 throw std::bad_alloc();
136 , nCapacity( value.getLength() + 16 )
142 template<
typename T >
145 , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
153 #ifdef RTL_STRING_UNITTEST
154 rtl_string_unittest_const_literal =
true;
158 #if defined LIBO_INTERNAL_ONLY
167 nCapacity(libreoffice_internal::ConstCharArrayDetector<T>::length + 16)
176 #if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST
182 template<
typename T >
183 OUStringBuffer( T&,
typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
188 rtl_string_unittest_invalid_conversion =
true;
194 template<
typename T >
195 OUStringBuffer(
const T&,
typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
200 rtl_string_unittest_invalid_conversion =
true;
205 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
210 template<
typename T1,
typename T2 >
211 OUStringBuffer( OUStringConcat< T1, T2 >&& c )
213 const sal_Int32 l = c.length();
225 template<
typename T, std::
size_t N >
226 OUStringBuffer( StringNumberBase< sal_Unicode, T, N >&& n )
228 , nCapacity( n.length + 16 )
234 #if defined LIBO_INTERNAL_ONLY
235 operator std::u16string_view()
const {
return {getStr(), sal_uInt32(getLength())}; }
247 nCapacity = value.nCapacity;
252 #if defined LIBO_INTERNAL_ONLY
260 nCapacity = value.nCapacity;
261 value.pData =
nullptr;
272 #if defined LIBO_INTERNAL_ONLY
273 OUStringBuffer & operator =(std::u16string_view
string) {
274 sal_Int32 n =
string.length();
275 if (n >= nCapacity) {
276 ensureCapacity(n + 16);
279 pData->buffer,
string.data(),
281 pData->buffer[n] =
'\0';
288 if (n >= nCapacity) {
289 ensureCapacity(n + 16);
292 pData->buffer,
string.pData->buffer,
306 operator =(T & literal) {
311 if (n >= nCapacity) {
312 ensureCapacity(n + 16);
318 for (sal_Int32 i = 0; i <= n; ++i) {
325 #if defined LIBO_INTERNAL_ONLY
330 operator =(T & literal) {
333 if (n >= nCapacity) {
334 ensureCapacity(n + 16);
341 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
343 pData->buffer[n] =
'\0';
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<
typename T, std::
size_t N>
364 OUStringBuffer & operator =(StringNumberBase<sal_Unicode, T, N> && n)
366 *
this = OUStringBuffer( std::move( n ) );
401 return pData->length;
414 return pData->length == 0;
468 assert(newLength >= 0);
470 if( newLength != pData->length )
472 if( newLength > nCapacity )
475 pData->buffer[newLength] = 0;
476 pData->length = newLength;
496 assert(index >= 0 && index < pData->length);
497 return pData->buffer[ index ];
513 assert(index >= 0 && index < pData->length);
514 pData->buffer[ index ] = ch;
534 assert(index >= 0 && index < pData->length);
535 return pData->buffer[index];
549 assert(index >= 0 && index < pData->length);
550 return pData->buffer[index];
559 return OUString(pData->buffer, pData->length);
572 #if !defined LIBO_INTERNAL_ONLY
579 if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
580 throw std::bad_alloc();
582 return append(sv.data(), sv.size());
586 #if !defined LIBO_INTERNAL_ONLY
620 #if defined LIBO_INTERNAL_ONLY
623 append(T
const & str)
646 assert( len == 0 || str != NULL );
656 template<
typename T >
666 #if defined LIBO_INTERNAL_ONLY
669 append(T & value) {
return append(static_cast<sal_Unicode *>(value)); }
673 typename libreoffice_internal::ConstCharArrayDetector<
674 T, OUStringBuffer &>::TypeUtf16
675 append(T & literal) {
677 libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
678 libreoffice_internal::ConstCharArrayDetector<T>::length);
682 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
687 template<
typename T1,
typename T2 >
688 OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
690 sal_Int32 l = c.length();
695 sal_Unicode* end = c.addData( pData->buffer + pData->length );
705 template<
typename T, std::
size_t N >
706 OUStringBuffer& append( StringNumberBase< sal_Unicode, T, N >&& c )
708 return append( c.buf, c.length );
779 template<
typename T >
826 assert(static_cast< unsigned char >(c) <= 0x7F);
842 return append( &c, 1 );
845 #if defined LIBO_INTERNAL_ONLY
846 void append(sal_uInt16) =
delete;
933 return insertUtf32(getLength(), c);
952 sal_Int32 n = getLength();
954 return pData->buffer + n;
957 #if defined LIBO_INTERNAL_ONLY
967 return append(std::forward<T>(rValue));
986 #if defined LIBO_INTERNAL_ONLY
987 OUStringBuffer & insert(sal_Int32 offset, std::u16string_view str)
989 return insert( offset, str.data(), str.length() );
1040 assert( len == 0 || str != NULL );
1050 template<
typename T >
1056 &pData, &nCapacity, offset,
1062 #if defined LIBO_INTERNAL_ONLY
1064 template<
typename T>
1067 insert(sal_Int32 offset, T & literal) {
1144 return insert( offset, &u, 1 );
1165 return insert( offset, &c, 1 );
1332 sal_Int32 index = 0;
1333 while((index = indexOf(oldChar, index)) >= 0)
1335 pData->buffer[ index ] = newChar;
1356 sal_Int32 ** pInternalCapacity)
1358 *pInternalData = &pData;
1359 *pInternalCapacity = &nCapacity;
1380 assert( fromIndex >= 0 && fromIndex <= pData->length );
1382 return (ret < 0 ? ret : ret+fromIndex);
1417 assert( fromIndex >= 0 && fromIndex <= pData->length );
1438 #if defined LIBO_INTERNAL_ONLY
1439 sal_Int32 indexOf( std::u16string_view str, sal_Int32 fromIndex = 0 )
const
1441 assert( fromIndex >= 0 && fromIndex <= pData->length );
1443 str.data(), str.length() );
1444 return (ret < 0 ? ret : ret+fromIndex);
1449 assert( fromIndex >= 0 && fromIndex <= pData->length );
1452 return (ret < 0 ? ret : ret+fromIndex);
1462 template<
typename T >
1468 pData->buffer + fromIndex, pData->length - fromIndex,
1471 return n < 0 ? n : n + fromIndex;
1474 #if defined LIBO_INTERNAL_ONLY
1476 template<
typename T>
1479 indexOf(T & literal, sal_Int32 fromIndex = 0)
const {
1480 assert(fromIndex >= 0);
1482 pData->buffer + fromIndex, pData->length - fromIndex,
1485 return n < 0 ? n : n + fromIndex;
1506 #if defined LIBO_INTERNAL_ONLY
1507 sal_Int32 lastIndexOf( std::u16string_view str )
const
1510 str.data(), str.length() );
1539 #if defined LIBO_INTERNAL_ONLY
1540 sal_Int32 lastIndexOf( std::u16string_view str, sal_Int32 fromIndex )
const
1542 assert( fromIndex >= 0 && fromIndex <= pData->length );
1544 str.data(), str.length() );
1549 assert( fromIndex >= 0 && fromIndex <= pData->length );
1560 template<
typename T >
1566 pData->buffer, pData->length,
1571 #if defined LIBO_INTERNAL_ONLY
1573 template<
typename T>
1576 lastIndexOf(T & literal)
const {
1578 pData->buffer, pData->length,
1596 for(index = 0; index < getLength() ; index++)
1598 if(pData->buffer[ index ] != c)
1621 sal_Int32 result = getLength();
1623 for(index = getLength(); index > 0 ; index--)
1625 if(pData->buffer[ index - 1 ] != c)
1630 if(index < getLength())
1634 return result - getLength();
1647 return stripStart(c) + stripEnd(c);
1650 #if defined LIBO_INTERNAL_ONLY
1663 assert(beginIndex >= 0);
1664 assert(beginIndex <= getLength());
1665 return subView(beginIndex, getLength() - beginIndex);
1682 assert(beginIndex >= 0);
1684 assert(beginIndex <= getLength());
1685 assert(count <= getLength() - beginIndex);
1686 return std::u16string_view(pData->buffer, sal_uInt32(pData->length)).substr(beginIndex, count);
1703 return copy( beginIndex, getLength() - beginIndex );
1721 assert(beginIndex >= 0 && beginIndex <= getLength());
1722 assert(count >= 0 && count <= getLength() - beginIndex);
1723 rtl_uString *pNew = NULL;
1732 nCapacity = capacity;
1738 rtl_uString * pData;
1743 sal_Int32 nCapacity;
1746 #if defined LIBO_INTERNAL_ONLY
1747 template<>
struct ToStringHelper<OUStringBuffer> {
1748 static std::size_t length(OUStringBuffer
const & s) {
return s.
getLength(); }
1751 {
return addDataHelper(buffer, s.getStr(), s.getLength()); }
1755 #if defined LIBO_INTERNAL_ONLY
1762 return operator=(str.toString());
1764 return internalAppend(str.pData);
1774 #ifdef RTL_STRING_UNITTEST
1777 typedef rtlunittest::OUStringBuffer OUStringBuffer;
1781 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
1782 using ::rtl::OUStringBuffer;
1785 #endif // INCLUDED_RTL_USTRBUF_HXX
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:655
SAL_DLLPUBLIC void rtl_uStringbuffer_remove(rtl_uString **This, sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
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:657
OUStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: ustrbuf.hxx:806
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:861
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.
OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: ustrbuf.hxx:1092
OUStringBuffer(const OUString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition: ustrbuf.hxx:134
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:1463
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition: ustrbuf.hxx:992
unsigned char sal_Bool
Definition: types.h:18
OUStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: ustrbuf.hxx:913
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 sal_Int32 rtl_ustr_getLength(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return the length of a string.
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition: ustrbuf.hxx:1281
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: ustrbuf.hxx:466
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: ustrbuf.hxx:1117
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:1547
OUStringBuffer & append(const OUString &str)
Appends the string to this string buffer.
Definition: ustrbuf.hxx:573
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:182
OUStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer. ...
Definition: ustrbuf.hxx:1260
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.
#define RTL_USTR_MAX_VALUEOFBOOLEAN
Definition: ustring.h:899
Definition: stringutils.hxx:374
void accessInternals(rtl_uString ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OUStringBuffer, for effective manipulation.
Definition: ustrbuf.hxx:1355
OUStringBuffer(const OUStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition: ustrbuf.hxx:72
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: ustrbuf.hxx:399
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:85
Definition: stringutils.hxx:194
sal_uInt16 sal_Unicode
Definition: types.h:103
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:1038
sal_Int32 stripStart(sal_Unicode c= ' ')
Strip the given character from the start of the buffer.
Definition: ustrbuf.hxx:1593
OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition: ustrbuf.hxx:557
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 void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of 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.
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1163
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition: ustring.hxx:520
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.
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 SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:454
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:806
OUStringBuffer & appendAscii(const char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:728
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: ustrbuf.hxx:427
Definition: stringutils.hxx:166
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:567
OUStringBuffer & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition: ustrbuf.hxx:932
pData
Definition: ustring.hxx:334
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
#define RTL_USTR_MAX_VALUEOFINT64
Definition: ustring.h:964
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition: ustrbuf.hxx:599
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:951
OUStringBuffer copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1719
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1701
Definition: stringutils.hxx:142
bool isEmpty() const
Checks if a string buffer is empty.
Definition: ustrbuf.hxx:412
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_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:1513
SAL_DLLPUBLIC void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
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.
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:1212
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:1415
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_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:1378
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.
definition of a no acquire enum for ctors
Definition: types.h:336
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:1051
OUStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters...
Definition: ustrbuf.hxx:59
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...
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:264
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:1447
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, for example).
Definition: string.hxx:2338
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1025
sal_Int32 strip(sal_Unicode c= ' ')
Strip the given character from the both end of the buffer.
Definition: ustrbuf.hxx:1645
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition: ustrbuf.hxx:443
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: ustrbuf.hxx:387
OUStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition: ustrbuf.hxx:879
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_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:784
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:1015
OUStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition: ustrbuf.hxx:896
~OUStringBuffer()
Release the string data.
Definition: ustrbuf.hxx:374
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition: ustrbuf.hxx:840
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:644
OUStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: ustrbuf.hxx:769
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition: ustrbuf.hxx:1330
Definition: stringutils.hxx:355
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.
#define RTL_USTR_MAX_VALUEOFINT32
Definition: ustring.h:941
Definition: stringutils.hxx:140
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_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
sal_Int32 stripEnd(sal_Unicode c= ' ')
Strip the given character from the end of the buffer.
Definition: ustrbuf.hxx:1619
OUStringBuffer & insert(sal_Int32 offset, char c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1141
SAL_DLLPUBLIC sal_Int32 rtl_str_getLength(const char *str) SAL_THROW_EXTERN_C()
Return the length of a string.
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:1187
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.
OUStringBuffer & appendAscii(const char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:750
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:1561
OUStringBuffer insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: ustrbuf.hxx:1236
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition: ustrbuf.hxx:521
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.
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition: ustrbuf.hxx:1314
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1006
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
OUStringBuffer & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
Definition: ustrbuf.hxx:625
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition: ustrbuf.hxx:824
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:1396
A string buffer implements a mutable sequence of characters.
Definition: ustrbuf.hxx:51
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:358
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.