summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-10-28 23:07:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-11-01 09:27:22 +0000
commit67cf9cbeebaa258cb790e71b559586fd3299017b (patch)
tree66acdcd2f133a937ed534798b98c58b1bf047c8a /sal
parent489272ce9e0d655a833fa7add2ed8cfb87349edb (diff)
add and use an OString::equalsIgnoreAsciiCaseAscii equivalent to OUString one
Diffstat (limited to 'sal')
-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 7555464c4674..23fee9d7674e 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -407,6 +407,30 @@ public:
Since this method is optimized for performance, the ASCII character
values are not converted in any way. The caller has to make sure that
all ASCII characters are in the allowed range between 0 and
+ 127. The ASCII string must be NULL-terminated.
+ This function can't be used for language specific comparison.
+
+ @param asciiStr the 8-Bit ASCII character string to be compared.
+ @return sal_True if the strings are equal;
+ sal_False, otherwise.
+ */
+ sal_Bool equalsIgnoreAsciiCaseAscii( const sal_Char * asciiStr ) const SAL_THROW(())
+ {
+ return rtl_str_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length,
+ asciiStr, rtl_str_getLength(asciiStr) ) == 0;
+ }
+
+ /**
+ Perform a ASCII lowercase comparison of two strings.
+
+ The result is true if and only if second string
+ represents the same sequence of characters as the first string,
+ ignoring the case.
+ Character values between 65 and 90 (ASCII A-Z) are interpreted as
+ values between 97 and 122 (ASCII a-z).
+ Since this method is optimized for performance, the ASCII character
+ values are not converted in any way. The caller has to make sure that
+ all ASCII characters are in the allowed range between 0 and
127. The ASCII string must be greater or equal in length as asciiStrLength.
This function can't be used for language specific comparison.