@@ -365,22 +365,22 @@ * string. * * @param UTF8String A UTF-8 encoded C string to initialize the OFString with * @return An initialized OFString */ -- initWithUTF8String: (const char *)UTF8String; +- (instancetype)initWithUTF8String: (const char *)UTF8String; /*! * @brief Initializes an already allocated OFString from a UTF-8 encoded C * string with the specified length. * * @param UTF8String A UTF-8 encoded C string to initialize the OFString with * @param UTF8StringLength The length of the UTF-8 encoded C string * @return An initialized OFString */ -- initWithUTF8String: (const char *)UTF8String - length: (size_t)UTF8StringLength; +- (instancetype)initWithUTF8String: (const char *)UTF8String + length: (size_t)UTF8StringLength; /*! * @brief Initializes an already allocated OFString from an UTF-8 encoded C * string without copying it, if possible. * @@ -389,23 +389,23 @@ * @param UTF8String A UTF-8 encoded C string to initialize the OFString with * @param freeWhenDone Whether to free the C string when it is not needed * anymore * @return An initialized OFString */ -- initWithUTF8StringNoCopy: (char *)UTF8String - freeWhenDone: (bool)freeWhenDone; +- (instancetype)initWithUTF8StringNoCopy: (char *)UTF8String + freeWhenDone: (bool)freeWhenDone; /*! * @brief Initializes an already allocated OFString from a C string with the * specified encoding. * * @param cString A C string to initialize the OFString with * @param encoding The encoding of the C string * @return An initialized OFString */ -- initWithCString: (const char *)cString - encoding: (of_string_encoding_t)encoding; +- (instancetype)initWithCString: (const char *)cString + encoding: (of_string_encoding_t)encoding; /*! * @brief Initializes an already allocated OFString from a C string with the * specified encoding and length. * @@ -412,73 +412,73 @@ * @param cString A C string to initialize the OFString with * @param encoding The encoding of the C string * @param cStringLength The length of the C string * @return An initialized OFString */ -- initWithCString: (const char *)cString - encoding: (of_string_encoding_t)encoding - length: (size_t)cStringLength; +- (instancetype)initWithCString: (const char *)cString + encoding: (of_string_encoding_t)encoding + length: (size_t)cStringLength; /*! * @brief Initializes an already allocated OFString from OFData with the * specified encoding. * * @param data OFData with the contents of the string * @param encoding The encoding in which the string is stored in the OFData * @return An initialized OFString */ -- initWithData: (OFData *)data - encoding: (of_string_encoding_t)encoding; +- (instancetype)initWithData: (OFData *)data + encoding: (of_string_encoding_t)encoding; /*! * @brief Initializes an already allocated OFString with another string. * * @param string A string to initialize the OFString with * @return An initialized OFString */ -- initWithString: (OFString *)string; +- (instancetype)initWithString: (OFString *)string; /*! * @brief Initializes an already allocated OFString with a Unicode string with * the specified length. * * @param characters An array of Unicode characters * @param length The length of the Unicode character array * @return An initialized OFString */ -- initWithCharacters: (const of_unichar_t *)characters - length: (size_t)length; +- (instancetype)initWithCharacters: (const of_unichar_t *)characters + length: (size_t)length; /*! * @brief Initializes an already allocated OFString with a UTF-16 string. * * @param string The UTF-16 string * @return An initialized OFString */ -- initWithUTF16String: (const char16_t *)string; +- (instancetype)initWithUTF16String: (const char16_t *)string; /*! * @brief Initializes an already allocated OFString with a UTF-16 string with * the specified length. * * @param string The UTF-16 string * @param length The length of the UTF-16 string * @return An initialized OFString */ -- initWithUTF16String: (const char16_t *)string - length: (size_t)length; +- (instancetype)initWithUTF16String: (const char16_t *)string + length: (size_t)length; /*! * @brief Initializes an already allocated OFString with a UTF-16 string, * assuming the specified byte order if no byte order mark is found. * * @param string The UTF-16 string * @param byteOrder The byte order to assume if there is no byte order mark * @return An initialized OFString */ -- initWithUTF16String: (const char16_t *)string - byteOrder: (of_byte_order_t)byteOrder; +- (instancetype)initWithUTF16String: (const char16_t *)string + byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a UTF-16 string with * the specified length, assuming the specified byte order if no byte * order mark is found. @@ -486,43 +486,43 @@ * @param string The UTF-16 string * @param length The length of the UTF-16 string * @param byteOrder The byte order to assume if there is no byte order mark * @return An initialized OFString */ -- initWithUTF16String: (const char16_t *)string - length: (size_t)length - byteOrder: (of_byte_order_t)byteOrder; +- (instancetype)initWithUTF16String: (const char16_t *)string + length: (size_t)length + byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a UTF-32 string. * * @param string The UTF-32 string * @return An initialized OFString */ -- initWithUTF32String: (const char32_t *)string; +- (instancetype)initWithUTF32String: (const char32_t *)string; /*! * @brief Initializes an already allocated OFString with a UTF-32 string with * the specified length * * @param string The UTF-32 string * @param length The length of the UTF-32 string * @return An initialized OFString */ -- initWithUTF32String: (const char32_t *)string - length: (size_t)length; +- (instancetype)initWithUTF32String: (const char32_t *)string + length: (size_t)length; /*! * @brief Initializes an already allocated OFString with a UTF-32 string, * assuming the specified byte order if no byte order mark is found. * * @param string The UTF-32 string * @param byteOrder The byte order to assume if there is no byte order mark * @return An initialized OFString */ -- initWithUTF32String: (const char32_t *)string - byteOrder: (of_byte_order_t)byteOrder; +- (instancetype)initWithUTF32String: (const char32_t *)string + byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a UTF-32 string with * the specified length, assuming the specified byte order if no byte * order mark is found. @@ -530,13 +530,13 @@ * @param string The UTF-32 string * @param length The length of the UTF-32 string * @param byteOrder The byte order to assume if there is no byte order mark * @return An initialized OFString */ -- initWithUTF32String: (const char32_t *)string - length: (size_t)length - byteOrder: (of_byte_order_t)byteOrder; +- (instancetype)initWithUTF32String: (const char32_t *)string + length: (size_t)length + byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a format string. * * See printf for the format syntax. As an addition, `%@` is available as @@ -544,11 +544,11 @@ * `const of_unichar_t *`. * * @param format A string used as format to initialize the OFString * @return An initialized OFString */ -- initWithFormat: (OFConstantString *)format, ...; +- (instancetype)initWithFormat: (OFConstantString *)format, ...; /*! * @brief Initializes an already allocated OFString with a format string. * * See printf for the format syntax. As an addition, `%@` is available as @@ -557,33 +557,33 @@ * * @param format A string used as format to initialize the OFString * @param arguments The arguments used in the format string * @return An initialized OFString */ -- initWithFormat: (OFConstantString *)format - arguments: (va_list)arguments; +- (instancetype)initWithFormat: (OFConstantString *)format + arguments: (va_list)arguments; #ifdef OF_HAVE_FILES /*! * @brief Initializes an already allocated OFString with the contents of the * specified file in the specified encoding. * * @param path The path to the file * @return An initialized OFString */ -- initWithContentsOfFile: (OFString *)path; +- (instancetype)initWithContentsOfFile: (OFString *)path; /*! * @brief Initializes an already allocated OFString with the contents of the * specified file in the specified encoding. * * @param path The path to the file * @param encoding The encoding of the file * @return An initialized OFString */ -- initWithContentsOfFile: (OFString *)path - encoding: (of_string_encoding_t)encoding; +- (instancetype)initWithContentsOfFile: (OFString *)path + encoding: (of_string_encoding_t)encoding; #endif #if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) /*! * @brief Initializes an already allocated OFString with the contents of the @@ -596,22 +596,22 @@ * UTF-8. * * @param URL The URL to the contents for the string * @return An initialized OFString */ -- initWithContentsOfURL: (OFURL *)URL; +- (instancetype)initWithContentsOfURL: (OFURL *)URL; /*! * @brief Initializes an already allocated OFString with the contents of the * specified URL in the specified encoding. * * @param URL The URL to the contents for the string * @param encoding The encoding to assume * @return An initialized OFString */ -- initWithContentsOfURL: (OFURL *)URL - encoding: (of_string_encoding_t)encoding; +- (instancetype)initWithContentsOfURL: (OFURL *)URL + encoding: (of_string_encoding_t)encoding; #endif /*! * @brief Writes the OFString into the specified C string with the specified * encoding.