24 #ifndef INCLUDED_RTL_USTRBUF_HXX 25 #define INCLUDED_RTL_USTRBUF_HXX 34 #if defined LIBO_INTERNAL_ONLY 35 #include <string_view> 36 #include <type_traits> 45 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" 46 #include "o3tl/safeint.hxx" 47 #include "rtl/stringconcat.hxx" 50 #ifdef RTL_STRING_UNITTEST 51 extern 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();
157 , nCapacity( value.getLength() + 16 )
163 template<
typename T >
166 , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
174 #ifdef RTL_STRING_UNITTEST 175 rtl_string_unittest_const_literal =
true;
179 #if defined LIBO_INTERNAL_ONLY 188 nCapacity(libreoffice_internal::ConstCharArrayDetector<T>::length + 16)
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 // "RTL_FAST_STRING" 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';
309 if (n >= nCapacity) {
310 ensureCapacity(n + 16);
313 pData->buffer,
string.pData->buffer,
327 operator =(T & literal) {
332 if (n >= nCapacity) {
333 ensureCapacity(n + 16);
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 598 return insert(getLength(), str);
601 #if !defined LIBO_INTERNAL_ONLY 635 #if defined LIBO_INTERNAL_ONLY 638 append(T
const & str)
643 return insert(getLength(), str);
661 return insert(getLength(), str, len);
669 template<
typename T >
672 return insert(getLength(), literal);
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 // "RTL_FAST_STRING" 694 template<
typename T1,
typename T2 >
695 OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
697 return insert(getLength(), std::move(c));
760 return insert(getLength(), b);
767 template<
typename T >
796 return insert(getLength(), b);
813 assert(static_cast< unsigned char >(c) <= 0x7F);
814 return insert(getLength(), c);
829 return insert(getLength(), c);
832 #if defined LIBO_INTERNAL_ONLY 833 void append(sal_uInt16) =
delete;
850 return insert(getLength(), i, radix);
867 return insert(getLength(), l, radix);
883 return insert(getLength(), f);
899 return insert(getLength(), d);
916 return insertUtf32(getLength(), c);
935 sal_Int32 n = getLength();
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 // "RTL_FAST_STRING" 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)
1635 sal_Int32 result = getLength();
1637 for(index = getLength(); index > 0 ; index--)
1639 if(pData->buffer[ index - 1 ] != c)
1644 if(index < getLength())
1648 return result - getLength();
1661 return stripStart(c) + stripEnd(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);
1717 return copy( beginIndex, getLength() - beginIndex );
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 1761 template<>
struct ToStringHelper<OUStringBuffer> {
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 1791 typedef rtlunittest::OUStringBuffer OUStringBuffer;
1795 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST 1796 using ::rtl::OUStringBuffer;
1799 #endif // INCLUDED_RTL_USTRBUF_HXX OUStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters...
Definition: ustrbuf.hxx:80
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.
bool isEmpty() const
Checks if a string buffer is empty.
Definition: ustrbuf.hxx:432
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
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:816
OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition: ustrbuf.hxx:577
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.
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
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:1527
~OUStringBuffer()
Release the string data.
Definition: ustrbuf.hxx:394
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition: ustrbuf.hxx:827
OUStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: ustrbuf.hxx:758
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.
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 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
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:1561
OUStringBuffer & insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: ustrbuf.hxx:1244
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 & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: ustrbuf.hxx:1100
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.
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:2355
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:1410
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition: ustrbuf.hxx:1328
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1026
static OUString const & unacquired(rtl_uString *const *ppHandle)
Provides an OUString const & passing a storage pointer of an rtl_uString * handle.
Definition: ustring.hxx:557
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 & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
Definition: ustrbuf.hxx:640
OUStringBuffer & append(rtl_uString *str)
Definition: ustrbuf.hxx:778
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
OUStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: ustrbuf.hxx:794
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition: ustrbuf.hxx:978
A string buffer implements a mutable sequence of characters.
Definition: ustrbuf.hxx:72
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:838
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:378
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition: ustrbuf.hxx:1344
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
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 & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: ustrbuf.hxx:897
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(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
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_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.
Definition: stringutils.hxx:146
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:474
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:587
sal_Int32 stripEnd(sal_Unicode c=' ')
Strip the given character from the end of the buffer.
Definition: ustrbuf.hxx:1633
Definition: stringutils.hxx:200
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: ustrbuf.hxx:407
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_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.
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
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:1461
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1045
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
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.
Definition: stringutils.hxx:381
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
sal_uInt16 sal_Unicode
Definition: types.h:123
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:362
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1171
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: ustrbuf.hxx:486
unsigned char sal_Bool
Definition: types.h:38
SAL_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
Like sprintf() G, 'F' or 'E' format is used depending on which one is more compact.
Definition: math.h:53
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition: ustrbuf.hxx:614
SAL_DLLPUBLIC void rtl_uString_new(rtl_uString **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
OUStringBuffer & appendAscii(const char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:739
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 OUString &str)
Appends the string to this string buffer.
Definition: ustrbuf.hxx:593
sal_Int32 strip(sal_Unicode c=' ')
Strip the given character from the both end of the buffer.
Definition: ustrbuf.hxx:1659
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 & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition: ustrbuf.hxx:915
Definition: bootstrap.hxx:33
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, char c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1149
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_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.
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:687
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_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: ustrbuf.hxx:447
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:170
OUStringBuffer(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition: ustrbuf.hxx:164
definition of a no acquire enum for ctors
Definition: types.h:356
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:1392
#define SAL_N_ELEMENTS(arr)
Definition: macros.h:51
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_valueOfInt32(sal_Unicode *str, sal_Int32 i, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an integer.
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
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_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: ustrbuf.hxx:419
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
Definition: stringutils.hxx:172
SAL_DLLPUBLIC sal_Int32 rtl_ustr_getLength(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return the length of a string.
Definition: stringutils.hxx:148
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_str_getLength(const char *str) SAL_THROW_EXTERN_C()
Return the length of a string.
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:284
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition: ustrbuf.hxx:811
#define RTL_USTR_MAX_VALUEOFBOOLEAN
Definition: ustring.h:919
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_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.
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: ustrbuf.hxx:1125
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition: ustrbuf.hxx:1295
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition: ustrbuf.hxx:541
#define RTL_USTR_MAX_VALUEOFINT32
Definition: ustring.h:961
OUStringBuffer & appendAscii(const char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:717
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1715
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.
#define RTL_USTR_MAX_VALUEOFINT64
Definition: ustring.h:984
sal_Int32 stripStart(sal_Unicode c=' ')
Strip the given character from the start of the buffer.
Definition: ustrbuf.hxx:1607
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
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:1429