From 595ba03fd4769c069bbe0431ab878956ef1c37ad Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 2 Oct 2012 18:39:30 +0100 Subject: update string copy semantics to be undefined in a non-crashing way. Change-Id: I03bb4db5931932280e368012cbaee6bef2854dd6 --- sal/inc/rtl/ustring.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sal/inc/rtl/ustring.h') diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h index 5b4982ec1461..231dcdce253a 100644 --- a/sal/inc/rtl/ustring.h +++ b/sal/inc/rtl/ustring.h @@ -1226,6 +1226,23 @@ SAL_DLLPUBLIC void SAL_CALL rtl_uString_newFromStr( SAL_DLLPUBLIC void SAL_CALL rtl_uString_newFromStr_WithLength( rtl_uString ** newStr, const sal_Unicode * value, sal_Int32 len ) SAL_THROW_EXTERN_C(); +/** Allocate a new string that is a substring of this string. + + The substring begins at the specified beginIndex and contains count + characters. Meaningless combinations such as negative beginIndex, + or beginIndex + count greater than the length of the string have + undefined behaviour. + + @param beginIndex the beginning index, inclusive. + @param count the number of characters. + @return the specified substring. + + @since LibreOffice 3.7 + */ +SAL_DLLPUBLIC void SAL_CALL rtl_uString_newFromSubString( + rtl_uString ** newStr, const rtl_uString * from, + sal_Int32 beginIndex, sal_Int32 count ) SAL_THROW_EXTERN_C(); + /** Allocate a new string that contains a copy of a character array. If the length of value is greater than zero, the reference count of the -- cgit