summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-11-27 07:00:04 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-11-27 23:00:05 -0600
commite55f0825c39c2d4f6991f40bcebadaef4f75337f (patch)
treeb5875128da3af9fc931cae1f82b3852ec3a1319c /sal
parentc33019b36d613f951787ce9836e34d74bfbd6a1b (diff)
OUString has a matchIgnoreAsciiCase but no compareTo version of it
Change-Id: Ie02dc3511e262a3b13df38ddbe0b3136f291ac9e
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/rtl/ustring.hxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 3930f9d4bbb8..aeb2b798bd67 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -525,6 +525,30 @@ public:
}
/**
+ Perform a ASCII lowercase comparison of two strings.
+
+ Compare teh two string with uppercase ASCII
+ character values between 65 and 90 (ASCII A-Z) are interpreted as
+ values between 97 and 122 (ASCII a-z).
+ This function can't be used for language specific comparison.
+
+ @param str the object to be compared.
+ @return 0 - if both strings are equal
+ < 0 - if this string is less than the string argument
+ > 0 - if this string is greater than the string argument
+ */
+ sal_Int32 compareToIgnoreAsciiCase( const OUString & str ) const SAL_THROW(())
+ {
+ if ( pData->length != str.pData->length )
+ return sal_False;
+ if ( pData == str.pData )
+ return sal_True;
+ return rtl_ustr_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length,
+ str.pData->buffer, str.pData->length );
+ }
+
+
+ /**
@overload
This function accepts an ASCII string literal as its argument.
@since LibreOffice 3.6