Differences From Artifact [78d87309e9]:
- File
src/OFArchiveIRIHandler.m
— part of check-in
[34a3e817b3]
at
2024-03-04 01:21:52
on branch trunk
— Rename schemes for archive IRI handlers back
The naming was confusing, as it is used to refer to a specific file in
an archive and not the entire archive. (user: js, size: 5712) [annotate] [blame] [check-ins using]
To Artifact [933f97fec8]:
- File
src/OFArchiveIRIHandler.m
— part of check-in
[334db394f3]
at
2024-03-04 22:26:41
on branch trunk
— OFArchiveIRIHandler: Use the rightmost `!`
This allows chaining several of these without the need to quote the `!`. (user: js, size: 5601) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
77 78 79 80 81 82 83 | IRI.path] mode: mode]; stream = [OFGZIPStream streamWithStream: stream mode: mode]; goto end; } percentEncodedPath = IRI.percentEncodedPath; | | > > | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | IRI.path] mode: mode]; stream = [OFGZIPStream streamWithStream: stream mode: mode]; goto end; } percentEncodedPath = IRI.percentEncodedPath; pos = [percentEncodedPath rangeOfString: @"!" options: OFStringSearchBackwards].location; if (pos == OFNotFound) @throw [OFInvalidArgumentException exception]; archiveIRI = [OFIRI IRIWithString: [percentEncodedPath substringWithRange: OFMakeRange(0, pos)] .stringByRemovingPercentEncoding]; |
︙ | ︙ | |||
191 192 193 194 195 196 197 | OFIRI * OFArchiveIRIHandlerIRIForFileInArchive(OFString *scheme, OFString *pathInArchive, OFIRI *archiveIRI) { static OFOnceControl onceControl = OFOnceControlInitValue; OFMutableIRI *ret = [OFMutableIRI IRIWithScheme: scheme]; void *pool = objc_autoreleasePoolPush(); | < < < < | | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | OFIRI * OFArchiveIRIHandlerIRIForFileInArchive(OFString *scheme, OFString *pathInArchive, OFIRI *archiveIRI) { static OFOnceControl onceControl = OFOnceControlInitValue; OFMutableIRI *ret = [OFMutableIRI IRIWithScheme: scheme]; void *pool = objc_autoreleasePoolPush(); OFOnce(&onceControl, initPathAllowedCharacters); pathInArchive = [pathInArchive stringByAddingPercentEncodingWithAllowedCharacters: pathAllowedCharacters]; ret.percentEncodedPath = [OFString stringWithFormat: @"%@!%@", archiveIRI.string, pathInArchive]; [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } |