LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
strbuf.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_STRBUF_HXX
21 #define INCLUDED_RTL_STRBUF_HXX
22 
23 #include <sal/config.h>
24 
25 #include <cassert>
26 #include <cstddef>
27 #include <cstring>
28 
29 #include <rtl/strbuf.h>
30 #include <rtl/string.hxx>
31 #include <rtl/stringutils.hxx>
32 
33 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
34 #include <rtl/stringconcat.hxx>
35 #endif
36 
37 // The unittest uses slightly different code to help check that the proper
38 // calls are made. The class is put into a different namespace to make
39 // sure the compiler generates a different (if generating also non-inline)
40 // copy of the function and does not merge them together. The class
41 // is "brought" into the proper rtl namespace by a typedef below.
42 #ifdef RTL_STRING_UNITTEST
43 #define rtl rtlunittest
44 #endif
45 
46 namespace rtl
47 {
48 
50 #ifdef RTL_STRING_UNITTEST
51 #undef rtl
52 // helper macro to make functions appear more readable
53 #define RTL_STRING_CONST_FUNCTION rtl_string_unittest_const_literal_function = true;
54 #else
55 #define RTL_STRING_CONST_FUNCTION
56 #endif
57 
62 {
63 public:
69  : pData(NULL)
70  , nCapacity( 16 )
71  {
72  rtl_string_new_WithLength( &pData, nCapacity );
73  }
74 
81  OStringBuffer( const OStringBuffer & value )
82  : pData(NULL)
83  , nCapacity( value.nCapacity )
84  {
85  rtl_stringbuffer_newFromStringBuffer( &pData, value.nCapacity, value.pData );
86  }
87 
94  explicit OStringBuffer(int length)
95  : pData(NULL)
96  , nCapacity( length )
97  {
98  rtl_string_new_WithLength( &pData, length );
99  }
100 #if __cplusplus >= 201103L
101  explicit OStringBuffer(unsigned int length)
102  : OStringBuffer(static_cast<int>(length))
103  {
104  }
105 #if SAL_TYPES_SIZEOFLONG == 4
106  // additional overloads for sal_Int32 sal_uInt32
107  explicit OStringBuffer(long length)
108  : OStringBuffer(static_cast<int>(length))
109  {
110  }
111  explicit OStringBuffer(unsigned long length)
112  : OStringBuffer(static_cast<int>(length))
113  {
114  }
115 #endif
116  // avoid obvious bugs
117  explicit OStringBuffer(char) = delete;
118  explicit OStringBuffer(sal_Unicode) = delete;
119 #endif
120 
131  OStringBuffer(const OString& value)
132  : pData(NULL)
133  , nCapacity( value.getLength() + 16 )
134  {
135  rtl_stringbuffer_newFromStr_WithLength( &pData, value.getStr(), value.getLength() );
136  }
137 
142  template< typename T >
144  : pData(NULL)
145  {
146  sal_Int32 length = rtl_str_getLength( value );
147  nCapacity = length + 16;
148  rtl_stringbuffer_newFromStr_WithLength( &pData, value, length );
149  }
150 
151  template< typename T >
153  : pData(NULL)
154  {
155  sal_Int32 length = rtl_str_getLength( value );
156  nCapacity = length + 16;
157  rtl_stringbuffer_newFromStr_WithLength( &pData, value, length );
158  }
159 
171  template< typename T >
173  : pData(NULL)
174  , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
175  {
176  assert(
179  &pData,
182 #ifdef RTL_STRING_UNITTEST
183  rtl_string_unittest_const_literal = true;
184 #endif
185  }
186 
199  OStringBuffer(const sal_Char * value, sal_Int32 length)
200  : pData(NULL)
201  , nCapacity( length + 16 )
202  {
203  rtl_stringbuffer_newFromStr_WithLength( &pData, value, length );
204  }
205 
206 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
207 
211  template< typename T1, typename T2 >
212  OStringBuffer( const OStringConcat< T1, T2 >& c )
213  {
214  const sal_Int32 l = c.length();
215  nCapacity = l + 16;
216  pData = rtl_string_alloc( nCapacity );
217  char* end = c.addData( pData->buffer );
218  *end = '\0';
219  pData->length = l;
220  }
221 #endif
222 
225  OStringBuffer& operator = ( const OStringBuffer& value )
226  {
227  if (this != &value)
228  {
230  value.nCapacity,
231  value.pData);
232  nCapacity = value.nCapacity;
233  }
234  return *this;
235  }
236 
241  OStringBuffer & operator =(OString const & string) {
242  sal_Int32 n = string.getLength();
243  if (n >= nCapacity) {
244  ensureCapacity(n + 16); //TODO: check for overflow
245  }
246  std::memcpy(pData->buffer, string.pData->buffer, n + 1);
247  pData->length = n;
248  return *this;
249  }
250 
255  template<typename T>
256  typename
258  operator =(T & literal) {
259  assert(
261  sal_Int32 const n
263  if (n >= nCapacity) {
264  ensureCapacity(n + 16); //TODO: check for overflow
265  }
266  std::memcpy(
267  pData->buffer,
269  n + 1);
270  pData->length = n;
271  return *this;
272  }
273 
274 #if defined LIBO_INTERNAL_ONLY
275 
276  template<typename T1, typename T2>
277  OStringBuffer & operator =(OStringConcat<T1, T2> const & concat) {
278  sal_Int32 const n = concat.length();
279  if (n >= nCapacity) {
280  ensureCapacity(n + 16); //TODO: check for overflow
281  }
282  *concat.addData(pData->buffer) = 0;
283  pData->length = n;
284  return *this;
285  }
286 #endif
287 
292  {
293  rtl_string_release( pData );
294  }
295 
305  {
306  OString aRet( pData );
307  rtl_string_new(&pData);
308  nCapacity = 0;
309  return aRet;
310  }
311 
317  sal_Int32 getLength() const
318  {
319  return pData->length;
320  }
321 
330  bool isEmpty() const
331  {
332  return pData->length == 0;
333  }
334 
345  sal_Int32 getCapacity() const
346  {
347  return nCapacity;
348  }
349 
361  void ensureCapacity(sal_Int32 minimumCapacity)
362  {
363  rtl_stringbuffer_ensureCapacity( &pData, &nCapacity, minimumCapacity );
364  }
365 
384  void setLength(sal_Int32 newLength)
385  {
386  assert(newLength >= 0);
387  // Avoid modifications if pData points to const empty string:
388  if( newLength != pData->length )
389  {
390  if( newLength > nCapacity )
391  rtl_stringbuffer_ensureCapacity(&pData, &nCapacity, newLength);
392  else
393  pData->buffer[newLength] = '\0';
394  pData->length = newLength;
395  }
396  }
397 
411  SAL_DEPRECATED("use rtl::OStringBuffer::operator [] instead")
412  sal_Char charAt( sal_Int32 index )
413  {
414  assert(index >= 0 && index < pData->length);
415  return pData->buffer[ index ];
416  }
417 
428  SAL_DEPRECATED("use rtl::OStringBuffer::operator [] instead")
429  OStringBuffer & setCharAt(sal_Int32 index, sal_Char ch)
430  {
431  assert(index >= 0 && index < pData->length);
432  pData->buffer[ index ] = ch;
433  return *this;
434  }
435 
439  const sal_Char* getStr() const { return pData->buffer; }
440 
450  sal_Char & operator [](sal_Int32 index)
451  {
452  assert(index >= 0 && index < pData->length);
453  return pData->buffer[index];
454  }
455 
460  const OString toString() const
461  {
462  return OString(pData->buffer, pData->length);
463  }
464 
476  {
477  return append( str.getStr(), str.getLength() );
478  }
479 
491  template< typename T >
493  {
494  return append( str, rtl_str_getLength( str ) );
495  }
496 
497  template< typename T >
499  {
500  return append( str, rtl_str_getLength( str ) );
501  }
502 
508  template< typename T >
510  {
511  RTL_STRING_CONST_FUNCTION
512  assert(
515  &pData, &nCapacity, getLength(),
518  return *this;
519  }
520 
534  OStringBuffer & append( const sal_Char * str, sal_Int32 len)
535  {
536  assert( len == 0 || str != NULL ); // cannot assert that in rtl_stringbuffer_insert
537  rtl_stringbuffer_insert( &pData, &nCapacity, getLength(), str, len );
538  return *this;
539  }
540 
541 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
542 
546  template< typename T1, typename T2 >
547  OStringBuffer& append( const OStringConcat< T1, T2 >& c )
548  {
549  sal_Int32 l = c.length();
550  if( l == 0 )
551  return *this;
552  l += pData->length;
553  rtl_stringbuffer_ensureCapacity( &pData, &nCapacity, l );
554  char* end = c.addData( pData->buffer + pData->length );
555  *end = '\0';
556  pData->length = l;
557  return *this;
558  }
559 #endif
560 
573  {
575  return append( sz, rtl_str_valueOfBoolean( sz, b ) );
576  }
577 
592  {
594  return append( sz, rtl_str_valueOfBoolean( sz, b ) );
595  }
596 
598  // Pointer can be automatically converted to bool, which is unwanted here.
599  // Explicitly delete all pointer append() overloads to prevent this
600  // (except for char* overload, which is handled elsewhere).
601  template< typename T >
602  typename libreoffice_internal::Enable< void,
604  append( T* ) SAL_DELETED_FUNCTION;
606 
618  {
619  return append( &c, 1 );
620  }
621 
634  OStringBuffer & append(sal_Int32 i, sal_Int16 radix = 10 )
635  {
637  return append( sz, rtl_str_valueOfInt32( sz, i, radix ) );
638  }
639 
652  OStringBuffer & append(sal_Int64 l, sal_Int16 radix = 10 )
653  {
655  return append( sz, rtl_str_valueOfInt64( sz, l, radix ) );
656  }
657 
670  {
672  return append( sz, rtl_str_valueOfFloat( sz, f ) );
673  }
674 
686  OStringBuffer & append(double d)
687  {
689  return append( sz, rtl_str_valueOfDouble( sz, d ) );
690  }
691 
707  char * appendUninitialized(sal_Int32 length) {
708  sal_Int32 n = getLength();
709  rtl_stringbuffer_insert(&pData, &nCapacity, n, NULL, length);
710  return pData->buffer + n;
711  }
712 
728  OStringBuffer & insert(sal_Int32 offset, const OString & str)
729  {
730  return insert( offset, str.getStr(), str.getLength() );
731  }
732 
750  template< typename T >
752  {
753  return insert( offset, str, rtl_str_getLength( str ) );
754  }
755 
756  template< typename T >
758  {
759  return insert( offset, str, rtl_str_getLength( str ) );
760  }
761 
767  template< typename T >
769  {
770  RTL_STRING_CONST_FUNCTION
771  assert(
774  &pData, &nCapacity, offset,
777  return *this;
778  }
779 
798  OStringBuffer & insert( sal_Int32 offset, const sal_Char * str, sal_Int32 len)
799  {
800  assert( len == 0 || str != NULL ); // cannot assert that in rtl_stringbuffer_insert
801  rtl_stringbuffer_insert( &pData, &nCapacity, offset, str, len );
802  return *this;
803  }
804 
822  OStringBuffer & insert(sal_Int32 offset, sal_Bool b)
823  {
825  return insert( offset, sz, rtl_str_valueOfBoolean( sz, b ) );
826  }
827 
847  OStringBuffer & insert(sal_Int32 offset, bool b)
848  {
850  return insert( offset, sz, rtl_str_valueOfBoolean( sz, b ) );
851  }
852 
869  OStringBuffer & insert(sal_Int32 offset, sal_Char c)
870  {
871  return insert( offset, &c, 1 );
872  }
873 
892  OStringBuffer & insert(sal_Int32 offset, sal_Int32 i, sal_Int16 radix = 10 )
893  {
895  return insert( offset, sz, rtl_str_valueOfInt32( sz, i, radix ) );
896  }
897 
916  OStringBuffer & insert(sal_Int32 offset, sal_Int64 l, sal_Int16 radix = 10 )
917  {
919  return insert( offset, sz, rtl_str_valueOfInt64( sz, l, radix ) );
920  }
921 
939  OStringBuffer insert(sal_Int32 offset, float f)
940  {
942  return insert( offset, sz, rtl_str_valueOfFloat( sz, f ) );
943  }
944 
962  OStringBuffer & insert(sal_Int32 offset, double d)
963  {
965  return insert( offset, sz, rtl_str_valueOfDouble( sz, d ) );
966  }
967 
980  OStringBuffer & remove( sal_Int32 start, sal_Int32 len )
981  {
982  rtl_stringbuffer_remove( &pData, start, len );
983  return *this;
984  }
985 
986 private:
990  rtl_String * pData;
991 
995  sal_Int32 nCapacity;
996 };
997 
998 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
999 
1002 template<>
1003 struct ToStringHelper< OStringBuffer >
1004  {
1005  static int length( const OStringBuffer& s ) { return s.getLength(); }
1006  static char* addData( char* buffer, const OStringBuffer& s ) { return addDataHelper( buffer, s.getStr(), s.getLength()); }
1007  static const bool allowOStringConcat = true;
1008  static const bool allowOUStringConcat = false;
1009  };
1010 #endif
1011 
1012 
1013 }
1014 
1015 #ifdef RTL_STRING_UNITTEST
1016 namespace rtl
1017 {
1018 typedef rtlunittest::OStringBuffer OStringBuffer;
1019 }
1020 #undef RTL_STRING_CONST_FUNCTION
1021 #endif
1022 
1023 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
1024 using ::rtl::OStringBuffer;
1025 #endif
1026 
1027 #endif // INCLUDED_RTL_STRBUF_HXX
1028 
1029 
1030 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfBoolean(sal_Char *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
OStringBuffer & insert(sal_Int32 offset, sal_Int64 l, sal_Int16 radix=10)
Inserts the string representation of the long argument into this string buffer.
Definition: strbuf.hxx:916
OStringBuffer & append(const OString &str)
Appends the string to this string buffer.
Definition: strbuf.hxx:475
OStringBuffer(T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Constructs a string buffer so that it represents the same sequence of characters as the string litera...
Definition: strbuf.hxx:172
OStringBuffer(int length)
Constructs a string buffer with no characters in it and an initial capacity specified by the length a...
Definition: strbuf.hxx:94
SAL_DLLPUBLIC void rtl_stringbuffer_ensureCapacity(rtl_String **This, sal_Int32 *capacity, sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
bool isEmpty() const
Checks if a string buffer is empty.
Definition: strbuf.hxx:330
#define RTL_STR_MAX_VALUEOFDOUBLE
Definition: string.h:711
libreoffice_internal::CharPtrDetector< T, OStringBuffer & >::Type append(const T &str)
Appends the string representation of the char array argument to this string buffer.
Definition: strbuf.hxx:492
char sal_Char
A legacy synonym for char.
Definition: types.h:130
OStringBuffer & insert(sal_Int32 offset, const sal_Char *str, sal_Int32 len)
Inserts the string representation of the char array argument into this string buffer.
Definition: strbuf.hxx:798
libreoffice_internal::NonConstCharArrayDetector< T, OStringBuffer & >::Type append(T &str)
Definition: strbuf.hxx:498
const OString toString() const
Return a OString instance reflecting the current content of this OStringBuffer.
Definition: strbuf.hxx:460
OStringBuffer(const OString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition: strbuf.hxx:131
SAL_DLLPUBLIC void rtl_string_new_WithLength(rtl_String **newStr, sal_Int32 len) SAL_THROW_EXTERN_C()
Allocate a new string containing space for a given number of characters.
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:410
SAL_DLLPUBLIC sal_Int32 rtl_stringbuffer_newFromStringBuffer(rtl_String **newStr, sal_Int32 capacity, rtl_String *oldStr)
Allocates a new String that contains the same sequence of characters as the string argument...
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:624
SAL_DLLPUBLIC void rtl_string_newFromLiteral(rtl_String **newStr, const sal_Char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
libreoffice_internal::CharPtrDetector< T, OStringBuffer & >::Type insert(sal_Int32 offset, const T &str)
Inserts the string representation of the char array argument into this string buffer.
Definition: strbuf.hxx:751
~OStringBuffer()
Release the string data.
Definition: strbuf.hxx:291
OStringBuffer & append(const sal_Char *str, sal_Int32 len)
Appends the string representation of the char array argument to this string buffer.
Definition: strbuf.hxx:534
OStringBuffer(T &value, typename libreoffice_internal::NonConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
Definition: strbuf.hxx:152
Definition: stringutils.hxx:267
OStringBuffer & insert(sal_Int32 offset, sal_Char c)
Inserts the string representation of the char argument into this string buffer.
Definition: strbuf.hxx:869
OStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: strbuf.hxx:822
OStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters...
Definition: strbuf.hxx:68
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: strbuf.hxx:384
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition: strbuf.hxx:361
SAL_DLLPUBLIC void rtl_stringbuffer_remove(rtl_String **This, sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
OStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: strbuf.hxx:591
SAL_DLLPUBLIC void rtl_stringbuffer_newFromStr_WithLength(rtl_String **newStr, const sal_Char *value, sal_Int32 count)
Allocates a new String that contains characters from the character array argument.
unsigned char sal_Bool
Definition: types.h:48
const sal_Char * getStr() const
Returns a pointer to the characters of this string.
Definition: string.hxx:430
OStringBuffer(const OStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition: strbuf.hxx:81
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfInt64(sal_Char *str, sal_Int64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of a long integer.
OStringBuffer(const sal_Char *value, sal_Int32 length)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition: strbuf.hxx:199
SAL_DLLPUBLIC void rtl_stringbuffer_insert(rtl_String **This, sal_Int32 *capacity, sal_Int32 offset, const sal_Char *str, sal_Int32 len)
Inserts the string representation of the char array argument into this string buffer.
Definition: stringutils.hxx:117
const sal_Char * getStr() const
Return a null terminated character array.
Definition: strbuf.hxx:439
sal_uInt16 sal_Unicode
Definition: types.h:155
OStringBuffer & insert(sal_Int32 offset, const OString &str)
Inserts the string into this string buffer.
Definition: strbuf.hxx:728
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfFloat(sal_Char *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
#define RTL_STR_MAX_VALUEOFBOOLEAN
Definition: string.h:585
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfDouble(sal_Char *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
OStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition: strbuf.hxx:669
SAL_DLLPUBLIC void rtl_string_release(rtl_String *str) SAL_THROW_EXTERN_C()
Decrement the reference count of a string.
A string buffer implements a mutable sequence of characters.
Definition: strbuf.hxx:61
OStringBuffer & 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: strbuf.hxx:892
OStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: strbuf.hxx:572
libreoffice_internal::NonConstCharArrayDetector< T, OStringBuffer & >::Type insert(sal_Int32 offset, T &str)
Definition: strbuf.hxx:757
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED(&quot;Don&#39;t use, it&#39;s evil.&quot;) void doit(int nPara);.
Definition: types.h:509
OStringBuffer insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: strbuf.hxx:939
SAL_DLLPUBLIC void rtl_string_new(rtl_String **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
OStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: strbuf.hxx:847
libreoffice_internal::ConstCharArrayDetector< T, OStringBuffer & >::Type append(T &literal)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: strbuf.hxx:509
sal_Int32 getLength() const
Returns the length of this string.
Definition: string.hxx:404
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfInt32(sal_Char *str, sal_Int32 i, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an integer.
OString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: strbuf.hxx:304
SAL_DLLPUBLIC sal_Int32 rtl_str_getLength(const sal_Char *str) SAL_THROW_EXTERN_C()
Return the length of a string.
OStringBuffer(const T &value, typename libreoffice_internal::CharPtrDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: strbuf.hxx:143
Definition: stringutils.hxx:115
OStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition: strbuf.hxx:652
OStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: strbuf.hxx:686
OStringBuffer & append(sal_Int32 i, sal_Int16 radix=10)
Appends the string representation of the sal_Int32 argument to this string buffer.
Definition: strbuf.hxx:634
SAL_DLLPUBLIC rtl_String * rtl_string_alloc(sal_Int32 nLen) SAL_THROW_EXTERN_C()
Allocate a new string containing space for a given number of characters.
libreoffice_internal::ConstCharArrayDetector< T, OStringBuffer & >::Type insert(sal_Int32 offset, T &literal)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: strbuf.hxx:768
#define RTL_STR_MAX_VALUEOFINT64
Definition: string.h:650
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: strbuf.hxx:345
#define RTL_STR_MAX_VALUEOFINT32
Definition: string.h:627
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: strbuf.hxx:317
char * appendUninitialized(sal_Int32 length)
Unsafe way to make space for a fixed amount of characters to be appended into this OStringBuffer...
Definition: strbuf.hxx:707
#define RTL_STR_MAX_VALUEOFFLOAT
Definition: string.h:692
This String class provide base functionality for C++ like 8-Bit character array handling.
Definition: string.hxx:90
OStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer. ...
Definition: strbuf.hxx:962