00001 /* 00002 * Copyright (c) 2008 - 2009 00003 * Jonathan Schleifer <js@webkeks.org> 00004 * 00005 * All rights reserved. 00006 * 00007 * This file is part of ObjFW. It may be distributed under the terms of the 00008 * Q Public License 1.0, which can be found in the file LICENSE included in 00009 * the packaging of this file. 00010 */ 00011 00012 #import "OFObject.h" 00013 #import "OFList.h" 00014 #import "OFDictionary.h" 00015 00019 typedef struct __of_iterator_pair { 00021 id key; 00023 id object; 00024 } of_iterator_pair_t; 00025 00026 extern int _OFIterator_reference; 00027 00031 @interface OFIterator: OFObject 00032 { 00033 struct of_dictionary_bucket *data; 00034 size_t size; 00035 size_t pos; 00036 } 00037 00038 - initWithData: (struct of_dictionary_bucket*)data 00039 size: (size_t)size; 00040 00044 - (of_iterator_pair_t)nextKeyObjectPair; 00045 00049 - reset; 00050 @end 00051 00055 @interface OFDictionary (OFIterator) 00070 - (OFIterator*)iterator; 00071 @end