@@ -10,10 +10,11 @@ */ #include #import "OFObject.h" +#import "OFEnumerator.h" #import "OFFastEnumeration.h" @class OFArray; struct of_dictionary_bucket @@ -143,9 +144,38 @@ /** * \return The number of objects in the dictionary */ - (size_t)count; + +/** + * \returns An OFEnumerator to enumerate through the dictionary's objects + */ +- (OFEnumerator*)objectEnumerator; + +/** + * \return An OFEnumerator to enumerate through the dictionary's keys + */ +- (OFEnumerator*)keyEnumerator; +@end + +@interface OFDictionaryEnumerator: OFEnumerator +{ + struct of_dictionary_bucket *data; + size_t size; + unsigned long mutations; + unsigned long *mutations_ptr; + size_t pos; +} + +- initWithData: (struct of_dictionary_bucket*)data + size: (size_t)size + mutationsPointer: (unsigned long*)mutations_ptr; +@end + +@interface OFDictionaryObjectEnumerator: OFDictionaryEnumerator @end -#import "OFEnumerator.h" +@interface OFDictionaryKeyEnumerator: OFDictionaryEnumerator +@end + #import "OFMutableDictionary.h"