@@ -38,19 +38,19 @@ * * @param object The current object * @param stop A pointer to a variable that can be set to true to stop the * enumeration */ -typedef void (^of_set_enumeration_block_t)(id object, bool *stop); +typedef void (^OFSetEnumerationBlock)(id object, bool *stop); /** * @brief A block for filtering an OFSet. * * @param object The object to inspect * @return Whether the object should be in the filtered set */ -typedef bool (^of_set_filter_block_t)(id object); +typedef bool (^OFSetFilterBlock)(id object); #endif /** * @class OFSet OFSet.h ObjFW/OFSet.h * @@ -161,10 +161,17 @@ * @return An initialized set with the specified object and va_list */ - (instancetype)initWithObject: (ObjectType)firstObject arguments: (va_list)arguments; +/** + * @brief Returns an OFEnumerator to enumerate through all objects of the set. + * + * @return An OFEnumerator to enumerate through all objects of the set + */ +- (OFEnumerator OF_GENERIC(ObjectType) *)objectEnumerator; + /** * @brief Returns whether the receiver is a subset of the specified set. * * @return Whether the receiver is a subset of the specified set */ @@ -237,34 +244,33 @@ * @note A @ref OFNull value is translated to nil! * * @param value The value for the specified key * @param key The key of the value to set */ -- (void)setValue: (nullable id)value - forKey: (OFString *)key; +- (void)setValue: (nullable id)value forKey: (OFString *)key; #ifdef OF_HAVE_BLOCKS /** * @brief Executes a block for each object in the set. * * @param block The block to execute for each object in the set */ -- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block; +- (void)enumerateObjectsUsingBlock: (OFSetEnumerationBlock)block; /** * @brief Creates a new set, only containing the objects for which the block * returns true. * * @param block A block which determines if the object should be in the new set * @return A new, autoreleased OFSet */ -- (OFSet OF_GENERIC(ObjectType) *)filteredSetUsingBlock: - (of_set_filter_block_t)block; +- (OFSet OF_GENERIC(ObjectType) *) + filteredSetUsingBlock: (OFSetFilterBlock)block; #endif #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType #endif @end OF_ASSUME_NONNULL_END #import "OFMutableSet.h"