@@ -19,10 +19,11 @@ #import "OFTarArchiveEntry.h" OF_ASSUME_NONNULL_BEGIN @class OFStream; +@class OFURL; /** * @class OFTarArchive OFTarArchive.h ObjFW/OFTarArchive.h * * @brief A class for accessing and manipulating tar archives. @@ -65,22 +66,20 @@ * archive. * @return A new, autoreleased OFTarArchive */ + (instancetype)archiveWithStream: (OFStream *)stream mode: (OFString *)mode; -#ifdef OF_HAVE_FILES /** * @brief Creates a new OFTarArchive object with the specified file. * - * @param path The path to the tar archive + * @param URL The URL to the tar archive * @param mode The mode for the tar file. Valid modes are "r" for reading, * "w" for creating a new file and "a" for appending to an existing * archive. * @return A new, autoreleased OFTarArchive */ -+ (instancetype)archiveWithPath: (OFString *)path mode: (OFString *)mode; -#endif ++ (instancetype)archiveWithURL: (OFURL *)URL mode: (OFString *)mode; - (instancetype)init OF_UNAVAILABLE; /** * @brief Initializes an already allocated OFTarArchive object with the @@ -94,23 +93,21 @@ * @return An initialized OFTarArchive */ - (instancetype)initWithStream: (OFStream *)stream mode: (OFString *)mode OF_DESIGNATED_INITIALIZER; -#ifdef OF_HAVE_FILES /** * @brief Initializes an already allocated OFTarArchive object with the * specified file. * - * @param path The path to the tar archive + * @param URL The URL to the tar archive * @param mode The mode for the tar file. Valid modes are "r" for reading, * "w" for creating a new file and "a" for appending to an existing * archive. * @return An initialized OFTarArchive */ -- (instancetype)initWithPath: (OFString *)path mode: (OFString *)mode; -#endif +- (instancetype)initWithURL: (OFURL *)URL mode: (OFString *)mode; /** * @brief Returns the next entry from the tar archive or `nil` if all entries * have been read. *