@@ -19,10 +19,11 @@ @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); +typedef id (^of_array_map_block_t)(id obj, size_t idx); #endif /** * \brief A class for storing objects in an array. */ @@ -205,10 +206,18 @@ * * \param block The block to execute for each object */ - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block; +/** + * Returns a new array, mapping each object using the specified block. + * + * \param block A block which maps an object for each object + * \return A new, autoreleased OFArray + */ +- (OFArray*)mappedArrayUsingBlock: (of_array_map_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