Differences From Artifact [a82a35d7aa]:
- File
src/OFURI.m
— part of check-in
[19bbbbd95d]
at
2022-10-04 21:33:53
on branch trunk
— Add +[OFZIPArchive URIForFile:inArchive:]
This allows constructing a URI to access a file within an archive. (user: js, size: 29020) [annotate] [blame] [check-ins using]
To Artifact [e7dba343a1]:
- File src/OFURI.m — part of check-in [519c277156] at 2022-10-04 22:22:25 on branch trunk — OF*Archive: Share +[URIForFile:inArchive:] code (user: js, size: 29530) [annotate] [blame] [check-ins using]
︙ | |||
139 140 141 142 143 144 145 146 147 148 149 150 151 152 | 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 | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | - - - - - - - - - | + (OFCharacterSet *)URIFragmentAllowedCharacterSet { OFOnce(&URIQueryOrFragmentAllowedCharacterSetOnce, initURIQueryOrFragmentAllowedCharacterSet); return URIQueryOrFragmentAllowedCharacterSet; } |
︙ |