From 712b81db5778de7113aab9809a66125b7ee8160a Mon Sep 17 00:00:00 2001 From: Andrew McCallum Date: Tue, 16 Apr 1996 02:50:42 +0000 Subject: [PATCH] ([KeyEnumerator -initWithCollection:]): New method. ([KeyEnumerator -nextObject]): New method. ([KeyEnumerator -dealloc]): New method. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1369 72102866-910b-0410-8b05-ffd578937521 --- Source/KeyedCollection.m | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Source/KeyedCollection.m b/Source/KeyedCollection.m index cf5888360..933290861 100644 --- a/Source/KeyedCollection.m +++ b/Source/KeyedCollection.m @@ -30,7 +30,25 @@ @implementation KeyEnumerator -/* xxx What should be here? */ +- initWithCollection: coll +{ + collection = [coll retain]; + enum_state = [coll newEnumState]; + return self; +} + +- nextObject +{ + id k; + [collection nextObjectAndKey: &k withEnumState: &enum_state]; + return k; +} + +- (void) dealloc +{ + [collection freeEnumState: &enum_state]; + [collection release]; +} @end