summaryrefslogtreecommitdiff
path: root/sal/inc/rtl/strbuf.hxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-12-04 19:58:11 +0100
committerLuboš Luňák <l.lunak@suse.cz>2012-12-06 13:35:17 +0100
commit88c00598b2a0bae1bdfe88d4300afec2512183d8 (patch)
treec456c86afc1e712ecf93b7f96ab2417aa9e207ac /sal/inc/rtl/strbuf.hxx
parentb88a26f02276ec2e98287cd2e5f2abea1ea9e949 (diff)
support for fast string operator+ in operator+=/append
Not much point in building a string instance that will be copied elsewhere immediatelly. Change-Id: I38b7d3696f2c619e6424eb3959b00cd2c7738c47
Diffstat (limited to 'sal/inc/rtl/strbuf.hxx')
-rw-r--r--sal/inc/rtl/strbuf.hxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 77e588fe3cd3..286a862d032b 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -496,6 +496,25 @@ public:
return *this;
}
+#ifdef RTL_FAST_STRING
+ /**
+ @overload
+ @internal
+ */
+ template< typename T1, typename T2 >
+ OStringBuffer& append( const OStringConcat< T1, T2 >& c )
+ {
+ const int l = c.length();
+ if( l == 0 )
+ return *this;
+ rtl_stringbuffer_ensureCapacity( &pData, &nCapacity, pData->length + l );
+ char* end = c.addData( pData->buffer + pData->length );
+ *end = '\0';
+ pData->length = end - pData->buffer;
+ return *this;
+ }
+#endif
+
/**
Appends the string representation of the <code>sal_Bool</code>
argument to the string buffer.