Overview
Comment: | Rename schemes for archive IRI handlers back
The naming was confusing, as it is used to refer to a specific file in |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
34a3e817b3c62a865ed0bad595a80978 |
User & Date: | js on 2024-03-04 01:21:52 |
Other Links: | manifest | tags |
Context
2024-03-04
| ||
22:26 | OFArchiveIRIHandler: Use the rightmost `!` check-in: 334db394f3 user: js tags: trunk | |
01:21 | Rename schemes for archive IRI handlers back check-in: 34a3e817b3 user: js tags: trunk | |
01:07 | Fix -[OFGZIPStream isAtEndOfStream] check-in: 96f3ab8477 user: js tags: trunk | |
2024-03-03
| ||
19:42 | Rename schemes for archive IRI handlers check-in: 13f0321eff user: js tags: trunk | |
Changes
Modified src/OFArchiveIRIHandler.m from [504e6ffdaf] to [78d87309e9].
︙ | ︙ | |||
89 90 91 92 93 94 95 | archiveIRI = [OFIRI IRIWithString: [percentEncodedPath substringWithRange: OFMakeRange(0, pos)] .stringByRemovingPercentEncoding]; path = [percentEncodedPath substringWithRange: OFMakeRange(pos + 1, percentEncodedPath.length - pos - 1)] .stringByRemovingPercentEncoding; | | | | | | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | archiveIRI = [OFIRI IRIWithString: [percentEncodedPath substringWithRange: OFMakeRange(0, pos)] .stringByRemovingPercentEncoding]; path = [percentEncodedPath substringWithRange: OFMakeRange(pos + 1, percentEncodedPath.length - pos - 1)] .stringByRemovingPercentEncoding; if ([scheme isEqual: @"lha"]) { OFLHAArchive *archive = [OFLHAArchive archiveWithIRI: archiveIRI mode: mode]; OFLHAArchiveEntry *entry; while ((entry = [archive nextEntry]) != nil) { if ([entry.fileName isEqual: path]) { stream = [archive streamForReadingCurrentEntry]; goto end; } } @throw [OFOpenItemFailedException exceptionWithIRI: IRI mode: mode errNo: ENOENT]; } else if ([scheme isEqual: @"tar"]) { OFTarArchive *archive = [OFTarArchive archiveWithIRI: archiveIRI mode: mode]; OFTarArchiveEntry *entry; while ((entry = [archive nextEntry]) != nil) { if ([entry.fileName isEqual: path]) { stream = [archive streamForReadingCurrentEntry]; goto end; } } @throw [OFOpenItemFailedException exceptionWithIRI: IRI mode: mode errNo: ENOENT]; } else if ([scheme isEqual: @"zip"]) { OFZIPArchive *archive = [OFZIPArchive archiveWithIRI: archiveIRI mode: mode]; stream = [archive streamForReadingFile: path]; } else if ([scheme isEqual: @"zoo"]) { OFZooArchive *archive = [OFZooArchive archiveWithIRI: archiveIRI mode: mode]; OFZooArchiveEntry *entry; while ((entry = [archive nextEntry]) != nil) { if ([entry.fileName isEqual: path]) { stream = [archive streamForReadingCurrentEntry]; |
︙ | ︙ |
Modified src/OFIRIHandler.m from [43b582a6b5] to [16ea63c925].
︙ | ︙ | |||
66 67 68 69 70 71 72 | [self registerClass: [OFFileIRIHandler class] forScheme: @"file"]; #endif #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_THREADS) [self registerClass: [OFHTTPIRIHandler class] forScheme: @"http"]; [self registerClass: [OFHTTPIRIHandler class] forScheme: @"https"]; #endif [self registerClass: [OFArchiveIRIHandler class] forScheme: @"gzip"]; | | < | < | < | < | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | [self registerClass: [OFFileIRIHandler class] forScheme: @"file"]; #endif #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_THREADS) [self registerClass: [OFHTTPIRIHandler class] forScheme: @"http"]; [self registerClass: [OFHTTPIRIHandler class] forScheme: @"https"]; #endif [self registerClass: [OFArchiveIRIHandler class] forScheme: @"gzip"]; [self registerClass: [OFArchiveIRIHandler class] forScheme: @"lha"]; [self registerClass: [OFArchiveIRIHandler class] forScheme: @"tar"]; [self registerClass: [OFArchiveIRIHandler class] forScheme: @"zip"]; [self registerClass: [OFArchiveIRIHandler class] forScheme: @"zoo"]; } + (bool)registerClass: (Class)class forScheme: (OFString *)scheme { #ifdef OF_HAVE_THREADS [mutex lock]; @try { |
︙ | ︙ |
Modified src/OFLHAArchive.m from [1e418bf0dc] to [ddea1bb0a0].
︙ | ︙ | |||
93 94 95 96 97 98 99 | + (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode { return [[[self alloc] initWithIRI: IRI mode: mode] autorelease]; } + (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI { | | < | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | + (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode { return [[[self alloc] initWithIRI: IRI mode: mode] autorelease]; } + (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI { return OFArchiveIRIHandlerIRIForFileInArchive(@"lha", path, IRI); } - (instancetype)init { OF_INVALID_INIT_METHOD } |
︙ | ︙ |
Modified src/OFTarArchive.m from [1855b6b9b8] to [23e0c065c8].
︙ | ︙ | |||
84 85 86 87 88 89 90 | + (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode { return [[[self alloc] initWithIRI: IRI mode: mode] autorelease]; } + (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI { | | < | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | + (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode { return [[[self alloc] initWithIRI: IRI mode: mode] autorelease]; } + (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI { return OFArchiveIRIHandlerIRIForFileInArchive(@"tar", path, IRI); } - (instancetype)init { OF_INVALID_INIT_METHOD } |
︙ | ︙ |
Modified src/OFZIPArchive.m from [8040666849] to [1f22a87e08].
︙ | ︙ | |||
195 196 197 198 199 200 201 | + (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode { return [[[self alloc] initWithIRI: IRI mode: mode] autorelease]; } + (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI { | | < | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | + (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode { return [[[self alloc] initWithIRI: IRI mode: mode] autorelease]; } + (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI { return OFArchiveIRIHandlerIRIForFileInArchive(@"zip", path, IRI); } - (instancetype)init { OF_INVALID_INIT_METHOD } |
︙ | ︙ |
Modified src/OFZooArchive.m from [a292f6c75d] to [c337e995c2].
︙ | ︙ | |||
101 102 103 104 105 106 107 | + (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode { return [[[self alloc] initWithIRI: IRI mode: mode] autorelease]; } + (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI { | | < | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | + (instancetype)archiveWithIRI: (OFIRI *)IRI mode: (OFString *)mode { return [[[self alloc] initWithIRI: IRI mode: mode] autorelease]; } + (OFIRI *)IRIForFilePath: (OFString *)path inArchiveWithIRI: (OFIRI *)IRI { return OFArchiveIRIHandlerIRIForFileInArchive(@"zoo", path, IRI); } - (instancetype)init { OF_INVALID_INIT_METHOD } |
︙ | ︙ |