Overview
Comment: | Add of-tar: URI handler |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
4f56311b577a02c87109d64b63164e36 |
User & Date: | js on 2022-10-04 21:49:33 |
Other Links: | manifest | tags |
Context
2022-10-04
| ||
22:12 | Add of-gzip: URI handler check-in: 2481bede45 user: js tags: trunk | |
21:49 | Add of-tar: URI handler check-in: 4f56311b57 user: js tags: trunk | |
21:33 | Add +[OFZIPArchive URIForFile:inArchive:] check-in: 19bbbbd95d user: js tags: trunk | |
Changes
Modified src/Makefile from [b0447ea34a] to [d59b367af0].
︙ | |||
200 201 202 203 204 205 206 207 208 209 210 211 212 213 | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | + | OFRangeCharacterSet.m \ OFRangeValue.m \ OFRectValue.m \ OFSandbox.m \ OFSizeValue.m \ OFStrPTime.m \ OFSubarray.m \ OFTarURIHandler.m \ OFUTF8String.m \ OFZIPURIHandler.m \ ${LIBBASES_M} \ ${RUNTIME_AUTORELEASE_M} \ ${RUNTIME_INSTANCE_M} \ ${UNICODE_M} SRCS_FILES += OFFileURIHandler.m |
︙ |
Modified src/OFTarArchive.h from [8804d5e5f3] to [748cfc3b0d].
︙ | |||
75 76 77 78 79 80 81 82 83 84 85 86 87 88 | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | + + + + + + + + + + + | * @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)archiveWithURI: (OFURI *)URI mode: (OFString *)mode; /** * @brief Creates a URI for accessing a the specified file within the specified * tar 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 Tar * archive */ + (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive; - (instancetype)init OF_UNAVAILABLE; /** * @brief Initializes an already allocated OFTarArchive object with the * specified stream. * * @param stream A stream from which the tar archive will be read. |
︙ |
Modified src/OFTarArchive.m from [859f5b3b09] to [0dbf94ce58].
︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | + | #import "OFTarArchive.h" #import "OFTarArchiveEntry.h" #import "OFTarArchiveEntry+Private.h" #import "OFDate.h" #import "OFSeekableStream.h" #import "OFStream.h" #import "OFURI.h" #import "OFURIHandler.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" #import "OFNotOpenException.h" #import "OFOutOfRangeException.h" #import "OFTruncatedDataException.h" |
︙ | |||
66 67 68 69 70 71 72 73 74 75 76 77 78 79 | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + + + + + + + + + + + + + + + + + + + + + + + + | return [[[self alloc] initWithStream: stream mode: mode] autorelease]; } + (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode { return [[[self alloc] initWithURI: URI mode: mode] autorelease]; } + (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive { OFMutableURI *URI = [OFMutableURI URI]; void *pool = objc_autoreleasePoolPush(); OFCharacterSet *characterSet = [OFCharacterSet of_URIPathAllowedCharacterSetWithoutExclamationMark]; OFString *archiveURI; path = [path stringByAddingPercentEncodingWithAllowedCharacters: characterSet]; archiveURI = [archive.string stringByAddingPercentEncodingWithAllowedCharacters: characterSet]; URI.scheme = @"of-tar"; URI.percentEncodedPath = [OFString stringWithFormat: @"%@!%@", archiveURI, path]; [URI makeImmutable]; objc_autoreleasePoolPop(pool); return URI; } - (instancetype)init { OF_INVALID_INIT_METHOD } - (instancetype)initWithStream: (OFStream *)stream mode: (OFString *)mode |
︙ |
Added src/OFTarURIHandler.h version [7411ddfdf4].
|
Added src/OFTarURIHandler.m version [b5232b0f3e].
|
Modified src/OFURIHandler.m from [d4501677af] to [98204d10fd].
︙ | |||
27 28 29 30 31 32 33 34 35 36 37 38 39 40 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | + | #import "OFEmbeddedURIHandler.h" #ifdef OF_HAVE_FILES # import "OFFileURIHandler.h" #endif #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_THREADS) # import "OFHTTPURIHandler.h" #endif #import "OFTarURIHandler.h" #import "OFZIPURIHandler.h" #import "OFUnsupportedProtocolException.h" static OFMutableDictionary OF_GENERIC(OFString *, OFURIHandler *) *handlers; #ifdef OF_HAVE_THREADS static OFMutex *mutex; |
︙ | |||
65 66 67 68 69 70 71 72 73 74 75 76 77 78 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | + | #ifdef OF_HAVE_FILES [self registerClass: [OFFileURIHandler class] forScheme: @"file"]; #endif #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_THREADS) [self registerClass: [OFHTTPURIHandler class] forScheme: @"http"]; [self registerClass: [OFHTTPURIHandler class] forScheme: @"https"]; #endif [self registerClass: [OFTarURIHandler class] forScheme: @"of-tar"]; [self registerClass: [OFZIPURIHandler class] forScheme: @"of-zip"]; } + (bool)registerClass: (Class)class forScheme: (OFString *)scheme { #ifdef OF_HAVE_THREADS [mutex lock]; |
︙ |