diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-12-05 00:37:01 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-12-06 13:35:18 +0100 |
commit | 81e16cea9a11185c209894973db8d1990fa9cce6 (patch) | |
tree | 6b784ddae1e873ba282ca1a961a8dc4a32f83e16 /comphelper/source | |
parent | f82a55ec476955d9d4467725a4ea3ce9e514d8dd (diff) |
mvoe rtl_(u)string_alloc to sal
No point in hidding something useful like this in some helper lib.
Change-Id: I7332d7f6bd428378cd19e7e95ad130771a541140
Diffstat (limited to 'comphelper/source')
-rw-r--r-- | comphelper/source/misc/string.cxx | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index 1dae9e8c203f..0674f9a7b065 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -377,43 +377,6 @@ bool isdigitAsciiString(const rtl::OUString &rString) namespace { - template <typename T, typename U> T* string_alloc(sal_Int32 nLen) - { - //Clearly this is somewhat cosy with the sal implmentation - - //rtl_[u]String contains U buffer[1], so an input of nLen - //allocates a buffer of nLen + 1 and we'll ensure a null termination - - T* newStr = - (sal::static_int_cast< sal_uInt32 >(nLen) - <= ((SAL_MAX_UINT32 - sizeof (T)) - / sizeof (U))) - ? (T*) rtl_allocateMemory( - sizeof (T) + nLen * sizeof (U)) - : NULL; - - if (!newStr) - throw std::bad_alloc(); - - newStr->refCount = 1; - newStr->length = nLen; - newStr->buffer[nLen] = 0; - return newStr; - } -} - -rtl_uString * SAL_CALL rtl_uString_alloc(sal_Int32 nLen) -{ - return string_alloc<rtl_uString, sal_Unicode>(nLen); -} - -rtl_String * SAL_CALL rtl_string_alloc(sal_Int32 nLen) -{ - return string_alloc<rtl_String, sal_Char>(nLen); -} - -namespace -{ template <typename T, typename O> T tmpl_reverseString(const T &rIn) { if (rIn.isEmpty()) |