ObjFW  Diff

Differences From Artifact [2297e4dbb2]:

  • File src/OFZIPArchive.h — part of check-in [6527c97d03] at 2022-10-09 16:19:17 on branch trunk — OFZIPArchive: Make returned streams retain archive

    In order to not create a retain cycle, this changes the reference to the
    last returned stream to an unsafe unretained one that the stream itself
    needs to reset to nil in its dealloc.

    Since when closing a stream for writing the archive needs to be updated,
    the code for that was moved out of OFZIPArchive and into the stream
    writer, since it now has a reference to the archive anyway. (user: js, size: 6505) [annotate] [blame] [check-ins using]

To Artifact [f20f6f1fc0]:


93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
+ (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode;

/**
 * @brief Creates a URI for accessing a the specified file within the specified
 *	  ZIP archive.
 *
 * @param path The path of the file within the archive
 * @param archive The URI of the archive
 * @return A URI for accessing the specified file within the specified ZIP
 *	   archive
 */
+ (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive;

- (instancetype)init OF_UNAVAILABLE;

/**
 * @brief Initializes an already allocated OFZIPArchive object with the
 *	  specified stream.
 *







|



|







93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
+ (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode;

/**
 * @brief Creates a URI for accessing a the specified file within the specified
 *	  ZIP archive.
 *
 * @param path The path of the file within the archive
 * @param URI The URI of the archive
 * @return A URI for accessing the specified file within the specified ZIP
 *	   archive
 */
+ (OFURI *)URIForFilePath: (OFString *)path inArchiveWithURI: (OFURI *)URI;

- (instancetype)init OF_UNAVAILABLE;

/**
 * @brief Initializes an already allocated OFZIPArchive object with the
 *	  specified stream.
 *