From: helge Date: Fri, 22 Jul 2005 11:05:38 +0000 (+0000) Subject: added -isException and -isExceptionOrNull methods X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7116e89c7d5e54fd9c21e48c7df2afb3097d0c55;p=sope added -isException and -isExceptionOrNull methods git-svn-id: http://svn.opengroupware.org/SOPE/trunk@931 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index 18376667..c811b782 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,9 @@ +2005-07-22 Helge Hess + + * FdExt.subproj/NSException+misc.m: added -isException and + -isExceptionOrNull methods to NSObject to check whether a given + object is an exception (v4.5.166) + 2005-07-20 Helge Hess * FdExt.subproj/NSNull+misc.m: fixed a stupid bug in -isNotEmpty diff --git a/sope-core/NGExtensions/FdExt.subproj/NSException+misc.m b/sope-core/NGExtensions/FdExt.subproj/NSException+misc.m index 28adb745..c06ff880 100644 --- a/sope-core/NGExtensions/FdExt.subproj/NSException+misc.m +++ b/sope-core/NGExtensions/FdExt.subproj/NSException+misc.m @@ -20,10 +20,40 @@ */ #include "NSException+misc.h" +#import #include "common.h" +@implementation NSObject(NSExceptionNGMiscellaneous) + +- (BOOL)isException { + return NO; +} +- (BOOL)isExceptionOrNull { + return NO; +} + +@end /* NSObject(NSExceptionNGMiscellaneous) */ + +@implementation NSNull(NSExceptionNGMiscellaneous) + +- (BOOL)isException { + return NO; +} +- (BOOL)isExceptionOrNull { + return YES; +} + +@end /* NSNull(NSExceptionNGMiscellaneous) */ + @implementation NSException(NGMiscellaneous) +- (BOOL)isException { + return YES; +} +- (BOOL)isExceptionOrNull { + return YES; +} + - (id)initWithReason:(NSString *)_reason { return [self initWithReason:_reason userInfo:nil]; } diff --git a/sope-core/NGExtensions/NGExtensions/NSException+misc.h b/sope-core/NGExtensions/NGExtensions/NSException+misc.h index af196367..edbad946 100644 --- a/sope-core/NGExtensions/NGExtensions/NSException+misc.h +++ b/sope-core/NGExtensions/NGExtensions/NSException+misc.h @@ -49,6 +49,11 @@ @end +@interface NSObject(NSExceptionNGMiscellaneous) +- (BOOL)isException; +- (BOOL)isExceptionOrNull; +@end + #if COCOA_Foundation_LIBRARY || GNUSTEP_BASE_LIBRARY @interface NSException (NGLibFoundationCompatibility) diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index b6a3393f..b4066c65 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=165 +SUBMINOR_VERSION:=166 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39