From 72f268d32483cfc953e60cc458d8a99a2ee14939 Mon Sep 17 00:00:00 2001 From: helge Date: Thu, 13 Oct 2005 13:37:55 +0000 Subject: [PATCH] added -isNotEmpty methods git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1165 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-gdl1/GDLAccess/ChangeLog | 5 +++++ sope-gdl1/GDLAccess/EOArrayProxy.m | 4 ++++ sope-gdl1/GDLAccess/EOExpressionArray.m | 3 +++ sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m | 6 ++++++ sope-gdl1/GDLAccess/EORecordDictionary.m | 10 +++++++--- sope-gdl1/GDLAccess/Version | 2 +- 6 files changed, 26 insertions(+), 4 deletions(-) diff --git a/sope-gdl1/GDLAccess/ChangeLog b/sope-gdl1/GDLAccess/ChangeLog index 0221c714..c52ff18e 100644 --- a/sope-gdl1/GDLAccess/ChangeLog +++ b/sope-gdl1/GDLAccess/ChangeLog @@ -1,3 +1,8 @@ +2005-10-13 Helge Hess + + * EOArrayProxy.m, EOPrimaryKeyDictionary.m, EOExpressionArray.m, + EORecordDictionary.m: added -isNotEmpty methods (v4.5.55) + 2005-08-16 Helge Hess * GNUmakefile, GNUmakefile.preamble: added OSX framework compilation diff --git a/sope-gdl1/GDLAccess/EOArrayProxy.m b/sope-gdl1/GDLAccess/EOArrayProxy.m index 2a5eca96..e6705822 100644 --- a/sope-gdl1/GDLAccess/EOArrayProxy.m +++ b/sope-gdl1/GDLAccess/EOArrayProxy.m @@ -172,6 +172,10 @@ void _checkFetch(EOArrayProxy *self) { _checkFetch(self); return [self->content count]; } +- (BOOL)isNotEmpty { + _checkFetch(self); + return [self->content count] > 0 ? YES : NO; +} - (unsigned int)indexOfObjectIdenticalTo:(id)_object { _checkFetch(self); return [self->content indexOfObjectIdenticalTo:_object]; diff --git a/sope-gdl1/GDLAccess/EOExpressionArray.m b/sope-gdl1/GDLAccess/EOExpressionArray.m index 4f4f47ed..2961ba90 100644 --- a/sope-gdl1/GDLAccess/EOExpressionArray.m +++ b/sope-gdl1/GDLAccess/EOExpressionArray.m @@ -260,6 +260,9 @@ - (unsigned int)count { return [self->array count]; } +- (BOOL)isNotEmpty { + return [self->array count] > 0 ? YES : NO; +} - (NSEnumerator *)objectEnumerator { return [self->array objectEnumerator]; diff --git a/sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m b/sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m index 6d4fb36d..b27d967c 100644 --- a/sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m +++ b/sope-gdl1/GDLAccess/EOPrimaryKeyDictionary.m @@ -107,6 +107,9 @@ - (unsigned int)count { return 1; } +- (BOOL)isNotEmpty { + return YES; +} - (unsigned int)hash { return 1; @@ -263,6 +266,9 @@ - (unsigned int)count { return self->count; } +- (BOOL)isNotEmpty { + return self->count > 0 ? YES : NO; +} - (unsigned int)hash { return self->count; diff --git a/sope-gdl1/GDLAccess/EORecordDictionary.m b/sope-gdl1/GDLAccess/EORecordDictionary.m index 37b289e7..77e5acd9 100644 --- a/sope-gdl1/GDLAccess/EORecordDictionary.m +++ b/sope-gdl1/GDLAccess/EORecordDictionary.m @@ -189,10 +189,14 @@ static NSDictionary *emptyDict = nil; - (unsigned int)count { return self->count; } +- (BOOL)isNotEmpty { + return self->count > 0 ? YES : NO; +} + - (NSEnumerator *)keyEnumerator { - return AUTORELEASE([[_EORecordDictionaryKeyEnumerator alloc] - initWithDictionary:self - firstEntry:self->entries count:self->count]); + return [[[_EORecordDictionaryKeyEnumerator alloc] + initWithDictionary:self + firstEntry:self->entries count:self->count] autorelease]; } @end /* NSConcreteSmallDictionary */ diff --git a/sope-gdl1/GDLAccess/Version b/sope-gdl1/GDLAccess/Version index 5a9103fb..1e1b1b4f 100644 --- a/sope-gdl1/GDLAccess/Version +++ b/sope-gdl1/GDLAccess/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=54 +SUBMINOR_VERSION:=55 -- 2.39.5