summaryrefslogtreecommitdiff
path: root/include/rtl/ustrbuf.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-11-20 07:44:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-11-20 08:34:06 +0100
commit186990395d72a803dd4a9f087fe4e05f49e69ad2 (patch)
tree44c28d013c85b708a418e6e6b5ce71907fde7285 /include/rtl/ustrbuf.hxx
parent8cbfce51ff659581a9602b22c36b9af1c69e51f8 (diff)
Clean up Mac _imp_getProcessLocale
Introduces OUStringBuffer::appendUninitialized. Change-Id: If225ec4d798e0df91cad60130e3f22ee26b88abb
Diffstat (limited to 'include/rtl/ustrbuf.hxx')
-rw-r--r--include/rtl/ustrbuf.hxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 64c26cff3424..8bba42921fbc 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -474,6 +474,7 @@ public:
OUStringBuffer & append( const sal_Unicode * str, sal_Int32 len)
{
assert( len >= 0 );
+ assert( len == 0 || str != 0 );
rtl_uStringbuffer_insert( &pData, &nCapacity, getLength(), str, len );
return *this;
}
@@ -734,6 +735,28 @@ public:
}
/**
+ Unsafe way to make space for a fixed amount of characters to be appended
+ into this OUStringBuffer.
+
+ A call to this function must immediately be followed by code that
+ completely fills the uninitialized block pointed to by the return value.
+
+ @param length the length of the uninitialized block of sal_Unicode
+ entities; must be non-negative
+
+ @return a pointer to the start of the uninitialized block; only valid
+ until this OUStringBuffer's capacity changes
+
+ @since LibreOffice 4.4
+ */
+ sal_Unicode * appendUninitialized(sal_Int32 length) {
+ assert(length >= 0);
+ sal_Int32 n = getLength();
+ rtl_uStringbuffer_insert(&pData, &nCapacity, n, 0, length);
+ return pData->buffer + n;
+ }
+
+ /**
Inserts the string into this string buffer.
The characters of the <code>String</code> argument are inserted, in
@@ -797,6 +820,7 @@ public:
{
assert( offset >= 0 && offset <= pData->length );
assert( len >= 0 );
+ assert( len == 0 || str != 0 );
rtl_uStringbuffer_insert( &pData, &nCapacity, offset, str, len );
return *this;
}