Overview
Comment: | Add of-gzip: URI handler |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
2481bede459ead0d58bed6c673c6b306 |
User & Date: | js on 2022-10-04 22:12:08 |
Other Links: | manifest | tags |
Context
2022-10-04
| ||
22:22 | OF*Archive: Share +[URIForFile:inArchive:] code check-in: 519c277156 user: js tags: trunk | |
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 | |
Changes
Modified src/Makefile from [d59b367af0] to [6f0c9c9452].
︙ | |||
180 181 182 183 184 185 186 187 188 189 190 191 192 193 | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | + | OFBase64.m \ OFBitSetCharacterSet.m \ OFBytesValue.m \ OFCRC16.m \ OFCRC32.m \ OFCountedMapTableSet.m \ OFEmbeddedURIHandler.m \ OFGZIPURIHandler.m \ OFHuffmanTree.m \ OFINIFileSettings.m \ OFInvertedCharacterSet.m \ OFLHADecompressingStream.m \ OFMapTableDictionary.m \ OFMapTableSet.m \ OFMutableAdjacentArray.m \ |
︙ |
Added src/OFGZIPURIHandler.h version [f833858668].
|
Added src/OFGZIPURIHandler.m version [96c40ab197].
|
Modified src/OFTarArchive.h from [748cfc3b0d] to [fceb35b7be].
︙ | |||
81 82 83 84 85 86 87 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | - + | /** * @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 |
︙ |
Modified src/OFTarURIHandler.m from [b5232b0f3e] to [6ffaae458d].
︙ | |||
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | + | #import "OFInvalidArgumentException.h" #import "OFOpenItemFailedException.h" @implementation OFTarURIHandler - (OFStream *)openItemAtURI: (OFURI *)URI mode: (OFString *)mode { void *pool = objc_autoreleasePoolPush(); OFString *percentEncodedPath, *archiveURI, *path; size_t pos; OFTarArchive *archive; OFTarArchiveEntry *entry; if (![URI.scheme isEqual: @"of-tar"] || URI.host != nil || URI.port != nil || URI.user != nil || URI.password != nil || |
︙ | |||
57 58 59 60 61 62 63 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - - - + + + + + + + + + + | OFMakeRange(pos + 1, percentEncodedPath.length - pos - 1)] .stringByRemovingPercentEncoding; archive = [OFTarArchive archiveWithURI: [OFURI URIWithString: archiveURI] mode: @"r"]; |
Modified src/OFURIHandler.m from [98204d10fd] to [cf412745fd].
︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | + | # import "OFMutex.h" #endif #import "OFEmbeddedURIHandler.h" #ifdef OF_HAVE_FILES # import "OFFileURIHandler.h" #endif #import "OFGZIPURIHandler.h" #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_THREADS) # import "OFHTTPURIHandler.h" #endif #import "OFTarURIHandler.h" #import "OFZIPURIHandler.h" #import "OFUnsupportedProtocolException.h" |
︙ | |||
62 63 64 65 66 67 68 69 70 71 72 73 74 75 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | + | #endif [self registerClass: [OFEmbeddedURIHandler class] forScheme: @"of-embedded"]; #ifdef OF_HAVE_FILES [self registerClass: [OFFileURIHandler class] forScheme: @"file"]; #endif [self registerClass: [OFGZIPURIHandler class] forScheme: @"of-gzip"]; #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"]; } |
︙ |
Modified src/OFZIPURIHandler.m from [ac757b6022] to [ed7da6bb04].
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | + + | #import "OFZIPArchive.h" #import "OFInvalidArgumentException.h" @implementation OFZIPURIHandler - (OFStream *)openItemAtURI: (OFURI *)URI mode: (OFString *)mode { void *pool = objc_autoreleasePoolPush(); OFString *percentEncodedPath, *archiveURI, *path; size_t pos; OFZIPArchive *archive; OFStream *stream; if (![URI.scheme isEqual: @"of-zip"] || URI.host != nil || URI.port != nil || URI.user != nil || URI.password != nil || URI.query != nil || URI.fragment != nil) @throw [OFInvalidArgumentException exception]; if (![mode isEqual: @"r"]) |
︙ | |||
52 53 54 55 56 57 58 59 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + - - + + + + + | path = [percentEncodedPath substringWithRange: OFMakeRange(pos + 1, percentEncodedPath.length - pos - 1)] .stringByRemovingPercentEncoding; archive = [OFZIPArchive archiveWithURI: [OFURI URIWithString: archiveURI] mode: @"r"]; stream = [archive streamForReadingFile: path]; [stream retain]; |