Overview
Comment: | OF*Archive: Share +[URIForFile:inArchive:] code |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
519c277156b271461b5841e32e386cec |
User & Date: | js on 2022-10-04 22:22:25 |
Other Links: | manifest | tags |
Context
2022-10-04
| ||
22:27 | Add of-lha: URI handler check-in: f3bdf29f07 user: js tags: trunk | |
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 | |
Changes
Modified src/OFTarArchive.m from [0dbf94ce58] to [e6e921bda1].
︙ | ︙ | |||
70 71 72 73 74 75 76 | + (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode { return [[[self alloc] initWithURI: URI mode: mode] autorelease]; } + (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive { | < < < < < | < < < < < < < < < < < < < < | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | + (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode { return [[[self alloc] initWithURI: URI mode: mode] autorelease]; } + (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive { return OFURIForFileInArchive(@"of-tar", path, archive); } - (instancetype)init { OF_INVALID_INIT_METHOD } |
︙ | ︙ |
Modified src/OFTarURIHandler.m from [6ffaae458d] to [5ef603a03a].
︙ | ︙ | |||
14 15 16 17 18 19 20 21 22 23 24 25 26 27 | */ #include "config.h" #include <errno.h> #import "OFTarURIHandler.h" #import "OFTarArchive.h" #import "OFURI.h" #import "OFInvalidArgumentException.h" #import "OFOpenItemFailedException.h" @implementation OFTarURIHandler | > | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | */ #include "config.h" #include <errno.h> #import "OFTarURIHandler.h" #import "OFStream.h" #import "OFTarArchive.h" #import "OFURI.h" #import "OFInvalidArgumentException.h" #import "OFOpenItemFailedException.h" @implementation OFTarURIHandler |
︙ | ︙ |
Modified src/OFURI.h from [0e7faecce0] to [80857913fd].
︙ | ︙ | |||
371 372 373 374 375 376 377 | /** * @brief Returns the characters allowed in the fragment part of a URI. * * @return The characters allowed in the fragment part of a URI. */ + (OFCharacterSet *)URIFragmentAllowedCharacterSet; | < < > | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | /** * @brief Returns the characters allowed in the fragment part of a URI. * * @return The characters allowed in the fragment part of a URI. */ + (OFCharacterSet *)URIFragmentAllowedCharacterSet; @end #ifdef __cplusplus extern "C" { #endif extern bool OFURIIsIPv6Host(OFString *host); extern void OFURIVerifyIsEscaped(OFString *, OFCharacterSet *); extern OFURI *OFURIForFileInArchive(OFString *, OFString *, OFURI *); #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END #import "OFMutableURI.h" |
Modified src/OFURI.m from [a82a35d7aa] to [e7dba343a1].
︙ | ︙ | |||
139 140 141 142 143 144 145 146 147 148 149 150 151 152 | hasColon = true; UTF8String++; } return hasColon; } @implementation OFURIAllowedCharacterSetBase - (instancetype)autorelease { return self; } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | hasColon = true; UTF8String++; } return hasColon; } OFURI * OFURIForFileInArchive(OFString *scheme, OFString *path, OFURI *archive) { static OFOnceControl onceControl = OFOnceControlInitValue; OFMutableURI *URI = [OFMutableURI URI]; void *pool = objc_autoreleasePoolPush(); OFString *archiveURI; OFOnce(&onceControl, initURIPathAllowedCharacterSetWithoutExclamationMark); path = [path stringByAddingPercentEncodingWithAllowedCharacters: URIPathAllowedCharacterSetWithoutExclamationMark]; archiveURI = [archive.string stringByAddingPercentEncodingWithAllowedCharacters: URIPathAllowedCharacterSetWithoutExclamationMark]; URI.scheme = scheme; URI.percentEncodedPath = [OFString stringWithFormat: @"%@!%@", archiveURI, path]; [URI makeImmutable]; objc_autoreleasePoolPop(pool); return URI; } @implementation OFURIAllowedCharacterSetBase - (instancetype)autorelease { return self; } |
︙ | ︙ | |||
443 444 445 446 447 448 449 | + (OFCharacterSet *)URIFragmentAllowedCharacterSet { OFOnce(&URIQueryOrFragmentAllowedCharacterSetOnce, initURIQueryOrFragmentAllowedCharacterSet); return URIQueryOrFragmentAllowedCharacterSet; } | < < < < < < < < < | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | + (OFCharacterSet *)URIFragmentAllowedCharacterSet { OFOnce(&URIQueryOrFragmentAllowedCharacterSetOnce, initURIQueryOrFragmentAllowedCharacterSet); return URIQueryOrFragmentAllowedCharacterSet; } @end @implementation OFURI + (instancetype)URI { return [[[self alloc] init] autorelease]; } |
︙ | ︙ |
Modified src/OFZIPArchive.m from [d0b4f286d3] to [ed7fc3801b].
︙ | ︙ | |||
166 167 168 169 170 171 172 | + (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode { return [[[self alloc] initWithURI: URI mode: mode] autorelease]; } + (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive { | < < < < < | < < < < < < < < < < < < < < | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | + (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode { return [[[self alloc] initWithURI: URI mode: mode] autorelease]; } + (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive { return OFURIForFileInArchive(@"of-zip", path, archive); } - (instancetype)init { OF_INVALID_INIT_METHOD } |
︙ | ︙ |