+2005-07-18 Helge Hess <helge.hess@opengroupware.org>
+
+ * FdExt.subproj/NSNull+misc.m: added -isNotEmpty to all objects. Its
+ similiar to -isNotNull but also checks for strings composed of just
+ spaces (v4.5.162)
+
2005-07-11 Helge Hess <helge.hess@opengroupware.org>
* NGResourceLocator.m: added -description, added method
- (BOOL)isNotNull {
return NO;
}
+- (BOOL)isNotEmpty {
+ return NO;
+}
- (BOOL)isNull {
#if DEBUG
NSLog(@"WARNING(%s): called deprecated -isNull on NSNull (use -isNotNull) !",
@end /* NSNull(misc) */
+
@implementation NSObject(NSNullMisc)
- (BOOL)isNotNull {
return YES;
}
+- (BOOL)isNotEmpty {
+ return [self isNotNull];
+}
- (BOOL)isNull {
#if DEBUG
@end /* NSObject(NSNullMisc) */
+
+@implementation NSString(NSNullMisc)
+
+- (BOOL)isNotEmpty {
+ unsigned i, len;
+
+ if ((len = [self length]) == 0)
+ return NO;
+
+ for (i = 0; i < len; i++) {
+ if (!isspace([self characterAtIndex:i]))
+ return YES;
+ }
+
+ return NO;
+}
+
+@end /* NSString(NSNullMisc) */