LibreOffice
LibreOffice 6.4 SDK C/C++ API Reference
ustrbuf.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_RTL_USTRBUF_HXX
21 #define INCLUDED_RTL_USTRBUF_HXX
22 
23 #include "sal/config.h"
24 
25 #include <cassert>
26 #include <cstring>
27 #include <limits>
28 #include <new>
29 
30 #if defined LIBO_INTERNAL_ONLY
31 #include <string_view>
32 #endif
33 
34 #include "rtl/ustrbuf.h"
35 #include "rtl/ustring.hxx"
36 #include "rtl/stringutils.hxx"
37 #include "sal/types.h"
38 
39 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
40 #include "rtl/stringconcat.hxx"
41 #endif
42 
43 #ifdef RTL_STRING_UNITTEST
44 extern bool rtl_string_unittest_invalid_conversion;
45 #endif
46 
47 // The unittest uses slightly different code to help check that the proper
48 // calls are made. The class is put into a different namespace to make
49 // sure the compiler generates a different (if generating also non-inline)
50 // copy of the function and does not merge them together. The class
51 // is "brought" into the proper rtl namespace by a typedef below.
52 #ifdef RTL_STRING_UNITTEST
53 #define rtl rtlunittest
54 #endif
55 
56 namespace rtl
57 {
58 
59 #ifdef RTL_STRING_UNITTEST
60 #undef rtl
61 #endif
62 
66 {
67 friend class OUString;
68 public:
74  : pData(NULL)
75  , nCapacity( 16 )
76  {
77  rtl_uString_new_WithLength( &pData, nCapacity );
78  }
79 
86  OUStringBuffer( const OUStringBuffer & value )
87  : pData(NULL)
88  , nCapacity( value.nCapacity )
89  {
90  rtl_uStringbuffer_newFromStringBuffer( &pData, value.nCapacity, value.pData );
91  }
92 
99  explicit OUStringBuffer(int length)
100  : pData(NULL)
101  , nCapacity( length )
102  {
103  rtl_uString_new_WithLength( &pData, length );
104  }
105 #if __cplusplus >= 201103L
106  explicit OUStringBuffer(unsigned int length)
107  : OUStringBuffer(static_cast<int>(length))
108  {
109  }
110 #if SAL_TYPES_SIZEOFLONG == 4
111  // additional overloads for sal_Int32 sal_uInt32
112  explicit OUStringBuffer(long length)
113  : OUStringBuffer(static_cast<int>(length))
114  {
115  }
116  explicit OUStringBuffer(unsigned long length)
117  : OUStringBuffer(static_cast<int>(length))
118  {
119  }
120 #endif
121  // avoid obvious bugs
122  explicit OUStringBuffer(char) = delete;
123  explicit OUStringBuffer(sal_Unicode) = delete;
124 #endif
125 
136  OUStringBuffer(const OUString& value)
137  : pData(NULL)
138  , nCapacity( value.getLength() + 16 )
139  {
140  rtl_uStringbuffer_newFromStr_WithLength( &pData, value.getStr(), value.getLength() );
141  }
142 
143  template< typename T >
145  : pData(NULL)
146  , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
147  {
148  assert(
151  &pData,
154 #ifdef RTL_STRING_UNITTEST
155  rtl_string_unittest_const_literal = true;
156 #endif
157  }
158 
159 #if defined LIBO_INTERNAL_ONLY
160 
161  template<typename T>
163  T & literal,
165  T, libreoffice_internal::Dummy>::TypeUtf16
167  pData(nullptr),
168  nCapacity(libreoffice_internal::ConstCharArrayDetector<T>::length + 16)
169  {
171  &pData,
174  }
175 
177  OUStringBuffer(OUStringLiteral const & literal):
178  pData(nullptr), nCapacity(literal.size + 16) //TODO: check for overflow
179  {
180  rtl_uString_newFromLiteral(&pData, literal.data, literal.size, 16);
181  }
182 #endif
183 
184 #ifdef RTL_STRING_UNITTEST
185 
189  template< typename T >
190  OUStringBuffer( T&, typename libreoffice_internal::ExceptConstCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
191  {
192  pData = NULL;
193  nCapacity = 10;
194  rtl_uString_newFromLiteral( &pData, "!!br0ken!!", 10, 0 ); // set to garbage
195  rtl_string_unittest_invalid_conversion = true;
196  }
201  template< typename T >
202  OUStringBuffer( const T&, typename libreoffice_internal::ExceptCharArrayDetector< T >::Type = libreoffice_internal::Dummy() )
203  {
204  pData = NULL;
205  nCapacity = 10;
206  rtl_uString_newFromLiteral( &pData, "!!br0ken!!", 10, 0 ); // set to garbage
207  rtl_string_unittest_invalid_conversion = true;
208  }
209 #endif
210 
211 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
212 
216  template< typename T1, typename T2 >
217  OUStringBuffer( OUStringConcat< T1, T2 >&& c )
218  {
219  const sal_Int32 l = c.length();
220  nCapacity = l + 16;
221  pData = rtl_uString_alloc( nCapacity );
222  sal_Unicode* end = c.addData( pData->buffer );
223  *end = '\0';
224  pData->length = l;
225  // TODO realloc in case pData->>length is noticeably smaller than l ?
226  }
227 
232  template< typename T >
233  OUStringBuffer( OUStringNumber< T >&& n )
234  : pData(NULL)
235  , nCapacity( n.length + 16 )
236  {
237  rtl_uStringbuffer_newFromStr_WithLength( &pData, n.buf, n.length );
238  }
239 #endif
240 
242  OUStringBuffer& operator = ( const OUStringBuffer& value )
243  {
244  if (this != &value)
245  {
247  value.nCapacity,
248  value.pData);
249  nCapacity = value.nCapacity;
250  }
251  return *this;
252  }
253 
258  OUStringBuffer & operator =(OUString const & string) {
259  sal_Int32 n = string.getLength();
260  if (n >= nCapacity) {
261  ensureCapacity(n + 16); //TODO: check for overflow
262  }
263  std::memcpy(
264  pData->buffer, string.pData->buffer,
265  (n + 1) * sizeof (sal_Unicode));
266  pData->length = n;
267  return *this;
268  }
269 
274  template<typename T>
275  typename
277  operator =(T & literal) {
278  assert(
280  sal_Int32 const n
282  if (n >= nCapacity) {
283  ensureCapacity(n + 16); //TODO: check for overflow
284  }
285  char const * from
287  literal);
288  sal_Unicode * to = pData->buffer;
289  for (sal_Int32 i = 0; i <= n; ++i) {
290  to[i] = from[i];
291  }
292  pData->length = n;
293  return *this;
294  }
295 
296 #if defined LIBO_INTERNAL_ONLY
297 
298  template<typename T>
300  T, OUStringBuffer &>::TypeUtf16
301  operator =(T & literal) {
302  sal_Int32 const n
304  if (n >= nCapacity) {
305  ensureCapacity(n + 16); //TODO: check for overflow
306  }
307  std::memcpy(
308  pData->buffer,
309  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
310  (n + 1) * sizeof (sal_Unicode)); //TODO: check for overflow
311  pData->length = n;
312  return *this;
313  }
314 
316  OUStringBuffer & operator =(OUStringLiteral const & literal) {
317  sal_Int32 const n = literal.size;
318  if (n >= nCapacity) {
319  ensureCapacity(n + 16); //TODO: check for overflow
320  }
321  char const * from = literal.data;
322  sal_Unicode * to = pData->buffer;
323  for (sal_Int32 i = 0; i <= n; ++i) {
324  to[i] = from[i];
325  }
326  pData->length = n;
327  return *this;
328  }
329 #endif
330 
331 #if defined LIBO_INTERNAL_ONLY
332 
333  template<typename T1, typename T2>
334  OUStringBuffer & operator =(OUStringConcat<T1, T2> && concat) {
335  sal_Int32 const n = concat.length();
336  if (n >= nCapacity) {
337  ensureCapacity(n + 16); //TODO: check for overflow
338  }
339  *concat.addData(pData->buffer) = 0;
340  pData->length = n;
341  return *this;
342  }
343 
345  template<typename T>
346  OUStringBuffer & operator =(OUStringNumber<T> && n)
347  {
348  return *this = OUStringBuffer( std::move( n ));
349  }
350 #endif
351 
356  {
357  rtl_uString_release( pData );
358  }
359 
369  {
370  return OUString(
371  rtl_uStringBuffer_makeStringAndClear( &pData, &nCapacity ),
372  SAL_NO_ACQUIRE );
373  }
374 
380  sal_Int32 getLength() const
381  {
382  return pData->length;
383  }
384 
393  bool isEmpty() const
394  {
395  return pData->length == 0;
396  }
397 
408  sal_Int32 getCapacity() const
409  {
410  return nCapacity;
411  }
412 
424  void ensureCapacity(sal_Int32 minimumCapacity)
425  {
426  rtl_uStringbuffer_ensureCapacity( &pData, &nCapacity, minimumCapacity );
427  }
428 
447  void setLength(sal_Int32 newLength)
448  {
449  assert(newLength >= 0);
450  // Avoid modifications if pData points to const empty string:
451  if( newLength != pData->length )
452  {
453  if( newLength > nCapacity )
454  rtl_uStringbuffer_ensureCapacity(&pData, &nCapacity, newLength);
455  else
456  pData->buffer[newLength] = 0;
457  pData->length = newLength;
458  }
459  }
460 
474  SAL_DEPRECATED("use rtl::OUStringBuffer::operator [] instead")
475  sal_Unicode charAt( sal_Int32 index ) const
476  {
477  assert(index >= 0 && index < pData->length);
478  return pData->buffer[ index ];
479  }
480 
491  SAL_DEPRECATED("use rtl::OUStringBuffer::operator [] instead")
492  OUStringBuffer & setCharAt(sal_Int32 index, sal_Unicode ch)
493  {
494  assert(index >= 0 && index < pData->length);
495  pData->buffer[ index ] = ch;
496  return *this;
497  }
498 
502  const sal_Unicode* getStr() const SAL_RETURNS_NONNULL { return pData->buffer; }
503 
513  sal_Unicode & operator [](sal_Int32 index)
514  {
515  assert(index >= 0 && index < pData->length);
516  return pData->buffer[index];
517  }
518 
528  const sal_Unicode & operator [](sal_Int32 index) const
529  {
530  assert(index >= 0 && index < pData->length);
531  return pData->buffer[index];
532  }
533 
538  const OUString toString() const
539  {
540  return OUString(pData->buffer, pData->length);
541  }
542 
554  {
555  return append( str.getStr(), str.getLength() );
556  }
557 
558 #if defined LIBO_INTERNAL_ONLY
559  OUStringBuffer & append(std::u16string_view sv) {
560  if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
561  throw std::bad_alloc();
562  }
563  return append(sv.data(), sv.size());
564  }
565 #endif
566 
580  {
581  if(!str.isEmpty())
582  {
583  append( str.getStr(), str.getLength() );
584  }
585  return *this;
586  }
587 
599 #if defined LIBO_INTERNAL_ONLY
600  template<typename T>
602  append(T const & str)
603 #else
605 #endif
606  {
607  return append( str, rtl_ustr_getLength( str ) );
608  }
609 
623  OUStringBuffer & append( const sal_Unicode * str, sal_Int32 len)
624  {
625  assert( len == 0 || str != NULL ); // cannot assert that in rtl_uStringbuffer_insert
626  rtl_uStringbuffer_insert( &pData, &nCapacity, getLength(), str, len );
627  return *this;
628  }
629 
635  template< typename T >
637  {
638  assert(
640  return appendAscii(
643  }
644 
645 #if defined LIBO_INTERNAL_ONLY
646  template<typename T>
648  append(T & value) { return append(static_cast<sal_Unicode *>(value)); }
649 
651  template<typename T>
652  typename libreoffice_internal::ConstCharArrayDetector<
653  T, OUStringBuffer &>::TypeUtf16
654  append(T & literal) {
655  return append(
656  libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
657  libreoffice_internal::ConstCharArrayDetector<T>::length);
658  }
659 
661  OUStringBuffer & append(OUStringLiteral const & literal) {
662  return appendAscii(literal.data, literal.size);
663  }
664 #endif
665 
666 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
667 
671  template< typename T1, typename T2 >
672  OUStringBuffer& append( OUStringConcat< T1, T2 >&& c )
673  {
674  sal_Int32 l = c.length();
675  if( l == 0 )
676  return *this;
677  l += pData->length;
678  rtl_uStringbuffer_ensureCapacity( &pData, &nCapacity, l );
679  sal_Unicode* end = c.addData( pData->buffer + pData->length );
680  *end = '\0';
681  pData->length = l;
682  return *this;
683  }
684 
689  template< typename T >
690  OUStringBuffer& append( OUStringNumber< T >&& c )
691  {
692  return append( c.buf, c.length );
693  }
694 #endif
695 
713  {
714  return appendAscii( str, rtl_str_getLength( str ) );
715  }
716 
735  OUStringBuffer & appendAscii( const sal_Char * str, sal_Int32 len)
736  {
737  rtl_uStringbuffer_insert_ascii( &pData, &nCapacity, getLength(), str, len );
738  return *this;
739  }
740 
755  {
757  return append( sz, rtl_ustr_valueOfBoolean( sz, b ) );
758  }
759 
761  // Pointer can be automatically converted to bool, which is unwanted here.
762  // Explicitly delete all pointer append() overloads to prevent this
763  // (except for char* and sal_Unicode* overloads, which are handled elsewhere).
764  template< typename T >
765  typename libreoffice_internal::Enable< void,
767  append( T* ) SAL_DELETED_FUNCTION;
769 
770  // This overload is needed because OUString has a ctor from rtl_uString*, but
771  // the bool overload above would be preferred to the conversion.
775  OUStringBuffer & append(rtl_uString* str)
776  {
777  return append( OUString( str ));
778  }
779 
792  {
794  return append( sz, rtl_ustr_valueOfBoolean( sz, b ) );
795  }
796 
810  {
811  assert(static_cast< unsigned char >(c) <= 0x7F);
812  return append(sal_Unicode(c));
813  }
814 
826  {
827  return append( &c, 1 );
828  }
829 
830 #if defined LIBO_INTERNAL_ONLY
831  void append(sal_uInt16) = delete;
832 #endif
833 
846  OUStringBuffer & append(sal_Int32 i, sal_Int16 radix = 10 )
847  {
849  return append( sz, rtl_ustr_valueOfInt32( sz, i, radix ) );
850  }
851 
864  OUStringBuffer & append(sal_Int64 l, sal_Int16 radix = 10 )
865  {
867  return append( sz, rtl_ustr_valueOfInt64( sz, l, radix ) );
868  }
869 
882  {
884  return append( sz, rtl_ustr_valueOfFloat( sz, f ) );
885  }
886 
898  OUStringBuffer & append(double d)
899  {
901  return append( sz, rtl_ustr_valueOfDouble( sz, d ) );
902  }
903 
917  OUStringBuffer & appendUtf32(sal_uInt32 c) {
918  return insertUtf32(getLength(), c);
919  }
920 
936  sal_Unicode * appendUninitialized(sal_Int32 length) SAL_RETURNS_NONNULL {
937  sal_Int32 n = getLength();
938  rtl_uStringbuffer_insert(&pData, &nCapacity, n, NULL, length);
939  return pData->buffer + n;
940  }
941 
957  OUStringBuffer & insert(sal_Int32 offset, const OUString & str)
958  {
959  return insert( offset, str.getStr(), str.getLength() );
960  }
961 
979  OUStringBuffer & insert( sal_Int32 offset, const sal_Unicode * str )
980  {
981  return insert( offset, str, rtl_ustr_getLength( str ) );
982  }
983 
1002  OUStringBuffer & insert( sal_Int32 offset, const sal_Unicode * str, sal_Int32 len)
1003  {
1004  assert( len == 0 || str != NULL ); // cannot assert that in rtl_uStringbuffer_insert
1005  rtl_uStringbuffer_insert( &pData, &nCapacity, offset, str, len );
1006  return *this;
1007  }
1008 
1014  template< typename T >
1016  {
1017  assert(
1020  &pData, &nCapacity, offset,
1023  return *this;
1024  }
1025 
1026 #if defined LIBO_INTERNAL_ONLY
1027 
1028  template<typename T>
1030  T, OUStringBuffer &>::TypeUtf16
1031  insert(sal_Int32 offset, T & literal) {
1032  return insert(
1033  offset,
1036  }
1037 
1039  OUStringBuffer & insert(sal_Int32 offset, OUStringLiteral const & literal) {
1041  &pData, &nCapacity, offset, literal.data, literal.size);
1042  return *this;
1043  }
1044 #endif
1045 
1063  OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
1064  {
1066  return insert( offset, sz, rtl_ustr_valueOfBoolean( sz, b ) );
1067  }
1068 
1088  OUStringBuffer & insert(sal_Int32 offset, bool b)
1089  {
1091  return insert( offset, sz, rtl_ustr_valueOfBoolean( sz, b ) );
1092  }
1093 
1112  OUStringBuffer & insert(sal_Int32 offset, char c)
1113  {
1114  sal_Unicode u = c;
1115  return insert( offset, &u, 1 );
1116  }
1117 
1134  OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
1135  {
1136  return insert( offset, &c, 1 );
1137  }
1138 
1158  OUStringBuffer & insert(sal_Int32 offset, sal_Int32 i, sal_Int16 radix = 10 )
1159  {
1161  return insert( offset, sz, rtl_ustr_valueOfInt32( sz, i, radix ) );
1162  }
1163 
1183  OUStringBuffer & insert(sal_Int32 offset, sal_Int64 l, sal_Int16 radix = 10 )
1184  {
1186  return insert( offset, sz, rtl_ustr_valueOfInt64( sz, l, radix ) );
1187  }
1188 
1207  OUStringBuffer insert(sal_Int32 offset, float f)
1208  {
1210  return insert( offset, sz, rtl_ustr_valueOfFloat( sz, f ) );
1211  }
1212 
1231  OUStringBuffer & insert(sal_Int32 offset, double d)
1232  {
1234  return insert( offset, sz, rtl_ustr_valueOfDouble( sz, d ) );
1235  }
1236 
1252  OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c) {
1253  rtl_uStringbuffer_insertUtf32(&pData, &nCapacity, offset, c);
1254  return *this;
1255  }
1256 
1269  OUStringBuffer & remove( sal_Int32 start, sal_Int32 len )
1270  {
1271  rtl_uStringbuffer_remove( &pData, start, len );
1272  return *this;
1273  }
1274 
1285  OUStringBuffer & truncate( sal_Int32 start = 0 )
1286  {
1287  rtl_uStringbuffer_remove( &pData, start, getLength() - start );
1288  return *this;
1289  }
1290 
1302  {
1303  sal_Int32 index = 0;
1304  while((index = indexOf(oldChar, index)) >= 0)
1305  {
1306  pData->buffer[ index ] = newChar;
1307  }
1308  return *this;
1309  }
1310 
1326  void accessInternals(rtl_uString *** pInternalData,
1327  sal_Int32 ** pInternalCapacity)
1328  {
1329  *pInternalData = &pData;
1330  *pInternalCapacity = &nCapacity;
1331  }
1332 
1333 
1349  sal_Int32 indexOf( sal_Unicode ch, sal_Int32 fromIndex = 0 ) const
1350  {
1351  assert( fromIndex >= 0 && fromIndex <= pData->length );
1352  sal_Int32 ret = rtl_ustr_indexOfChar_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, ch );
1353  return (ret < 0 ? ret : ret+fromIndex);
1354  }
1355 
1367  sal_Int32 lastIndexOf( sal_Unicode ch ) const
1368  {
1369  return rtl_ustr_lastIndexOfChar_WithLength( pData->buffer, pData->length, ch );
1370  }
1371 
1386  sal_Int32 lastIndexOf( sal_Unicode ch, sal_Int32 fromIndex ) const
1387  {
1388  assert( fromIndex >= 0 && fromIndex <= pData->length );
1389  return rtl_ustr_lastIndexOfChar_WithLength( pData->buffer, fromIndex, ch );
1390  }
1391 
1409  sal_Int32 indexOf( const OUString & str, sal_Int32 fromIndex = 0 ) const
1410  {
1411  assert( fromIndex >= 0 && fromIndex <= pData->length );
1412  sal_Int32 ret = rtl_ustr_indexOfStr_WithLength( pData->buffer+fromIndex, pData->length-fromIndex,
1413  str.pData->buffer, str.pData->length );
1414  return (ret < 0 ? ret : ret+fromIndex);
1415  }
1416 
1423  template< typename T >
1424  typename libreoffice_internal::ConstCharArrayDetector< T, sal_Int32 >::Type indexOf( T& literal, sal_Int32 fromIndex = 0 ) const
1425  {
1426  assert(
1428  sal_Int32 n = rtl_ustr_indexOfAscii_WithLength(
1429  pData->buffer + fromIndex, pData->length - fromIndex,
1432  return n < 0 ? n : n + fromIndex;
1433  }
1434 
1435 #if defined LIBO_INTERNAL_ONLY
1436 
1437  template<typename T>
1438  typename
1440  indexOf(T & literal, sal_Int32 fromIndex = 0) const {
1441  assert(fromIndex >= 0);
1443  pData->buffer + fromIndex, pData->length - fromIndex,
1446  return n < 0 ? n : n + fromIndex;
1447  }
1448 
1450  sal_Int32 indexOf(OUStringLiteral const & literal, sal_Int32 fromIndex = 0)
1451  const
1452  {
1453  sal_Int32 n = rtl_ustr_indexOfAscii_WithLength(
1454  pData->buffer + fromIndex, pData->length - fromIndex, literal.data,
1455  literal.size);
1456  return n < 0 ? n : n + fromIndex;
1457  }
1458 #endif
1459 
1477  sal_Int32 lastIndexOf( const OUString & str ) const
1478  {
1479  return rtl_ustr_lastIndexOfStr_WithLength( pData->buffer, pData->length,
1480  str.pData->buffer, str.pData->length );
1481  }
1482 
1502  sal_Int32 lastIndexOf( const OUString & str, sal_Int32 fromIndex ) const
1503  {
1504  assert( fromIndex >= 0 && fromIndex <= pData->length );
1505  return rtl_ustr_lastIndexOfStr_WithLength( pData->buffer, fromIndex,
1506  str.pData->buffer, str.pData->length );
1507  }
1508 
1514  template< typename T >
1516  {
1517  assert(
1520  pData->buffer, pData->length,
1523  }
1524 
1525 #if defined LIBO_INTERNAL_ONLY
1526 
1527  template<typename T>
1528  typename
1530  lastIndexOf(T & literal) const {
1532  pData->buffer, pData->length,
1535  }
1536 
1538  sal_Int32 lastIndexOf(OUStringLiteral const & literal) const {
1540  pData->buffer, pData->length, literal.data, literal.size);
1541  }
1542 #endif
1543 
1553  sal_Int32 stripStart(sal_Unicode c = ' ')
1554  {
1555  sal_Int32 index;
1556  for(index = 0; index < getLength() ; index++)
1557  {
1558  if(pData->buffer[ index ] != c)
1559  {
1560  break;
1561  }
1562  }
1563  if(index)
1564  {
1565  remove(0, index);
1566  }
1567  return index;
1568  }
1569 
1579  sal_Int32 stripEnd(sal_Unicode c = ' ')
1580  {
1581  sal_Int32 result = getLength();
1582  sal_Int32 index;
1583  for(index = getLength(); index > 0 ; index--)
1584  {
1585  if(pData->buffer[ index - 1 ] != c)
1586  {
1587  break;
1588  }
1589  }
1590  if(index < getLength())
1591  {
1592  truncate(index);
1593  }
1594  return result - getLength();
1595  }
1605  sal_Int32 strip(sal_Unicode c = ' ')
1606  {
1607  return stripStart(c) + stripEnd(c);
1608  }
1620  OUStringBuffer copy( sal_Int32 beginIndex ) const
1621  {
1622  return copy( beginIndex, getLength() - beginIndex );
1623  }
1624 
1638  OUStringBuffer copy( sal_Int32 beginIndex, sal_Int32 count ) const
1639  {
1640  assert(beginIndex >= 0 && beginIndex <= getLength());
1641  assert(count >= 0 && count <= getLength() - beginIndex);
1642  rtl_uString *pNew = NULL;
1643  rtl_uStringbuffer_newFromStr_WithLength( &pNew, getStr() + beginIndex, count );
1644  return OUStringBuffer( pNew, count + 16 );
1645  }
1646 
1647 #if defined LIBO_INTERNAL_ONLY
1648  explicit operator OUStringView() const
1649  {
1650  return OUStringView(getStr(), getLength());
1651  }
1652 #endif
1653 
1654 private:
1655  OUStringBuffer( rtl_uString * value, const sal_Int32 capacity )
1656  {
1657  pData = value;
1658  nCapacity = capacity;
1659  }
1660 
1664  rtl_uString * pData;
1665 
1669  sal_Int32 nCapacity;
1670 };
1671 
1672 #if defined LIBO_INTERNAL_ONLY
1673  // Define this here to avoid circular includes
1674  inline OUString & OUString::operator+=( const OUStringBuffer & str ) &
1675  {
1676  // Call operator= if this is empty, otherwise rtl_uString_newConcat will attempt to
1677  // acquire() the str.pData buffer, which is part of the OUStringBuffer mutable state.
1678  if (isEmpty())
1679  return operator=(str.toString());
1680  else
1681  return internalAppend(str.pData);
1682  }
1683 #endif
1684 }
1685 
1686 #ifdef RTL_STRING_UNITTEST
1687 namespace rtl
1688 {
1689 typedef rtlunittest::OUStringBuffer OUStringBuffer;
1690 }
1691 #endif
1692 
1693 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
1694 using ::rtl::OUStringBuffer;
1695 #endif
1696 
1697 #endif // INCLUDED_RTL_USTRBUF_HXX
1698 
1699 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl::OUStringBuffer::insert
OUStringBuffer & insert(sal_Int32 offset, char c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1112
rtl::OUStringBuffer::append
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:846
rtl::OUStringBuffer::insert
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:1183
rtl::OUStringBuffer::insert
OUStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: ustrbuf.hxx:1063
rtl::OUStringBuffer::~OUStringBuffer
~OUStringBuffer()
Release the string data.
Definition: ustrbuf.hxx:355
ustring.hxx
rtl_ustr_valueOfInt64
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.
rtl::OUStringBuffer::OUStringBuffer
OUStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters.
Definition: ustrbuf.hxx:73
sal_Char
char sal_Char
A legacy synonym for char.
Definition: types.h:120
rtl::libreoffice_internal::CharPtrDetector
Definition: stringutils.hxx:133
rtl::OUStringBuffer::append
OUStringBuffer & append(rtl_uString *str)
Definition: ustrbuf.hxx:775
rtl::OUStringBuffer::indexOf
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:1349
rtl::OUString
This String class provides base functionality for C++ like Unicode character array handling.
Definition: ustring.hxx:127
rtl::OUStringBuffer::lastIndexOf
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:1502
rtl_uStringbuffer_insertUtf32
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.
rtl::OUStringBuffer::insert
OUStringBuffer insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: ustrbuf.hxx:1207
rtl::OUStringBuffer::indexOf
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:1409
rtl::OUStringBuffer::append
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:636
ustrbuf.h
rtl::OUStringBuffer::lastIndexOf
sal_Int32 lastIndexOf(sal_Unicode ch) const
Returns the index within this string of the last occurrence of the specified character,...
Definition: ustrbuf.hxx:1367
RTL_USTR_MAX_VALUEOFDOUBLE
#define RTL_USTR_MAX_VALUEOFDOUBLE
Definition: ustring.h:1041
SAL_NO_ACQUIRE
@ SAL_NO_ACQUIRE
definition of a no acquire enum for ctors
Definition: types.h:374
rtl::OUStringBuffer::append
OUStringBuffer & append(const OUString &str)
Appends the string to this string buffer.
Definition: ustrbuf.hxx:553
rtl::OUStringBuffer::append
OUStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: ustrbuf.hxx:898
rtl_ustr_indexOfStr_WithLength
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.
rtl::OUStringBuffer::remove
OUStringBuffer & remove(sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
Definition: ustrbuf.hxx:1269
rtl_ustr_indexOfChar_WithLength
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.
rtl_ustr_lastIndexOfAscii_WithLength
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.
rtl::OUStringBuffer::indexOf
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:1424
rtl::OUString::getLength
sal_Int32 getLength() const
Returns the length of this string.
Definition: ustring.hxx:682
rtl::OUStringBuffer::makeStringAndClear
SAL_WARN_UNUSED_RESULT OUString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: ustrbuf.hxx:368
rtl::OUStringBuffer::lastIndexOf
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:1386
rtl::OUStringBuffer::insert
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:1015
rtl::OUStringBuffer::appendAscii
OUStringBuffer & appendAscii(const sal_Char *str, sal_Int32 len)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:735
rtl_ustr_getLength
SAL_DLLPUBLIC sal_Int32 rtl_ustr_getLength(const sal_Unicode *str) SAL_THROW_EXTERN_C()
Return the length of a string.
rtl::OUStringBuffer::getCapacity
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: ustrbuf.hxx:408
rtl::OUString::operator+=
OUString & operator+=(const OUString &str)
Append a string to this string.
Definition: ustring.hxx:562
SAL_WARN_UNUSED
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:578
rtl::OUStringBuffer::replace
OUStringBuffer & replace(sal_Unicode oldChar, sal_Unicode newChar)
Replace all occurrences of oldChar in this string buffer with newChar.
Definition: ustrbuf.hxx:1301
rtl_uStringBuffer_makeStringAndClear
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.
rtl::OUStringBuffer::OUStringBuffer
OUStringBuffer(const OUStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition: ustrbuf.hxx:86
rtl::OUStringBuffer::append
OUStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition: ustrbuf.hxx:881
sal_Bool
unsigned char sal_Bool
Definition: types.h:38
config.h
rtl::OUStringBuffer::appendUtf32
OUStringBuffer & appendUtf32(sal_uInt32 c)
Appends a single UTF-32 character to this string buffer.
Definition: ustrbuf.hxx:917
rtl_uStringbuffer_insert_ascii
SAL_DLLPUBLIC void rtl_uStringbuffer_insert_ascii(rtl_uString **This, sal_Int32 *capacity, sal_Int32 offset, const sal_Char *str, sal_Int32 len)
Inserts the 8-Bit ASCII string representation of the str array argument into this string buffer.
rtl::OUStringBuffer::insert
OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c)
Inserts the string representation of the char argument into this string buffer.
Definition: ustrbuf.hxx:1134
rtl_uString_release
SAL_DLLPUBLIC void rtl_uString_release(rtl_uString *str) SAL_THROW_EXTERN_C() SAL_HOT
Decrement the reference count of a string.
rtl::OUStringBuffer::insertUtf32
OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c)
Inserts a single UTF-32 character into this string buffer.
Definition: ustrbuf.hxx:1252
rtl_ustr_lastIndexOfStr_WithLength
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.
rtl::libreoffice_internal::Enable
Definition: stringutils.hxx:338
RTL_USTR_MAX_VALUEOFBOOLEAN
#define RTL_USTR_MAX_VALUEOFBOOLEAN
Definition: ustring.h:915
rtl::OUStringBuffer::strip
sal_Int32 strip(sal_Unicode c=' ')
Strip the given character from the both end of the buffer.
Definition: ustrbuf.hxx:1605
rtl::OUStringBuffer::insert
OUStringBuffer & insert(sal_Int32 offset, const OUString &str)
Inserts the string into this string buffer.
Definition: ustrbuf.hxx:957
rtl::libreoffice_internal::SalUnicodePtrDetector
Definition: stringutils.hxx:319
types.h
rtl::OUStringBuffer::getLength
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: ustrbuf.hxx:380
rtl_uString_alloc
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.
rtl::OUStringBuffer::truncate
OUStringBuffer & truncate(sal_Int32 start=0)
Removes the tail of a string buffer start at the indicate position.
Definition: ustrbuf.hxx:1285
rtl::OUStringBuffer::OUStringBuffer
OUStringBuffer(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition: ustrbuf.hxx:144
rtl
Definition: bootstrap.hxx:30
rtl::OUStringBuffer::appendAscii
OUStringBuffer & appendAscii(const sal_Char *str)
Appends a 8-Bit ASCII character string to this string buffer.
Definition: ustrbuf.hxx:712
rtl::OUStringBuffer::ensureCapacity
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition: ustrbuf.hxx:424
rtl_uStringbuffer_remove
SAL_DLLPUBLIC void rtl_uStringbuffer_remove(rtl_uString **This, sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
rtl_uStringbuffer_ensureCapacity
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.
rtl::OUStringBuffer::setLength
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: ustrbuf.hxx:447
rtl::OUStringBuffer::toString
const OUString toString() const
Return an OUString instance reflecting the current content of this OUStringBuffer.
Definition: ustrbuf.hxx:538
rtl::OUStringBuffer::stripEnd
sal_Int32 stripEnd(sal_Unicode c=' ')
Strip the given character from the end of the buffer.
Definition: ustrbuf.hxx:1579
rtl::OUString::getStr
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the Unicode character buffer for this string.
Definition: ustring.hxx:704
rtl::OUStringBuffer::accessInternals
void accessInternals(rtl_uString ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OUStringBuffer, for effective manipulation.
Definition: ustrbuf.hxx:1326
rtl_uStringbuffer_newFromStringBuffer
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.
RTL_USTR_MAX_VALUEOFINT64
#define RTL_USTR_MAX_VALUEOFINT64
Definition: ustring.h:980
rtl_ustr_valueOfBoolean
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfBoolean(sal_Unicode *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
rtl::OUStringBuffer::insert
OUStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: ustrbuf.hxx:1088
SAL_DEPRECATED
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:465
rtl::OUStringBuffer::insert
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:979
rtl::libreoffice_internal::Dummy
Definition: stringutils.hxx:130
rtl::libreoffice_internal::ExceptCharArrayDetector::Type
Dummy Type
Definition: stringutils.hxx:301
rtl::OUStringBuffer
A string buffer implements a mutable sequence of characters.
Definition: ustrbuf.hxx:66
rtl::libreoffice_internal::ConstCharArrayDetector
Definition: stringutils.hxx:185
rtl::OUStringBuffer::append
OUStringBuffer & append(const OUStringBuffer &str)
Appends the content of a stringbuffer to this string buffer.
Definition: ustrbuf.hxx:579
rtl_ustr_valueOfFloat
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfFloat(sal_Unicode *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
rtl_ustr_lastIndexOfChar_WithLength
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.
rtl::OUStringBuffer::append
OUStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: ustrbuf.hxx:754
SAL_WARN_UNUSED_RESULT
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:302
rtl_uString_newFromLiteral
SAL_DLLPUBLIC void rtl_uString_newFromLiteral(rtl_uString **newStr, const sal_Char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
RTL_USTR_MAX_VALUEOFFLOAT
#define RTL_USTR_MAX_VALUEOFFLOAT
Definition: ustring.h:1022
rtl::OUStringBuffer::appendUninitialized
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:936
rtl::OUStringBuffer::OUStringBuffer
OUStringBuffer(int length)
Constructs a string buffer with no characters in it and an initial capacity specified by the length a...
Definition: ustrbuf.hxx:99
rtl::OUStringBuffer::append
OUStringBuffer & append(char c)
Appends the string representation of the ASCII char argument to this string buffer.
Definition: ustrbuf.hxx:809
sal_Unicode
sal_uInt16 sal_Unicode
Definition: types.h:141
rtl::OUStringBuffer::insert
OUStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer.
Definition: ustrbuf.hxx:1231
rtl::OUStringBuffer::lastIndexOf
sal_Int32 lastIndexOf(const OUString &str) const
Returns the index within this string of the last occurrence of the specified substring,...
Definition: ustrbuf.hxx:1477
rtl::OUStringBuffer::OUStringBuffer
OUStringBuffer(const OUString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition: ustrbuf.hxx:136
rtl_ustr_indexOfAscii_WithLength
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.
RTL_USTR_MAX_VALUEOFINT32
#define RTL_USTR_MAX_VALUEOFINT32
Definition: ustring.h:957
SAL_DELETED_FUNCTION
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:396
rtl::OUStringBuffer::getStr
const sal_Unicode * getStr() const SAL_RETURNS_NONNULL
Return a null terminated unicode character array.
Definition: ustrbuf.hxx:502
rtl_uStringbuffer_newFromStr_WithLength
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.
rtl::OUStringBuffer::insert
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:1158
rtl::libreoffice_internal::ExceptConstCharArrayDetector::Type
Dummy Type
Definition: stringutils.hxx:279
rtl_uString_new_WithLength
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.
rtl::libreoffice_internal::NonConstCharArrayDetector
Definition: stringutils.hxx:157
rtl::OUStringBuffer::copy
OUStringBuffer copy(sal_Int32 beginIndex, sal_Int32 count) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1638
rtl_ustr_valueOfDouble
SAL_DLLPUBLIC sal_Int32 rtl_ustr_valueOfDouble(sal_Unicode *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
rtl::OUStringBuffer::append
OUStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition: ustrbuf.hxx:864
rtl::OUStringBuffer::copy
OUStringBuffer copy(sal_Int32 beginIndex) const
Returns a new string buffer that is a substring of this string.
Definition: ustrbuf.hxx:1620
rtl::OUStringBuffer::insert
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:1002
rtl_uStringbuffer_insert
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.
rtl::OUStringBuffer::stripStart
sal_Int32 stripStart(sal_Unicode c=' ')
Strip the given character from the start of the buffer.
Definition: ustrbuf.hxx:1553
rtl::OUStringBuffer::append
OUStringBuffer & append(sal_Unicode c)
Appends the string representation of the char argument to this string buffer.
Definition: ustrbuf.hxx:825
rtl_str_getLength
SAL_DLLPUBLIC sal_Int32 rtl_str_getLength(const sal_Char *str) SAL_THROW_EXTERN_C()
Return the length of a string.
rtl::OUStringBuffer::append
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:623
rtl_ustr_valueOfInt32
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.
rtl::OUStringBuffer::lastIndexOf
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:1515
rtl::OUStringBuffer::isEmpty
bool isEmpty() const
Checks if a string buffer is empty.
Definition: ustrbuf.hxx:393
rtl::OUStringBuffer::append
OUStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: ustrbuf.hxx:791
rtl::OUStringBuffer::append
OUStringBuffer & append(const sal_Unicode *str)
Appends the string representation of the char array argument to this string buffer.
Definition: ustrbuf.hxx:604
stringutils.hxx