From a7bbef355c4c2f0ed4a96086e85b495ae01ca45c Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 21 Aug 2008 19:17:38 +0000 Subject: [PATCH] Monotone-Parent: b5f2243baded9602acbf5acb8da41a1cc71e1a15 Monotone-Revision: 4b3afa6bee722f77839bced287a525495c0fe2e0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-21T19:17:38 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/SOGo/NSString+Utilities.h | 2 ++ SoObjects/SOGo/NSString+Utilities.m | 15 +++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index bc6a4b3d6..f54b542fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-21 Wolfgang Sourdeau + + * SoObjects/SOGo/NSString+Utilities.m ([NSString + -caseInsensitiveMatches:match]): new method that helps matching + strings against patterns. + 2008-08-21 Ludovic Marcotte * Updated the icons to use those from Thunderbird 2 diff --git a/SoObjects/SOGo/NSString+Utilities.h b/SoObjects/SOGo/NSString+Utilities.h index 548cb2947..543a4953e 100644 --- a/SoObjects/SOGo/NSString+Utilities.h +++ b/SoObjects/SOGo/NSString+Utilities.h @@ -51,6 +51,8 @@ - (NSRange) _rangeOfURLInRange: (NSRange) refRange; +- (BOOL) caseInsensitiveMatches: (NSString *) match; + #ifndef GNUSTEP_BASE_LIBRARY - (BOOL) boolValue; #endif diff --git a/SoObjects/SOGo/NSString+Utilities.m b/SoObjects/SOGo/NSString+Utilities.m index 06cfe3975..2f792e779 100644 --- a/SoObjects/SOGo/NSString+Utilities.m +++ b/SoObjects/SOGo/NSString+Utilities.m @@ -24,6 +24,8 @@ #import #import +#import + #import #import "NSArray+Utilities.h" @@ -322,6 +324,19 @@ static NSMutableCharacterSet *urlStartChars = nil; return subjectString; } +- (BOOL) caseInsensitiveMatches: (NSString *) match +{ + EOQualifier *sq; + NSString *format; + + format = [NSString stringWithFormat: + @"(description isCaseInsensitiveLike: '%@')", + match]; + sq = [EOQualifier qualifierWithQualifierFormat: format]; + + return [sq evaluateWithObject: self]; +} + #if LIB_FOUNDATION_LIBRARY - (BOOL) boolValue {