From acfe40223bd5f328ba657236392698aee59a6462 Mon Sep 17 00:00:00 2001 From: Muthu Subramanian Date: Tue, 18 Feb 2014 12:49:05 +0530 Subject: String cleanups. Change-Id: Ia4a9630822678a7b9ea6e5af87e58cfd0ebacff3 --- sal/inc/rtl/string.hxx | 2 ++ sal/inc/rtl/ustring.hxx | 15 +++++++++++++++ sal/util/sal.map | 7 ++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 4b7b072cb398..e9a9342ef4fa 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -872,6 +872,8 @@ public: @return a hash code value of the string data @see hashCode() for simple hashes + + @since LibreOffice 4.3 */ sal_uInt64 hashCode64() const SAL_THROW(()) { diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index 36295116dbe9..1f75101f08d7 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -1167,6 +1167,21 @@ public: return !string.equalsAsciiL( literal, internal::ConstCharArrayDetector< T, void >::size - 1 ); } + /** + Returns a 64bit hash of the string data. + This hashes the entire data, while hashCode would do sampling for larger string sizes. + + @return a hash code value of the string data + + @see hashCode() for simple hashes + + @since LibreOffice 4.3 + */ + sal_uInt64 hashCode64() const SAL_THROW(()) + { + return rtl_ustr_hashCode64_WithLength( pData->buffer, pData->length ); + } + /** Returns a hashcode for this string. diff --git a/sal/util/sal.map b/sal/util/sal.map index 83d824c7f513..7ab421fd089b 100644 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -221,7 +221,6 @@ UDK_3_0_0 { rtl_str_shortenedCompareIgnoreAsciiCase_WithLength; rtl_str_hashCode; rtl_str_hashCode_WithLength; - rtl_str_hashCode64_WithLength; rtl_str_indexOfChar; rtl_str_indexOfChar_WithLength; rtl_str_indexOfStr; @@ -653,6 +652,12 @@ LIBO_UDK_4.0 { # symbols available in >= LibO 4.0 rtl_uString_newReplaceAllFromIndex; } LIBO_UDK_3.6; +LIBO_UDK_4.3 { #symbols available in >= LibO 4.3 + global: + rtl_str_hashCode64_WithLength; + rtl_ustr_hashCode64_WithLength; +} LIBO_UDK_4.2; + PRIVATE_1.0 { global: osl_detail_ObjectRegistry_storeAddresses; -- cgit