LibreOffice
LibreOffice 7.1 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #pragma once
21 
22 #include "sal/config.h"
23 
24 #include <cassert>
25 #include <cstring>
26 
27 #include "rtl/strbuf.h"
28 #include "rtl/string.hxx"
29 #include "rtl/stringutils.hxx"
30 
31 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
32 #include "rtl/stringconcat.hxx"
33 #endif
34 
35 #ifdef RTL_STRING_UNITTEST
36 extern bool rtl_string_unittest_const_literal;
37 extern bool rtl_string_unittest_const_literal_function;
38 #endif
39 
40 // The unittest uses slightly different code to help check that the proper
41 // calls are made. The class is put into a different namespace to make
42 // sure the compiler generates a different (if generating also non-inline)
43 // copy of the function and does not merge them together. The class
44 // is "brought" into the proper rtl namespace by a typedef below.
45 #ifdef RTL_STRING_UNITTEST
46 #define rtl rtlunittest
47 #endif
48 
49 namespace rtl
50 {
51 
53 #ifdef RTL_STRING_UNITTEST
54 #undef rtl
55 // helper macro to make functions appear more readable
56 #define RTL_STRING_CONST_FUNCTION rtl_string_unittest_const_literal_function = true;
57 #else
58 #define RTL_STRING_CONST_FUNCTION
59 #endif
60 
65 {
66 public:
72  : pData(NULL)
73  , nCapacity( 16 )
74  {
75  rtl_string_new_WithLength( &pData, nCapacity );
76  }
77 
84  OStringBuffer( const OStringBuffer & value )
85  : pData(NULL)
86  , nCapacity( value.nCapacity )
87  {
89  }
90 
97  explicit OStringBuffer(int length)
98  : pData(NULL)
99  , nCapacity( length )
100  {
101  rtl_string_new_WithLength( &pData, length );
102  }
103 #if __cplusplus >= 201103L
104  explicit OStringBuffer(unsigned int length)
105  : OStringBuffer(static_cast<int>(length))
106  {
107  }
108 #if SAL_TYPES_SIZEOFLONG == 4
109  // additional overloads for sal_Int32 sal_uInt32
110  explicit OStringBuffer(long length)
111  : OStringBuffer(static_cast<int>(length))
112  {
113  }
114  explicit OStringBuffer(unsigned long length)
115  : OStringBuffer(static_cast<int>(length))
116  {
117  }
118 #endif
119  // avoid obvious bugs
120  explicit OStringBuffer(char) = delete;
121  explicit OStringBuffer(sal_Unicode) = delete;
122 #endif
123 
134  OStringBuffer(const OString& value)
135  : pData(NULL)
136  , nCapacity( value.getLength() + 16 )
137  {
138  rtl_stringbuffer_newFromStr_WithLength( &pData, value.getStr(), value.getLength() );
139  }
140 
145  template< typename T >
147  : pData(NULL)
148  {
149  sal_Int32 length = rtl_str_getLength( value );
150  nCapacity = length + 16;
151  rtl_stringbuffer_newFromStr_WithLength( &pData, value, length );
152  }
153 
154  template< typename T >
156  : pData(NULL)
157  {
158  sal_Int32 length = rtl_str_getLength( value );
159  nCapacity = length + 16;
160  rtl_stringbuffer_newFromStr_WithLength( &pData, value, length );
161  }
162 
174  template< typename T >
176  : pData(NULL)
177  , nCapacity( libreoffice_internal::ConstCharArrayDetector<T>::length + 16 )
178  {
179  assert(
182  &pData,
185 #ifdef RTL_STRING_UNITTEST
186  rtl_string_unittest_const_literal = true;
187 #endif
188  }
189 
202  OStringBuffer(const char * value, sal_Int32 length)
203  : pData(NULL)
204  , nCapacity( length + 16 )
205  {
206  rtl_stringbuffer_newFromStr_WithLength( &pData, value, length );
207  }
208 
209 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
210 
214  template< typename T1, typename T2 >
215  OStringBuffer( OStringConcat< T1, T2 >&& c )
216  {
217  const sal_Int32 l = c.length();
218  nCapacity = l + 16;
219  pData = rtl_string_alloc( nCapacity );
220  char* end = c.addData( pData->buffer );
221  *end = '\0';
222  pData->length = l;
223  }
224 
229  template< typename T >
230  OStringBuffer( OStringNumber< T >&& n )
231  : OStringBuffer( OString( n ))
232  {}
233 #endif
234 
237  OStringBuffer& operator = ( const OStringBuffer& value )
238  {
239  if (this != &value)
240  {
242  value.nCapacity,
243  value.pData);
244  nCapacity = value.nCapacity;
245  }
246  return *this;
247  }
248 
253  OStringBuffer & operator =(OString const & string) {
254  sal_Int32 n = string.getLength();
255  if (n >= nCapacity) {
256  ensureCapacity(n + 16); //TODO: check for overflow
257  }
258  std::memcpy(pData->buffer, string.pData->buffer, n + 1);
259  pData->length = n;
260  return *this;
261  }
262 
267  template<typename T>
268  typename
270  operator =(T & literal) {
271  assert(
273  sal_Int32 const n
275  if (n >= nCapacity) {
276  ensureCapacity(n + 16); //TODO: check for overflow
277  }
278  std::memcpy(
279  pData->buffer,
281  n + 1);
282  pData->length = n;
283  return *this;
284  }
285 
286 #if defined LIBO_INTERNAL_ONLY
287 
288  template<typename T1, typename T2>
289  OStringBuffer & operator =(OStringConcat<T1, T2> && concat) {
290  sal_Int32 const n = concat.length();
291  if (n >= nCapacity) {
292  ensureCapacity(n + 16); //TODO: check for overflow
293  }
294  *concat.addData(pData->buffer) = 0;
295  pData->length = n;
296  return *this;
297  }
298 
300  template<typename T>
301  OStringBuffer & operator =(OStringNumber<T> && n)
302  {
303  *this = OStringBuffer( std::move ( n ));
304  return *this;
305  }
306 #endif
307 
312  {
313  rtl_string_release( pData );
314  }
315 
325  {
326  OString aRet( pData );
327  rtl_string_new(&pData);
328  nCapacity = 0;
329  return aRet;
330  }
331 
337  sal_Int32 getLength() const
338  {
339  return pData->length;
340  }
341 
350  bool isEmpty() const
351  {
352  return pData->length == 0;
353  }
354 
365  sal_Int32 getCapacity() const
366  {
367  return nCapacity;
368  }
369 
381  void ensureCapacity(sal_Int32 minimumCapacity)
382  {
383  rtl_stringbuffer_ensureCapacity( &pData, &nCapacity, minimumCapacity );
384  }
385 
404  void setLength(sal_Int32 newLength)
405  {
406  assert(newLength >= 0);
407  // Avoid modifications if pData points to const empty string:
408  if( newLength != pData->length )
409  {
410  if( newLength > nCapacity )
411  rtl_stringbuffer_ensureCapacity(&pData, &nCapacity, newLength);
412  else
413  pData->buffer[newLength] = '\0';
414  pData->length = newLength;
415  }
416  }
417 
431  SAL_DEPRECATED("use rtl::OStringBuffer::operator [] instead")
432  char charAt( sal_Int32 index )
433  {
434  assert(index >= 0 && index < pData->length);
435  return pData->buffer[ index ];
436  }
437 
448  SAL_DEPRECATED("use rtl::OStringBuffer::operator [] instead")
449  OStringBuffer & setCharAt(sal_Int32 index, char ch)
450  {
451  assert(index >= 0 && index < pData->length);
452  pData->buffer[ index ] = ch;
453  return *this;
454  }
455 
459  const char* getStr() const SAL_RETURNS_NONNULL { return pData->buffer; }
460 
470  char & operator [](sal_Int32 index)
471  {
472  assert(index >= 0 && index < pData->length);
473  return pData->buffer[index];
474  }
475 
480  const OString toString() const
481  {
482  return OString(pData->buffer, pData->length);
483  }
484 
496  {
497  return append( str.getStr(), str.getLength() );
498  }
499 
511  template< typename T >
513  {
514  return append( str, rtl_str_getLength( str ) );
515  }
516 
517  template< typename T >
519  {
520  return append( str, rtl_str_getLength( str ) );
521  }
522 
528  template< typename T >
530  {
531  RTL_STRING_CONST_FUNCTION
532  assert(
534  return append(
537  }
538 
552  OStringBuffer & append( const char * str, sal_Int32 len)
553  {
554  assert( len == 0 || str != NULL ); // cannot assert that in rtl_stringbuffer_insert
555  rtl_stringbuffer_insert( &pData, &nCapacity, getLength(), str, len );
556  return *this;
557  }
558 
559 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
560 
564  template< typename T1, typename T2 >
565  OStringBuffer& append( OStringConcat< T1, T2 >&& c )
566  {
567  sal_Int32 l = c.length();
568  if( l == 0 )
569  return *this;
570  l += pData->length;
571  rtl_stringbuffer_ensureCapacity( &pData, &nCapacity, l );
572  char* end = c.addData( pData->buffer + pData->length );
573  *end = '\0';
574  pData->length = l;
575  return *this;
576  }
577 
582  template< typename T >
583  OStringBuffer& append( OStringNumber< T >&& c )
584  {
585  return append( c.buf, c.length );
586  }
587 
588 #endif
589 
602  {
604  return append( sz, rtl_str_valueOfBoolean( sz, b ) );
605  }
606 
621  {
623  return append( sz, rtl_str_valueOfBoolean( sz, b ) );
624  }
625 
627  // Pointer can be automatically converted to bool, which is unwanted here.
628  // Explicitly delete all pointer append() overloads to prevent this
629  // (except for char* overload, which is handled elsewhere).
630  template< typename T >
631  typename libreoffice_internal::Enable< void,
633  append( T* ) SAL_DELETED_FUNCTION;
635 
646  OStringBuffer & append(char c)
647  {
648  return append( &c, 1 );
649  }
650 
663  OStringBuffer & append(sal_Int32 i, sal_Int16 radix = 10 )
664  {
665  char sz[RTL_STR_MAX_VALUEOFINT32];
666  return append( sz, rtl_str_valueOfInt32( sz, i, radix ) );
667  }
668 
681  OStringBuffer & append(sal_Int64 l, sal_Int16 radix = 10 )
682  {
683  char sz[RTL_STR_MAX_VALUEOFINT64];
684  return append( sz, rtl_str_valueOfInt64( sz, l, radix ) );
685  }
686 
699  {
700  char sz[RTL_STR_MAX_VALUEOFFLOAT];
701  return append( sz, rtl_str_valueOfFloat( sz, f ) );
702  }
703 
715  OStringBuffer & append(double d)
716  {
717  char sz[RTL_STR_MAX_VALUEOFDOUBLE];
718  return append( sz, rtl_str_valueOfDouble( sz, d ) );
719  }
720 
736  char * appendUninitialized(sal_Int32 length) SAL_RETURNS_NONNULL {
737  sal_Int32 n = getLength();
738  rtl_stringbuffer_insert(&pData, &nCapacity, n, NULL, length);
739  return pData->buffer + n;
740  }
741 
757  OStringBuffer & insert(sal_Int32 offset, const OString & str)
758  {
759  return insert( offset, str.getStr(), str.getLength() );
760  }
761 
779  template< typename T >
781  {
782  return insert( offset, str, rtl_str_getLength( str ) );
783  }
784 
785  template< typename T >
787  {
788  return insert( offset, str, rtl_str_getLength( str ) );
789  }
790 
796  template< typename T >
798  {
799  RTL_STRING_CONST_FUNCTION
800  assert(
802  return insert(
803  offset,
806  }
807 
826  OStringBuffer & insert( sal_Int32 offset, const char * str, sal_Int32 len)
827  {
828  assert( len == 0 || str != NULL ); // cannot assert that in rtl_stringbuffer_insert
829  rtl_stringbuffer_insert( &pData, &nCapacity, offset, str, len );
830  return *this;
831  }
832 
850  OStringBuffer & insert(sal_Int32 offset, sal_Bool b)
851  {
853  return insert( offset, sz, rtl_str_valueOfBoolean( sz, b ) );
854  }
855 
875  OStringBuffer & insert(sal_Int32 offset, bool b)
876  {
878  return insert( offset, sz, rtl_str_valueOfBoolean( sz, b ) );
879  }
880 
897  OStringBuffer & insert(sal_Int32 offset, char c)
898  {
899  return insert( offset, &c, 1 );
900  }
901 
920  OStringBuffer & insert(sal_Int32 offset, sal_Int32 i, sal_Int16 radix = 10 )
921  {
922  char sz[RTL_STR_MAX_VALUEOFINT32];
923  return insert( offset, sz, rtl_str_valueOfInt32( sz, i, radix ) );
924  }
925 
944  OStringBuffer & insert(sal_Int32 offset, sal_Int64 l, sal_Int16 radix = 10 )
945  {
946  char sz[RTL_STR_MAX_VALUEOFINT64];
947  return insert( offset, sz, rtl_str_valueOfInt64( sz, l, radix ) );
948  }
949 
967  OStringBuffer insert(sal_Int32 offset, float f)
968  {
969  char sz[RTL_STR_MAX_VALUEOFFLOAT];
970  return insert( offset, sz, rtl_str_valueOfFloat( sz, f ) );
971  }
972 
990  OStringBuffer & insert(sal_Int32 offset, double d)
991  {
992  char sz[RTL_STR_MAX_VALUEOFDOUBLE];
993  return insert( offset, sz, rtl_str_valueOfDouble( sz, d ) );
994  }
995 
1008  OStringBuffer & remove( sal_Int32 start, sal_Int32 len )
1009  {
1010  rtl_stringbuffer_remove( &pData, start, len );
1011  return *this;
1012  }
1013 
1032  rtl_String *** pInternalData, sal_Int32 ** pInternalCapacity)
1033  {
1034  *pInternalData = &pData;
1035  *pInternalCapacity = &nCapacity;
1036  }
1037 
1038 private:
1042  rtl_String * pData;
1043 
1047  sal_Int32 nCapacity;
1048 };
1049 
1050 #if defined LIBO_INTERNAL_ONLY
1051 template<> struct ToStringHelper<OStringBuffer> {
1052  static std::size_t length(OStringBuffer const & s) { return s.getLength(); }
1053 
1054  static char * addData(char * buffer, OStringBuffer const & s) SAL_RETURNS_NONNULL
1055  { return addDataHelper(buffer, s.getStr(), s.getLength()); }
1056 
1057  static constexpr bool allowOStringConcat = true;
1058  static constexpr bool allowOUStringConcat = false;
1059 };
1060 #endif
1061 
1062 }
1063 
1064 #ifdef RTL_STRING_UNITTEST
1065 namespace rtl
1066 {
1067 typedef rtlunittest::OStringBuffer OStringBuffer;
1068 }
1069 #undef RTL_STRING_CONST_FUNCTION
1070 #endif
1071 
1072 #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
1073 using ::rtl::OStringBuffer;
1074 #endif
1075 
1076 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OStringBuffer & insert(sal_Int32 offset, char c)
Inserts the string representation of the char argument into this string buffer.
Definition: strbuf.hxx:897
bool isEmpty() const
Checks if a string buffer is empty.
Definition: strbuf.hxx:350
OStringBuffer & append(sal_Bool b)
Appends the string representation of the sal_Bool argument to the string buffer.
Definition: strbuf.hxx:601
OStringBuffer & insert(sal_Int32 offset, bool b)
Inserts the string representation of the bool argument into this string buffer.
Definition: strbuf.hxx:875
OStringBuffer insert(sal_Int32 offset, float f)
Inserts the string representation of the float argument into this string buffer.
Definition: strbuf.hxx:967
sal_Int32 getLength() const
Returns the length (character count) of this string buffer.
Definition: strbuf.hxx:337
libreoffice_internal::NonConstCharArrayDetector< T, OStringBuffer & >::Type append(T &str)
Definition: strbuf.hxx:518
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:920
SAL_DLLPUBLIC void rtl_string_new(rtl_String **newStr) SAL_THROW_EXTERN_C()
Allocate a new string containing no characters.
#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:445
A string buffer implements a mutable sequence of characters.
Definition: strbuf.hxx:64
libreoffice_internal::NonConstCharArrayDetector< T, OStringBuffer & >::Type insert(sal_Int32 offset, T &str)
Definition: strbuf.hxx:786
SAL_DLLPUBLIC void rtl_string_newFromLiteral(rtl_String **newStr, const char *value, sal_Int32 len, sal_Int32 allocExtra) SAL_THROW_EXTERN_C()
void ensureCapacity(sal_Int32 minimumCapacity)
Ensures that the capacity of the buffer is at least equal to the specified minimum.
Definition: strbuf.hxx:381
OStringBuffer & insert(sal_Int32 offset, double d)
Inserts the string representation of the double argument into this string buffer. ...
Definition: strbuf.hxx:990
OStringBuffer & append(float f)
Appends the string representation of the float argument to this string buffer.
Definition: strbuf.hxx:698
#define RTL_STR_MAX_VALUEOFDOUBLE
Definition: string.h:711
void setLength(sal_Int32 newLength)
Sets the length of this String buffer.
Definition: strbuf.hxx:404
#define RTL_STR_MAX_VALUEOFINT64
Definition: string.h:650
const char * getStr() const SAL_RETURNS_NONNULL
Returns a pointer to the characters of this string.
Definition: string.hxx:551
OStringBuffer & insert(sal_Int32 offset, sal_Bool b)
Inserts the string representation of the sal_Bool argument into this string buffer.
Definition: strbuf.hxx:850
Definition: stringutils.hxx:365
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:280
SAL_DLLPUBLIC void rtl_stringbuffer_insert(rtl_String **This, sal_Int32 *capacity, sal_Int32 offset, const char *str, sal_Int32 len)
Inserts the string representation of the char array argument into this string buffer.
OStringBuffer(const 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:202
OStringBuffer & insert(sal_Int32 offset, const char *str, sal_Int32 len)
Inserts the string representation of the char array argument into this string buffer.
Definition: strbuf.hxx:826
sal_Int32 getLength() const
Returns the length of this string.
Definition: string.hxx:525
This String class provide base functionality for C++ like 8-Bit character array handling.
Definition: string.hxx:170
rtl_stringbuffer_newFromStr_WithLength & pData
Definition: strbuf.hxx:151
SAL_DLLPUBLIC void rtl_stringbuffer_remove(rtl_String **This, sal_Int32 start, sal_Int32 len)
Removes the characters in a substring of this sequence.
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...
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:797
SAL_WARN_UNUSED_RESULT OString makeStringAndClear()
Fill the string data in the new string and clear the buffer.
Definition: strbuf.hxx:324
char * appendUninitialized(sal_Int32 length) SAL_RETURNS_NONNULL
Unsafe way to make space for a fixed amount of characters to be appended into this OStringBuffer...
Definition: strbuf.hxx:736
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfDouble(char *str, double d) SAL_THROW_EXTERN_C()
Create the string representation of a double.
OStringBuffer & append(const OString &str)
Appends the string to this string buffer.
Definition: strbuf.hxx:495
#define RTL_STR_MAX_VALUEOFBOOLEAN
Definition: string.h:585
OStringBuffer & append(const char *str, sal_Int32 len)
Appends the string representation of the char array argument to this string buffer.
Definition: strbuf.hxx:552
SAL_DLLPUBLIC void rtl_stringbuffer_newFromStr_WithLength(rtl_String **newStr, const char *value, sal_Int32 count)
Allocates a new String that contains characters from the character array argument.
Definition: stringutils.hxx:133
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.
const OString toString() const
Return an OString instance reflecting the current content of this OStringBuffer.
Definition: strbuf.hxx:480
unsigned char sal_Bool
Definition: types.h:34
OStringBuffer & append(double d)
Appends the string representation of the double argument to this string buffer.
Definition: strbuf.hxx:715
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:512
const char * getStr() const SAL_RETURNS_NONNULL
Return a null terminated character array.
Definition: strbuf.hxx:459
nCapacity
Definition: strbuf.hxx:150
OStringBuffer()
Constructs a string buffer with no characters in it and an initial capacity of 16 characters...
Definition: strbuf.hxx:71
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:780
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfInt32(char *str, sal_Int32 i, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of an integer.
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:529
~OStringBuffer()
Release the string data.
Definition: strbuf.hxx:311
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfFloat(char *str, float f) SAL_THROW_EXTERN_C()
Create the string representation of a float.
OStringBuffer & append(bool b)
Appends the string representation of the bool argument to the string buffer.
Definition: strbuf.hxx:620
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:374
OStringBuffer & append(sal_Int64 l, sal_Int16 radix=10)
Appends the string representation of the long argument to this string buffer.
Definition: strbuf.hxx:681
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfBoolean(char *str, sal_Bool b) SAL_THROW_EXTERN_C()
Create the string representation of a boolean.
sal_Int32 getCapacity() const
Returns the current capacity of the String buffer.
Definition: strbuf.hxx:365
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:558
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.
OStringBuffer(const OString &value)
Constructs a string buffer so that it represents the same sequence of characters as the string argume...
Definition: strbuf.hxx:134
Definition: stringutils.hxx:131
OStringBuffer & insert(sal_Int32 offset, const OString &str)
Inserts the string into this string buffer.
Definition: strbuf.hxx:757
OStringBuffer(const OStringBuffer &value)
Allocates a new string buffer that contains the same sequence of characters as the string buffer argu...
Definition: strbuf.hxx:84
void accessInternals(rtl_String ***pInternalData, sal_Int32 **pInternalCapacity)
Allows access to the internal data of this OStringBuffer, for effective manipulation.
Definition: strbuf.hxx:1031
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:663
#define RTL_STR_MAX_VALUEOFFLOAT
Definition: string.h:692
SAL_DLLPUBLIC sal_Int32 rtl_str_getLength(const char *str) SAL_THROW_EXTERN_C()
Return the length of a string.
SAL_DLLPUBLIC sal_Int32 rtl_str_valueOfInt64(char *str, sal_Int64 l, sal_Int16 radix) SAL_THROW_EXTERN_C()
Create the string representation of a long integer.
OStringBuffer(int length)
Constructs a string buffer with no characters in it and an initial capacity specified by the length a...
Definition: strbuf.hxx:97
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.
sal_uInt16 sal_Unicode
Definition: types.h:119
#define RTL_STR_MAX_VALUEOFINT32
Definition: string.h:627
SAL_DLLPUBLIC void rtl_string_release(rtl_String *str) SAL_THROW_EXTERN_C()
Decrement the reference count of a string.
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:944