@@ -20,11 +20,11 @@ /*! @file */ OF_ASSUME_NONNULL_BEGIN @class OFString; -@class OFURL; +@class OFURI; /** * @brief Options for searching in data. * * This is a bit mask. @@ -165,32 +165,36 @@ + (instancetype)dataWithContentsOfFile: (OFString *)path; #endif /** * @brief Creates a new OFData with an item size of 1, containing the data of - * the specified URL. + * the specified URI. * - * @param URL The URL to the contents for the OFData + * @param URI The URI to the contents for the OFData * @return A new autoreleased OFData */ -+ (instancetype)dataWithContentsOfURL: (OFURL *)URL; ++ (instancetype)dataWithContentsOfURI: (OFURI *)URI; /** * @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` @@ -264,32 +268,36 @@ - (instancetype)initWithContentsOfFile: (OFString *)path; #endif /** * @brief Initializes an already allocated OFData with an item size of 1, - * containing the data of the specified URL. + * containing the data of the specified URI. * - * @param URL The URL to the contents for the OFData + * @param URI The URI to the contents for the OFData * @return A new autoreleased OFData */ -- (instancetype)initWithContentsOfURL: (OFURL *)URL; +- (instancetype)initWithContentsOfURI: (OFURI *)URI; /** * @brief Initializes an already allocated 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)initWithStringRepresentation: (OFString *)string; /** * @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. @@ -336,18 +344,18 @@ */ - (void)writeToFile: (OFString *)path; #endif /** - * @brief Writes the OFData to the specified URL. + * @brief Writes the OFData to the specified URI. * - * @param URL The URL to write to + * @param URI The URI to write to */ -- (void)writeToURL: (OFURL *)URL; +- (void)writeToURI: (OFURI *)URI; @end OF_ASSUME_NONNULL_END #import "OFMutableData.h" #import "OFData+ASN1DERParsing.h" #import "OFData+CryptographicHashing.h" #import "OFData+MessagePackParsing.h"