Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -153,10 +153,11 @@ /** * @brief Creates a new OFArray with the specified object. * * @param object An object * @return A new autoreleased OFArray + * @throw OFInvalidArgumentException The provided object was `nil` */ + (instancetype)arrayWithObject: (ObjectType)object; /** * @brief Creates a new OFArray with the specified objects, terminated by `nil`. @@ -188,10 +189,11 @@ /** * @brief Initializes an OFArray with the specified object. * * @param object An object * @return An initialized OFArray + * @throw OFInvalidArgumentException The provided object was `nil` */ - (instancetype)initWithObject: (ObjectType)object; /** * @brief Initializes an OFArray with the specified objects. @@ -279,10 +281,11 @@ /** * @brief Copies the objects at the specified range to the specified buffer. * * @param buffer The buffer to copy the objects to * @param range The range to copy + * @throw OFOutOfRangeException The provided range is out of bounds */ - (void)getObjects: (ObjectType __unsafe_unretained _Nonnull *_Nonnull)buffer inRange: (OFRange)range; /** @@ -327,27 +330,30 @@ /** * @brief Returns the objects in the specified range as a new OFArray. * * @param range The range for the subarray * @return The subarray as a new autoreleased OFArray + * @throw OFOutOfRangeException The provided range is out of bounds */ - (OFArray OF_GENERIC(ObjectType) *)objectsInRange: (OFRange)range; /** * @brief Creates a string by joining all objects of the array. * * @param separator The string with which the objects should be joined * @return A string containing all objects joined by the separator + * @throw OFInvalidArgumentException The provided separator is `nil` */ - (OFString *)componentsJoinedByString: (OFString *)separator; /** * @brief Creates a string by joining all objects of the array. * * @param separator The string with which the objects should be joined * @param options Options according to which the objects should be joined * @return A string containing all objects joined by the separator + * @throw OFInvalidArgumentException The provided separator is `nil` */ - (OFString *)componentsJoinedByString: (OFString *)separator options: (OFArrayJoinOptions)options; /** @@ -355,10 +361,12 @@ * and joining the strings returned by calling the selector. * * @param separator The string with which the objects should be joined * @param selector The selector to perform on the objects * @return A string containing all objects joined by the separator + * @throw OFInvalidArgumentException The provided separator is `nil` or calling + * the provided selector returned `nil` */ - (OFString *)componentsJoinedByString: (OFString *)separator usingSelector: (SEL)selector; /** @@ -367,10 +375,12 @@ * * @param separator The string with which the objects should be joined * @param selector The selector to perform on the objects * @param options Options according to which the objects should be joined * @return A string containing all objects joined by the separator + * @throw OFInvalidArgumentException The provided separator is `nil` or calling + * the provided selector returned `nil` */ - (OFString *)componentsJoinedByString: (OFString *)separator usingSelector: (SEL)selector options: (OFArrayJoinOptions)options; @@ -422,18 +432,20 @@ /** * @brief Creates a new array with the specified object added. * * @param object The object to add * @return A new array with the specified object added + * @throw OFInvalidArgumentException The specified object was `nil` */ - (OFArray OF_GENERIC(ObjectType) *)arrayByAddingObject: (ObjectType)object; /** * @brief Creates a new array with the objects from the specified array added. * * @param array The array with objects to add * @return A new array with the objects from the specified array added + * @throw OFInvalidArgumentException The specified array was `nil` */ - (OFArray OF_GENERIC(ObjectType) *)arrayByAddingObjectsFromArray: (OFArray OF_GENERIC(ObjectType) *)array; #ifdef OF_HAVE_BLOCKS Index: src/OFEnumerator.h ================================================================== --- src/OFEnumerator.h +++ src/OFEnumerator.h @@ -80,10 +80,11 @@ * @param state Context information for the enumeration * @param objects A pointer to an array where to put the objects * @param count The number of objects that can be stored at objects * @return The number of objects returned in objects or 0 when the enumeration * finished. + * @throw OFOutOfRangeException The object is too big for fast enumeration */ - (int)countByEnumeratingWithState: (OFFastEnumerationState *)state objects: (id __unsafe_unretained _Nonnull *_Nonnull) objects count: (int)count; Index: src/OFMessagePackRepresentation.h ================================================================== --- src/OFMessagePackRepresentation.h +++ src/OFMessagePackRepresentation.h @@ -27,10 +27,13 @@ * MessagePack representation. */ @protocol OFMessagePackRepresentation /** * @brief The MessagePack representation of the object as OFData. + * + * @throw OFOutOfRangeException The object is too big for a MessagePack + * representation */ @property (readonly, nonatomic) OFData *messagePackRepresentation; @end OF_ASSUME_NONNULL_END Index: src/OFSerialization.h ================================================================== --- src/OFSerialization.h +++ src/OFSerialization.h @@ -34,10 +34,12 @@ /** * @brief Initializes the object with the specified XML element serialization. * * @param element An OFXMLElement with the serialized object * @return An initialized object + * @throw OFInvalidArgumentException The specified element is not valid + * serialization */ - (instancetype)initWithSerialization: (OFXMLElement *)element; @end #ifdef __cplusplus