Index: src/OFCountedSet.h ================================================================== --- src/OFCountedSet.h +++ src/OFCountedSet.h @@ -56,15 +56,14 @@ #ifdef OF_HAVE_BLOCKS /** * @brief Executes a block for each object in the set. * * @param block The block to execute for each object in the set - * @throw OFEnumerationMutationException The set was mutated during enumeration */ - (void)enumerateObjectsAndCountUsingBlock: (OFCountedSetEnumerationBlock)block; #endif #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType #endif @end OF_ASSUME_NONNULL_END Index: src/OFEnumerator.h ================================================================== --- src/OFEnumerator.h +++ src/OFEnumerator.h @@ -111,15 +111,13 @@ /** * @brief Returns an array of all remaining objects in the collection. * * @return An array of all remaining objects in the collection. - * @throw OFEnumerationMutationException The object was mutated during - * enumeration */ - (OFArray OF_GENERIC(ObjectType) *)allObjects; #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType #endif @end OF_ASSUME_NONNULL_END Index: src/OFMethodSignature.h ================================================================== --- src/OFMethodSignature.h +++ src/OFMethodSignature.h @@ -51,19 +51,21 @@ /** * @brief Creates a new OFMethodSignature with the specified ObjC types. * * @param types The ObjC types of the method * @return A new, autoreleased OFMethodSignature + * @throw OFInvalidFormatException The type encoding is invalid */ + (instancetype)signatureWithObjCTypes: (const char *)types; /** * @brief Initializes an already allocated OFMethodSignature with the specified * ObjC types. * * @param types The ObjC types of the method * @return An Initialized OFMethodSignature + * @throw OFInvalidFormatException The type encoding is invalid */ - (instancetype)initWithObjCTypes: (const char *)types; /** * @brief Returns the ObjC type for the argument at the specified index. @@ -91,20 +93,22 @@ /** * @brief Returns the size for the specified type encoding. * * @param type The type encoding to return the size for * @return The size for the specified type encoding + * @throw OFInvalidFormatException The type encoding is invalid */ extern size_t OFSizeOfTypeEncoding(const char *type); /** * @brief Returns the alignment for the specified type encoding. * * @param type The type encoding to return the alignment for * @return The alignment for the specified type encoding + * @throw OFInvalidFormatException The type encoding is invalid */ extern size_t OFAlignmentOfTypeEncoding(const char *type); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END Index: src/OFMutableString.h ================================================================== --- src/OFMutableString.h +++ src/OFMutableString.h @@ -52,28 +52,34 @@ /** * @brief Appends a UTF-8 encoded C string to the OFMutableString. * * @param UTF8String A UTF-8 encoded C string to append + * @throw OFInvalidEncodingException The C string is not in not in the correct + * encoding */ - (void)appendUTF8String: (const char *)UTF8String; /** * @brief Appends a UTF-8 encoded C string with the specified length to the * OFMutableString. * * @param UTF8String A UTF-8 encoded C string to append * @param UTF8StringLength The length of the UTF-8 encoded C string + * @throw OFInvalidEncodingException The C string is not in not in the correct + * encoding */ - (void)appendUTF8String: (const char *)UTF8String length: (size_t)UTF8StringLength; /** * @brief Appends a C string with the specified encoding to the OFMutableString. * * @param cString A C string to append * @param encoding The encoding of the C string + * @throw OFInvalidEncodingException The C string is not in not in the correct + * encoding */ - (void)appendCString: (const char *)cString encoding: (OFStringEncoding)encoding; /** @@ -81,10 +87,12 @@ * OFMutableString. * * @param cString A C string to append * @param encoding The encoding of the C string * @param cStringLength The length of the UTF-8 encoded C string + * @throw OFInvalidEncodingException The C string is not in not in the correct + * encoding */ - (void)appendCString: (const char *)cString encoding: (OFStringEncoding)encoding length: (size_t)cStringLength; @@ -94,10 +102,13 @@ * See `printf` for the format syntax. As an addition, `%@` is available as * format specifier for objects, `%C` for `OFUnichar` and `%S` for * `const OFUnichar *`. * * @param format A format string which generates the string to append + * @throw OFInvalidFormatException The specified format is invalid + * @throw OFInvalidEncodingException The resulting string is not in not in UTF-8 + * encoding */ - (void)appendFormat: (OFConstantString *)format, ...; /** * @brief Appends a formatted string to the OFMutableString. @@ -106,10 +117,11 @@ * format specifier for objects, `%C` for `OFUnichar` and `%S` for * `const OFUnichar *`. * * @param format A format string which generates the string to append * @param arguments The arguments used in the format string + * @throw OFInvalidFormatException The specified format is invalid */ - (void)appendFormat: (OFConstantString *)format arguments: (va_list)arguments; /** * @brief Converts the string to uppercase. Index: src/OFMutableURL.h ================================================================== --- src/OFMutableURL.h +++ src/OFMutableURL.h @@ -35,10 +35,13 @@ /** * @brief The scheme part of the URL in URL-encoded form. * * Setting this retains the original URL-encoding used - if more characters * than necessary are URL-encoded, it is kept this way. + * + * @throw OFInvalidFormatException The scheme being set is not in the correct + * format */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *URLEncodedScheme; /** @@ -49,10 +52,13 @@ /** * @brief The host part of the URL in URL-encoded form. * * Setting this retains the original URL-encoding used - if more characters * than necessary are URL-encoded, it is kept this way. + * + * @throw OFInvalidFormatException The host being set is not in the correct + * format */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *URLEncodedHost; /** @@ -68,10 +74,13 @@ /** * @brief The user part of the URL in URL-encoded form. * * Setting this retains the original URL-encoding used - if more characters * than necessary are URL-encoded, it is kept this way. + * + * @throw OFInvalidFormatException The user being set is not in the correct + * format */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *URLEncodedUser; /** @@ -82,10 +91,13 @@ /** * @brief The password part of the URL in URL-encoded form. * * Setting this retains the original URL-encoding used - if more characters * than necessary are URL-encoded, it is kept this way. + * + * @throw OFInvalidFormatException The password being set is not in the correct + * format */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *URLEncodedPassword; /** @@ -96,18 +108,24 @@ /** * @brief The path part of the URL in URL-encoded form. * * Setting this retains the original URL-encoding used - if more characters * than necessary are URL-encoded, it is kept this way. + * + * @throw OFInvalidFormatException The path being set is not in the correct + * format */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *URLEncodedPath; /** * @brief The path of the URL split into components. * * The first component must always be empty to designate the root. + * + * @throw OFInvalidFormatException The path components being set are not in the + * correct format */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFArray OF_GENERIC(OFString *) *pathComponents; /** @@ -118,10 +136,13 @@ /** * @brief The query part of the URL in URL-encoded form. * * Setting this retains the original URL-encoding used - if more characters * than necessary are URL-encoded, it is kept this way. + * + * @throw OFInvalidFormatException The query being set is not in the correct + * format */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *URLEncodedQuery; /** @@ -132,10 +153,12 @@ * * @{ * @"key1": @"value1", * @"key2": @"value2" * } + * + * @throw OFInvalidFormatException The query is not in the correct format */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFDictionary OF_GENERIC(OFString *, OFString *) *queryDictionary; /** @@ -146,10 +169,13 @@ /** * @brief The fragment part of the URL in URL-encoded form. * * Setting this retains the original URL-encoding used - if more characters * than necessary are URL-encoded, it is kept this way. + * + * @throw OFInvalidFormatException The fragment being set is not in the correct + * format */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *URLEncodedFragment; /** Index: src/OFTLSStream.h ================================================================== --- src/OFTLSStream.h +++ src/OFTLSStream.h @@ -143,10 +143,11 @@ /** * @brief Performs the TLS client handshake for the specified host. * * @param host The host to perform the handshake with + * @throw OFTLSHandshakeFailedException The TLS handshake failed */ - (void)performClientHandshakeWithHost: (OFString *)host; @end #ifdef __cplusplus Index: src/OFURL.h ================================================================== --- src/OFURL.h +++ src/OFURL.h @@ -134,10 +134,12 @@ * * @{ * @"key1": @"value1", * @"key2": @"value2" * } + * + * @throw OFInvalidFormatException The query is not in the correct format */ @property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFDictionary OF_GENERIC(OFString *, OFString *) *queryDictionary; /** @@ -176,10 +178,12 @@ /** * @brief Creates a new URL with the specified string. * * @param string A string describing a URL * @return A new, autoreleased OFURL + * @throw OFInvalidFormatException The specified string is not a valid URL + * string */ + (instancetype)URLWithString: (OFString *)string; /** * @brief Creates a new URL with the specified string relative to the @@ -186,10 +190,12 @@ * specified URL. * * @param string A string describing a URL * @param URL An URL to which the string is relative * @return A new, autoreleased OFURL + * @throw OFInvalidFormatException The specified string is not a valid URL + * string */ + (instancetype)URLWithString: (OFString *)string relativeToURL: (OFURL *)URL; #ifdef OF_HAVE_FILES /** @@ -207,11 +213,11 @@ * @brief Creates a new URL with the specified local file path. * * @param path The local file path * @param isDirectory Whether the path is a directory, in which case a slash is * appened if there is no slash yet - * @return An Initialized OFURL + * @return An initialized OFURL */ + (instancetype)fileURLWithPath: (OFString *)path isDirectory: (bool)isDirectory; #endif @@ -218,10 +224,12 @@ /** * @brief Initializes an already allocated OFURL with the specified string. * * @param string A string describing a URL * @return An initialized OFURL + * @throw OFInvalidFormatException The specified string is not a valid URL + * string */ - (instancetype)initWithString: (OFString *)string; /** * @brief Initializes an already allocated OFURL with the specified string and @@ -228,10 +236,12 @@ * relative URL. * * @param string A string describing a URL * @param URL A URL to which the string is relative * @return An initialized OFURL + * @throw OFInvalidFormatException The specified string is not a valid URL + * string */ - (instancetype)initWithString: (OFString *)string relativeToURL: (OFURL *)URL; #ifdef OF_HAVE_FILES /** @@ -251,11 +261,11 @@ * path. * * @param path The local file path * @param isDirectory Whether the path is a directory, in which case a slash is * appened if there is no slash yet - * @return An Initialized OFURL + * @return An initialized OFURL */ - (instancetype)initFileURLWithPath: (OFString *)path isDirectory: (bool)isDirectory; #endif Index: src/OFUUID.h ================================================================== --- src/OFUUID.h +++ src/OFUUID.h @@ -54,10 +54,12 @@ /** * @brief Creates a new UUID with the specified UUID string. * * @param string The UUID string for the UUID * @return A new, autoreleased OFUUID + * @throw OFInvalidFormatException The specified string is not a valid UUID + * string */ + (instancetype)UUIDWithUUIDString: (OFString *)string; /** * @brief Initializes an already allocated OFUUID as a new random UUID as per @@ -79,10 +81,12 @@ * @brief Initializes an already allocated OFUUID with the specified UUID * string. * * @param string The UUID string to initialize the OFUUID with * @return An initialized OFUUID + * @throw OFInvalidFormatException The specified string is not a valid UUID + * string */ - (instancetype)initWithUUIDString: (OFString *)string; /** * @brief Compares the UUID to another UUID.