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)
 
  119            && 
static_cast<std::make_unsigned_t<T>
>(length)
 
  120                <= 
static_cast<std::make_unsigned_t<sal_Int32>
>(
 
  121                    std::numeric_limits<sal_Int32>::max()));
 
  124    explicit OUStringBuffer(
bool) = 
delete;
 
  125    explicit OUStringBuffer(
char) = 
delete;
 
  126    explicit OUStringBuffer(
wchar_t) = 
delete;
 
  127#if !(defined _MSC_VER && _MSC_VER >= 1930 && _MSC_VER <= 1939 && defined _MANAGED) 
  128    explicit OUStringBuffer(
char8_t) = 
delete;
 
  130    explicit OUStringBuffer(
char16_t) = 
delete;
 
  131    explicit OUStringBuffer(
char32_t) = 
delete;
 
  144#if defined LIBO_INTERNAL_ONLY 
  145    OUStringBuffer(std::u16string_view sv)
 
  147        , nCapacity( sv.length() + 16 )
 
  149        if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
 
  150            throw std::bad_alloc();
 
  163    template< 
typename T >
 
  174#ifdef RTL_STRING_UNITTEST 
  175        rtl_string_unittest_const_literal = 
true;
 
 
  179#if defined LIBO_INTERNAL_ONLY 
  197#if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST 
  203    template< 
