20 #ifndef _RTL_STRBUF_HXX_
21 #define _RTL_STRBUF_HXX_
32 #ifdef RTL_FAST_STRING
43 #ifdef RTL_STRING_UNITTEST
44 #define rtl rtlunittest
50 #ifdef RTL_STRING_UNITTEST
53 #define RTL_STRING_CONST_FUNCTION rtl_string_unittest_const_literal_function = true;
55 #define RTL_STRING_CONST_FUNCTION
118 , nCapacity( value.nCapacity )
131 , nCapacity( length )
148 , nCapacity( value.getLength() + 16 )
157 template<
typename T >
162 nCapacity = length + 16;
166 template<
typename T >
171 nCapacity = length + 16;
186 template<
typename T >
189 , nCapacity( internal::ConstCharArrayDetector< T, void >::size - 1 + 16 )
193 #ifdef RTL_STRING_UNITTEST
194 rtl_string_unittest_const_literal =
true;
212 , nCapacity( length + 16 )
217 #ifdef RTL_FAST_STRING
222 template<
typename T1,
typename T2 >
225 const sal_Int32 l = c.length();
228 char* end = c.addData( pData->buffer );
230 pData->length = end - pData->buffer;
243 nCapacity = value.nCapacity;
279 return pData->length;
292 return pData->length == 0;
346 assert(newLength >= 0);
348 if( newLength != pData->length )
350 if( newLength > nCapacity )
353 pData->buffer[newLength] =
'\0';
354 pData->length = newLength;
374 assert(index >= 0 && index < pData->length);
375 return pData->buffer[ index ];
391 assert(index >= 0 && index < pData->length);
392 pData->buffer[ index ] = ch;
412 assert(index >= 0 && index < pData->length);
413 return pData->buffer[index];
422 return OString(pData->buffer, pData->length);
451 template<
typename T >
457 template<
typename T >
468 template<
typename T >
497 #ifdef RTL_FAST_STRING
502 template<
typename T1,
typename T2 >
505 const int l = c.length();
509 char* end = c.addData( pData->buffer + pData->length );
511 pData->length = end - pData->buffer;
545 return append( &c, 1 );
655 template<
typename T >
661 template<
typename T >
672 template<
typename T >
747 return insert( offset, &c, 1 );
862 #ifdef LIBO_INTERNAL_ONLY
865 #ifndef RTL_FAST_STRING
889 #ifdef RTL_FAST_STRING
894 struct ToStringHelper< OStringBuffer >
896 static int length(
const OStringBuffer& s ) {
return s.
getLength(); }
897 static char* addData(
char* buffer,
const OStringBuffer& s ) {
return addDataHelper( buffer, s.getStr(), s.getLength()); }
898 static const bool allowOStringConcat =
true;
899 static const bool allowOUStringConcat =
false;
906 #ifdef RTL_STRING_UNITTEST
909 typedef rtlunittest::OStringBuffer OStringBuffer;
911 #undef RTL_STRING_CONST_FUNCTION
915 using ::rtl::OStringBuffer;