summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-22 22:36:47 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-23 09:09:04 +0100
commit840e583e427bdfdbc5ac9c0da9628bee1d0090e2 (patch)
tree9ed622694e39ec4ed3492861c21f7c6f0ef155ed
parent744b423aec0dc00ea3b1fbfacc79e72697e903af (diff)
add an OString::equalsL equivalent to OUString::equalsAsciiL
-rw-r--r--sal/inc/rtl/string.hxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 186b515ca..ba66e0958 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