typename T >
 
  204    OUStringBuffer( T&, 
typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
 
  209        rtl_string_unittest_invalid_conversion = 
true;
 
  215    template< 
typename T >
 
  216    OUStringBuffer( 
const T&, 
typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
 
  221        rtl_string_unittest_invalid_conversion = 
true;
 
  226#ifdef LIBO_INTERNAL_ONLY  
  231    template< 
typename T1, 
typename T2 >
 
  232    OUStringBuffer( OUStringConcat< T1, T2 >&& c )
 
  234        const sal_Int32 l = c.length();
 
  246    template< std::
size_t N >
 
  247    OUStringBuffer( OUStringNumber< N >&& n )
 
  249        , nCapacity( n.length + 16 )
 
  255#if defined LIBO_INTERNAL_ONLY 
  256    operator std::u16string_view()
 const { 
return {getStr(), sal_uInt32(getLength())}; }
 
  268            nCapacity = value.nCapacity;
 
 
  273#if defined LIBO_INTERNAL_ONLY 
  281        nCapacity = value.nCapacity;
 
  282        value.pData = 
nullptr;
 
  293#if defined LIBO_INTERNAL_ONLY 
  294    OUStringBuffer & operator =(std::u16string_view 
string) {
 
  295        sal_Int32 n = 
string.length();
 
  296        if (n >= nCapacity) {
 
  297            ensureCapacity(n + 16); 
 
  300            pData->buffer, 
string.data(),
 
  302        pData->buffer[n] = 
'\0';
 
  308        sal_Int32 n = 
string.getLength();
 
  309        if (n >= nCapacity) {
 
  313            pData->buffer, 
string.pData->buffer,
 
 
  327    operator =(T & literal) {
 
  332        if (n >= nCapacity) {
 
  339        for (sal_Int32 i = 0; i <= n; ++i) {
 
 
  346#if defined LIBO_INTERNAL_ONLY 
  351    operator =(T & literal) {
 
  354        if (n >= nCapacity) {
 
  355            ensureCapacity(n + 16); 
 
  362            libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
 
  364        pData->buffer[n] = 
'\0';
 
  370#if defined LIBO_INTERNAL_ONLY 
  372    template<
typename T1, 
typename T2>
 
  373    OUStringBuffer & operator =(OUStringConcat<T1, T2> && concat) {
 
  374        sal_Int32 
const n = concat.length();
 
  375        if (n >= nCapacity) {
 
  376            ensureCapacity(n + 16); 
 
  378        *concat.addData(pData->buffer) = 0;
 
  384    template<std::
size_t N>
 
  385    OUStringBuffer & operator =(OUStringNumber<N> && n)
 
  387        return operator =(std::u16string_view(n));
 
  421        return pData->length;
 
 
  434        return pData->length == 0;
 
 
  488        assert(newLength >= 0);
 
  490        if( newLength != pData->length )
 
  492            if( newLength > nCapacity )
 
  495                pData->buffer[newLength] = 0;
 
  496            pData->length = newLength;
 
 
  516        assert(index >= 0 && index < pData->length);
 
  517        return pData->buffer[ index ];
 
 
  533        assert(index >= 0 && index < pData->length);
 
  534        pData->buffer[ index ] = ch;
 
 
  554        assert(index >= 0 && index < pData->length);
 
  555        return pData->buffer[index];
 
 
  569        assert(index >= 0 && index < pData->length);
 
  570        return pData->buffer[index];
 
 
  579        return OUString(pData->buffer, pData->length);
 
 
  592#if !defined LIBO_INTERNAL_ONLY 
  601#if !defined LIBO_INTERNAL_ONLY 
  635#if defined LIBO_INTERNAL_ONLY 
  638    append(T 
const & str)
 
  669    template< 
typename T >
 
  675#if defined LIBO_INTERNAL_ONLY 
  678    append(T & value) { 
return append(
static_cast<sal_Unicode *
>(value)); }
 
  682    typename libreoffice_internal::ConstCharArrayDetector<
 
  683        T, OUStringBuffer &>::TypeUtf16
 
  684    append(T & literal) {
 
  685        return insert(getLength(), literal);
 
  689#ifdef LIBO_INTERNAL_ONLY  
  694    template< 
typename T1, 
typename T2 >
 
  695    OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
 
  697        return insert(getLength(), std::move(c));
 
  767    template< 
typename T >
 
  813        assert(
static_cast< unsigned char >(c) <= 0x7F);
 
 
  832#if defined LIBO_INTERNAL_ONLY 
  833    void append(sal_uInt16) = 
delete;
 
  937        return pData->buffer + n;
 
 
  940#if defined LIBO_INTERNAL_ONLY 
  950        return append(std::forward<T>(rValue));
 
  969#if defined LIBO_INTERNAL_ONLY 
  970    OUStringBuffer & insert(sal_Int32 offset, std::u16string_view str)
 
  972        if (str.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
 
  973            throw std::bad_alloc();
 
  975        return insert( offset, str.data(), str.length() );
 
  984#ifdef LIBO_INTERNAL_ONLY  
  989    template <
typename T1, 
typename T2>
 
  990    OUStringBuffer& insert(sal_Int32 offset, OUStringConcat<T1, T2>&& c)
 
  992        const size_t l = c.length();
 
  995        if (l > o3tl::make_unsigned(std::numeric_limits<sal_Int32>::max() - pData->length))
 
  996            throw std::bad_alloc();
 
 1001        c.addData(pData->buffer + offset);
 
 1048        assert( len == 0 || str != NULL ); 
 
 
 1058    template< 
typename T >
 
 1064            &pData, &nCapacity, offset,
 
 
 1070#if defined LIBO_INTERNAL_ONLY 
 1072    template<
typename T>
 
 1075    insert(sal_Int32 offset, T & literal) {
 
 1152        return insert( offset, &u, 1 );
 
 
 1173        return insert( offset, &c, 1 );
 
 
 1346        sal_Int32 index = 0;
 
 1347        while((index = 
indexOf(oldChar, index)) >= 0)
 
 1349            pData->buffer[ index ] = newChar;
 
 
 1370                                sal_Int32 ** pInternalCapacity)
 
 1372        *pInternalData = &pData;
 
 1373        *pInternalCapacity = &nCapacity;
 
 
 1394        assert( fromIndex >= 0 && fromIndex <= pData->length );
 
 1396        return (ret < 0 ? ret : ret+fromIndex);
 
 
 1431        assert( fromIndex >= 0 && fromIndex <= pData->length );
 
 
 1452#if defined LIBO_INTERNAL_ONLY 
 1453    sal_Int32 indexOf( std::u16string_view str, sal_Int32 fromIndex = 0 )
 const 
 1455        assert( fromIndex >= 0 && fromIndex <= pData->length );
 
 1457                                                        str.data(), str.length() );
 
 1458        return (ret < 0 ? ret : ret+fromIndex);
 
 1463        assert( fromIndex >= 0 && fromIndex <= pData->length );
 
 1465                                                        str.pData->buffer, str.pData->length );
 
 1466        return (ret < 0 ? ret : ret+fromIndex);
 
 
 1476    template< 
typename T >
 
 1482            pData->buffer + fromIndex, pData->length - fromIndex,
 
 1485        return n < 0 ? n : n + fromIndex;
 
 
 1488#if defined LIBO_INTERNAL_ONLY 
 1490    template<
typename T>
 
 1493    indexOf(T & literal, sal_Int32 fromIndex = 0)
 const {
 
 1494        assert(fromIndex >= 0);
 
 1496            pData->buffer + fromIndex, pData->length - fromIndex,
 
 1499        return n < 0 ? n : n + fromIndex;
 
 1520#if defined LIBO_INTERNAL_ONLY 
 1521    sal_Int32 lastIndexOf( std::u16string_view str )
 const 
 1524                                                   str.data(), str.length() );
 
 1530                                                   str.pData->buffer, str.pData->length );
 
 
 1553#if defined LIBO_INTERNAL_ONLY 
 1554    sal_Int32 lastIndexOf( std::u16string_view str, sal_Int32 fromIndex )
 const 
 1556        assert( fromIndex >= 0 && fromIndex <= pData->length );
 
 1558                                                   str.data(), str.length() );
 
 1563        assert( fromIndex >= 0 && fromIndex <= pData->length );
 
 1565                                                   str.pData->buffer, str.pData->length );
 
 
 1574    template< 
typename T >
 
 1580            pData->buffer, pData->length,
 
 
 1585#if defined LIBO_INTERNAL_ONLY 
 1587    template<
typename T>
 
 1590    lastIndexOf(T & literal)
 const {
 
 1592            pData->buffer, pData->length,
 
 1610        for(index = 0; index < 
getLength() ; index++)
 
 1612            if(pData->buffer[ index ] != c)
 
 
 1637        for(index = 
getLength(); index > 0 ; index--)
 
 1639            if(pData->buffer[ index - 1 ] != c)
 
 
 1664#if defined LIBO_INTERNAL_ONLY 
 1677        assert(beginIndex >= 0);
 
 1678        assert(beginIndex <= getLength());
 
 1679        return subView(beginIndex, getLength() - beginIndex);
 
 1696        assert(beginIndex >= 0);
 
 1698        assert(beginIndex <= getLength());
 
 1699        assert(count <= getLength() - beginIndex);
 
 1700        return std::u16string_view(pData->buffer, sal_uInt32(pData->length)).substr(beginIndex, count);
 
 1735        assert(beginIndex >= 0 && beginIndex <= 
getLength());
 
 1736        assert(count >= 0 && count <= 
getLength() - beginIndex);
 
 1737        rtl_uString *pNew = NULL;
 
 
 1746        nCapacity = capacity;
 
 1752    rtl_uString * pData;
 
 1757    sal_Int32       nCapacity;
 
 
 1760#if defined LIBO_INTERNAL_ONLY 
 1762    static std::size_t length(OUStringBuffer 
const & s) { 
return s.
getLength(); }
 
 1765    { 
return addDataHelper(buffer, s.getStr(), s.getLength()); }
 
 1769#if defined LIBO_INTERNAL_ONLY 
 1776            return operator=(str.toString());
 
 1778            return internalAppend(str.pData);
 
 1788#ifdef RTL_STRING_UNITTEST 
 1795#if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST 
#define SAL_N_ELEMENTS(arr)
Definition macros.h:51
#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
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 sal_Int32 rtl_str_getLength(const char *str) SAL_THROW_EXTERN_C()
Return the length of a string.
SAL_DLLPUBLIC void rtl_uStringbuffer_insert_ascii(rtl_uString **This, sal_Int32 *capacity, sal_Int32 offset, const char *str, sal_Int32 len)
Inserts the 8-Bit ASCII string representation of the str array argument into this string buffer.
SAL_DLLPUBLIC void rtl_uStringbuffer_remove(rtl_uString **This, sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
SAL_DLLPUBLIC rtl_uString * rtl_uStringBuffer_makeStringAndClear(rtl_uString **ppThis, sal_Int32 *nCapacity) SAL_RETURNS_NONNULL
Returns an immutable rtl_uString object, while clearing the string buffer.
SAL_DLLPUBLIC void rtl_uStringbuffer_insertUtf32(rtl_uString **pThis, sal_Int32 *capacity, sal_Int32 offset, sal_uInt32 c) SAL_THROW_EXTERN_C()
Inserts a single UTF-32 character into this string buffer.
SAL_DLLPUBLIC void rtl_uStringbuffer_newFromStr_WithLength(rtl_uString **newStr, const sal_Unicode *value, sal_Int32 count)
Allocates a new String that contains characters from the character array argument.
SAL_DLLPUBLIC sal_Int32 rtl_uStringbuffer_newFromStringBuffer(rtl_uString **newStr, sal_Int32 capacity, rtl_uString *oldStr)
Allocates a new String that contains the same sequence of characters as the string argument.
SAL_DLLPUBLIC void rtl_uStringbuffer_ensureCapacity(rtl_uString **This, sal_Int32 *capacity, sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
SAL_DLLPUBLIC void rtl_uStringbuffer_insert(rtl_uString **This, sal_Int32 *capacity, sal_Int32 offset, const sal_Unicode *str, sal_Int32 len)
Inserts the string representation of the str array argument into this string buffer.
SAL_DLLPUBLIC void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition ustring.h:1026
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition ustring.h:1045
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
#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:2360
Definition stringutils.hxx:117
Definition stringutils.hxx:146
Definition stringutils.hxx:149
static const bool ok
Definition stringutils.hxx:150
Definition stringutils.hxx:173
Definition stringutils.hxx:201
static const bool ok
Definition stringutils.hxx:364
Definition stringutils.hxx:382
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:531
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:1429
sal_Int32 stripStart(sal_Unicode c=' ')
Strip the given character from the start of the buffer.
Definition ustrbuf.hxx:1607
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:1059
OUStringBuffer & append(rtl_uString *str)
Definition ustrbuf.hxx:778
OUStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition ustrbuf.hxx:758
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition ustrbuf.hxx:1715
bool isEmpty() const
Checks if a string buffer is empty.
Definition ustrbuf.hxx:432
OUStringBuffer copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string buffer that is a substring of this string.
Definition ustrbuf.hxx:1733
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition ustrbuf.hxx:811
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition ustrbuf.hxx:447
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition ustrbuf.hxx:419
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition ustrbuf.hxx:1125
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition ustrbuf.hxx:1344
OUStringBuffer & insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition ustrbuf.hxx:1244
sal_Int32 strip(sal_Unicode c=' ')
Strip the given character from the both end of the buffer.
Definition ustrbuf.hxx:1659
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:1461
OUStringBuffer & appendAscii(const char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition ustrbuf.hxx:739
OUStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition ustrbuf.hxx:794
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition ustrbuf.hxx:486
OUStringBuffer(const OUStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition ustrbuf.hxx:93
OUStringBuffer(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition ustrbuf.hxx:164
OUStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition ustrbuf.hxx:897
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:1392
OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition ustrbuf.hxx:577
OUStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition ustrbuf.hxx:865
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition ustrbuf.hxx:827
OUStringBuffer & append(const OUString &str)
Appends the string to this string buffer.
Definition ustrbuf.hxx:593
OUStringBuffer & remove(sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
Definition ustrbuf.hxx:1312
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:848
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:934
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:1561
sal_Int32 stripEnd(sal_Unicode c=' ')
Strip the given character from the end of the buffer.
Definition ustrbuf.hxx:1633
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition ustrbuf.hxx:1171
OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition ustrbuf.hxx:1100
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:1477
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition ustrbuf.hxx:614
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:659
OUStringBuffer & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition ustrbuf.hxx:915
OUStringBuffer & appendAscii(const char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition ustrbuf.hxx:717
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition ustrbuf.hxx:1410
OUStringBuffer(const OUString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition ustrbuf.hxx:155
~OUStringBuffer()
Release the string data.
Definition ustrbuf.hxx:394
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:670
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:1195
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:1023
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition ustrbuf.hxx:1328
OUStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition ustrbuf.hxx:881
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:1575
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition ustrbuf.hxx:463
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition ustrbuf.hxx:978
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:1046
OUStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer.
Definition ustrbuf.hxx:1271
OUStringBuffer & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
Definition ustrbuf.hxx:640
OUStringBuffer & insert(sal_Int32 offset, char c)
Inserts the string representation of the char argument into this string buffer.
Definition ustrbuf.hxx:1149
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition ustrbuf.hxx:541
OUStringBuffer & insert(sal_Int32 offset, sal_Int64 l, sal_Int16 radix=10)
Inserts the string representation of the long argument into this string buffer.
Definition ustrbuf.hxx:1220
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition ustrbuf.hxx:1527
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition ustrbuf.hxx:407
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition ustrbuf.hxx:1295
void accessInternals(rtl_uString ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OUStringBuffer, for effective manipulation.
Definition ustrbuf.hxx:1369
sal_Unicode charAt(sal_Int32 index) const
Returns the character at a specific index in this string buffer.
Definition ustrbuf.hxx:514
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