Index: src/OFData.h ================================================================== --- src/OFData.h +++ src/OFData.h @@ -178,19 +178,23 @@ * @brief Creates a new OFData with an item size of 1, containing the data of * the hex string representation. * * @param string The hex string representation of the data * @return A new autoreleased OFData + * @throw OFInvalidFormatException The specified string is not correctly + * formatted */ + (instancetype)dataWithStringRepresentation: (OFString *)string; /** * @brief Creates a new OFData with an item size of 1, containing the data of * the Base64-encoded string. * * @param string The string with the Base64-encoded data * @return A new autoreleased OFData + * @throw OFInvalidFormatException The specified string is not correctly + * formatted */ + (instancetype)dataWithBase64EncodedString: (OFString *)string; /** * @brief Initializes an already allocated OFData with the specified `count` @@ -288,10 +292,12 @@ * @brief Initializes an already allocated OFData with an item size of 1, * containing the data of the Base64-encoded string. * * @param string The string with the Base64-encoded data * @return An initialized OFData + * @throw OFInvalidFormatException The specified string is not correctly + * formatted */ - (instancetype)initWithBase64EncodedString: (OFString *)string; /** * @brief Compares the data to other data. Index: src/OFDatagramSocket.h ================================================================== --- src/OFDatagramSocket.h +++ src/OFDatagramSocket.h @@ -115,15 +115,19 @@ /** * @brief Whether the socket can block. * * By default, a socket can block. + * + * @throw OFSetOptionFailedException The option could not be set */ @property (nonatomic) bool canBlock; /** * @brief Whether the socket can send to broadcast addresses. + * + * @throw OFSetOptionFailedException The option could not be set */ @property (nonatomic) bool canSendToBroadcastAddresses; /** * @brief The delegate for asynchronous operations on the socket. @@ -149,10 +153,12 @@ * @param buffer The buffer to write the datagram to * @param length The length of the buffer * @param sender A pointer to an @ref OFSocketAddress, which will be set to the * address of the sender * @return The length of the received datagram + * @throw OFReadFailedException Receiving failed + * @throw OFNotOpenException The socket is not open */ - (size_t)receiveIntoBuffer: (void *)buffer length: (size_t)length sender: (OFSocketAddress *)sender; @@ -228,10 +234,12 @@ * * @param buffer The buffer to send as a datagram * @param length The length of the buffer * @param receiver A pointer to an @ref OFSocketAddress to which the datagram * should be sent + * @throw OFWriteFailedException Sending failed + * @throw OFNotOpenException The socket is not open */ - (void)sendBuffer: (const void *)buffer length: (size_t)length receiver: (const OFSocketAddress *)receiver; @@ -295,10 +303,12 @@ - (void)cancelAsyncRequests; /** * @brief Closes the socket so that it can neither receive nor send any more * datagrams. + * + * @throw OFNotOpenException The socket is not open */ - (void)close; @end OF_ASSUME_NONNULL_END Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -169,10 +169,11 @@ * %%t. * * @param string The string describing the date * @param format The format of the string describing the date * @return A new, autoreleased OFDate with the specified date and time + * @throw OFInvalidFormatException The specified format is invalid */ + (instancetype)dateWithDateString: (OFString *)string format: (OFString *)format; /** @@ -186,10 +187,11 @@ * %%t. * * @param string The string describing the date * @param format The format of the string describing the date * @return A new, autoreleased OFDate with the specified date and time + * @throw OFInvalidFormatException The specified format is invalid */ + (instancetype)dateWithLocalDateString: (OFString *)string format: (OFString *)format; /** @@ -243,10 +245,11 @@ * %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%, %%n and %%t. * * @param string The string describing the date * @param format The format of the string describing the date * @return An initialized OFDate with the specified date and time + * @throw OFInvalidFormatException The specified format is invalid */ - (instancetype)initWithDateString: (OFString *)string format: (OFString *)format; /** @@ -261,10 +264,11 @@ * %%d, %%e, %%H, %%m, %%M, %%S, %%y, %%Y, %%, %%n and %%t. * * @param string The string describing the date * @param format The format of the string describing the date * @return An initialized OFDate with the specified date and time + * @throw OFInvalidFormatException The specified format is invalid */ - (instancetype)initWithLocalDateString: (OFString *)string format: (OFString *)format; /** @@ -280,10 +284,11 @@ * * See the man page for `strftime` for information on the format. * * @param format The format for the date string * @return A new, autoreleased OFString + * @throw OFInvalidFormatException The specified format is invalid */ - (OFString *)dateStringWithFormat: (OFConstantString *)format; /** * @brief Creates a string of the local date with the specified format. @@ -290,10 +295,11 @@ * * See the man page for `strftime` for information on the format. * * @param format The format for the date string * @return A new, autoreleased OFString + * @throw OFInvalidFormatException The specified format is invalid */ - (OFString *)localDateStringWithFormat: (OFConstantString *)format; /** * @brief Returns the earlier of the two dates. Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -245,15 +245,15 @@ - (nullable id)valueForKey: (OFString *)key; /** * @brief Sets a value for a key. * - * This is equivalent to OFMutableDictionary#setObject:forKey:. If the - * dictionary is immutable, an @ref OFUndefinedKeyException is thrown. + * This is equivalent to OFMutableDictionary#setObject:forKey:. * * @param key The key to set * @param value The value to set the key to + * @throw OFUndefinedKeyException The dictionary is immutable */ - (void)setValue: (nullable id)value forKey: (OFString *)key; /** * @brief Checks whether the dictionary contains an object equal to the Index: src/OFURLHandler.h ================================================================== --- src/OFURLHandler.h +++ src/OFURLHandler.h @@ -79,10 +79,11 @@ * `a+` | Read-write, create or append * @n * The handler is allowed to not implement all modes and is also * allowed to implement additional, scheme-specific modes. * @return The opened stream if it was successfully opened + * @throw OFOpenItemFailedException Opening the item failed */ + (OFStream *)openItemAtURL: (OFURL *)URL mode: (OFString *)mode; - (instancetype)init OF_UNAVAILABLE; @@ -113,10 +114,11 @@ * `a+` | Read-write, create or append * @n * The handler is allowed to not implement all modes and is also * allowed to implement additional, scheme-specific modes. * @return The opened stream if it was successfully opened + * @throw OFOpenItemFailedException Opening the item failed */ - (OFStream *)openItemAtURL: (OFURL *)URL mode: (OFString *)mode; /** * @brief Returns the attributes for the item at the specified URL.