@@ -32,14 +32,13 @@ OF_ASSUME_NONNULL_BEGIN @class OFArray OF_GENERIC(ObjectType); #ifdef OF_HAVE_BLOCKS -typedef void (^of_dictionary_enumeration_block_t)(id key, id object, - bool *stop); -typedef bool (^of_dictionary_filter_block_t)(id key, id object); -typedef id _Nonnull (^of_dictionary_map_block_t)(id key, id object); +typedef void (^OFDictionaryEnumerationBlock)(id key, id object, bool *stop); +typedef bool (^OFDictionaryFilterBlock)(id key, id object); +typedef id _Nonnull (^OFDictionaryMapBlock)(id key, id object); #endif /** * @class OFDictionary OFDictionary.h ObjFW/OFDictionary.h * @@ -96,12 +95,11 @@ * * @param key The key * @param object The object * @return A new autoreleased OFDictionary */ -+ (instancetype)dictionaryWithObject: (ObjectType)object - forKey: (KeyType)key; ++ (instancetype)dictionaryWithObject: (ObjectType)object forKey: (KeyType)key; /** * @brief Creates a new OFDictionary with the specified keys and objects. * * @param keys An array of keys @@ -150,12 +148,11 @@ * * @param key The key * @param object The object * @return An initialized OFDictionary */ -- (instancetype)initWithObject: (ObjectType)object - forKey: (KeyType)key; +- (instancetype)initWithObject: (ObjectType)object forKey: (KeyType)key; /** * @brief Initializes an already allocated OFDictionary with the specified keys * and objects. * @@ -194,12 +191,11 @@ * * @param firstKey The first key * @param arguments A va_list of the other arguments * @return An initialized OFDictionary */ -- (instancetype)initWithKey: (KeyType)firstKey - arguments: (va_list)arguments; +- (instancetype)initWithKey: (KeyType)firstKey arguments: (va_list)arguments; /** * @brief Returns the object for the given key or `nil` if the key was not * found. * @@ -232,12 +228,11 @@ * dictionary is immutable, an @ref OFUndefinedKeyException is thrown. * * @param key The key to set * @param value The value to set the key to */ -- (void)setValue: (nullable id)value - forKey: (OFString *)key; +- (void)setValue: (nullable id)value forKey: (OFString *)key; /** * @brief Checks whether the dictionary contains an object equal to the * specified object. * @@ -274,33 +269,32 @@ /** * @brief Executes a block for each key / object pair. * * @param block The block to execute for each key / object pair. */ -- (void)enumerateKeysAndObjectsUsingBlock: - (of_dictionary_enumeration_block_t)block; +- (void)enumerateKeysAndObjectsUsingBlock: (OFDictionaryEnumerationBlock)block; /** * @brief Creates a new dictionary, mapping each object using the specified * block. * * @param block A block which maps an object for each object * @return A new autoreleased OFDictionary */ -- (OFDictionary OF_GENERIC(KeyType, id) *)mappedDictionaryUsingBlock: - (of_dictionary_map_block_t)block; +- (OFDictionary OF_GENERIC(KeyType, id) *) + mappedDictionaryUsingBlock: (OFDictionaryMapBlock)block; /** * @brief Creates a new dictionary, only containing the objects for which the * block returns true. * * @param block A block which determines if the object should be in the new * dictionary * @return A new autoreleased OFDictionary */ -- (OFDictionary OF_GENERIC(KeyType, ObjectType) *)filteredDictionaryUsingBlock: - (of_dictionary_filter_block_t)block; +- (OFDictionary OF_GENERIC(KeyType, ObjectType) *) + filteredDictionaryUsingBlock: (OFDictionaryFilterBlock)block; #endif #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef KeyType # undef ObjectType #endif