[Libreoffice-commits] .: sal/inc
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Jun 23 01:09:47 PDT 2011
sal/inc/rtl/string.hxx | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
New commits:
commit 840e583e427bdfdbc5ac9c0da9628bee1d0090e2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 22 22:36:47 2011 +0100
add an OString::equalsL equivalent to OUString::equalsAsciiL
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 186b515..ba66e09 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -341,6 +341,30 @@ public:
}
/**
+ Perform a comparison of two strings.
+
+ The result is true if and only if second string
+ represents the same sequence of characters as the first string.
+ The ASCII string must be NULL-terminated and must be greater or
+ equal as length.
+ This function can't be used for language specific comparison.
+
+
+ @param value a character array.
+ @param length the length of the character array.
+ @return sal_True if the strings are equal;
+ sal_False, otherwise.
+ */
+ sal_Bool equalsL( const sal_Char* value, sal_Int32 length ) const SAL_THROW(())
+ {
+ if ( pData->length != length )
+ return sal_False;
+
+ return rtl_str_reverseCompare_WithLength( pData->buffer, pData->length,
+ value, length ) == 0;
+ }
+
+ /**
Perform a ASCII lowercase comparison of two strings.
The result is true if and only if second string
More information about the Libreoffice-commits
mailing list