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 {