@@ -18,10 +18,11 @@ @class OFDataArray; @class OFString; #ifdef OF_HAVE_BLOCKS typedef void (^of_array_enumeration_block_t)(id obj, size_t idx, BOOL *stop); +typedef BOOL (^of_array_filter_block_t)(id odj, size_t idx); #endif /** * \brief A class for storing objects in an array. */ @@ -203,10 +204,20 @@ * Executes a block for each object. * * \param block The block to execute for each object */ - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block; + +/** + * Returns a new array, only containing the objects for which the block returns + * YES. + * + * \param block A block which determines if the object should be in the new + * array + * \return A new, autoreleased OFArray + */ +- (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block; #endif @end @interface OFArrayEnumerator: OFEnumerator {