Overview
Comment: | OFTarArchive: Allow specifying the encoding |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
9db196593908b9f3b74f76fdc39fad12 |
User & Date: | js on 2018-05-26 07:56:22 |
Other Links: | manifest | tags |
Context
2018-05-26
| ||
08:47 | ofzip: Add support for specifying the encoding check-in: 14b9a27b65 user: js tags: trunk | |
07:56 | OFTarArchive: Allow specifying the encoding check-in: 9db1965939 user: js tags: trunk | |
2018-05-21
| ||
21:03 | Symlink objfw_rt.library into tests directory check-in: c1a477e22c user: js tags: trunk | |
Changes
Modified src/OFTarArchive.h from [cd01fa929d] to [f2708a375a].
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | + - + + + + + + | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #import "OFKernelEventObserver.h" #import "OFString.h" #import "OFTarArchiveEntry.h" OF_ASSUME_NONNULL_BEGIN |
︙ |
Modified src/OFTarArchive.m from [68a00e534e] to [969975ba2f].
︙ | |||
55 56 57 58 59 60 61 62 63 64 65 66 67 68 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | + + | } - (instancetype)initWithStream: (OFStream *)stream entry: (OFTarArchiveEntry *)entry; @end @implementation OFTarArchive: OFObject @synthesize encoding = _encoding; + (instancetype)archiveWithStream: (OF_KINDOF(OFStream *))stream mode: (OFString *)mode { return [[[self alloc] initWithStream: stream mode: mode] autorelease]; } |
︙ | |||
113 114 115 116 117 118 119 120 121 122 123 124 125 126 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | + + | if (!empty) @throw [OFInvalidFormatException exception]; [stream seekToOffset: -1024 whence: SEEK_END]; } _encoding = OF_STRING_ENCODING_UTF_8; } @catch (id e) { [self release]; @throw e; } return self; } |
︙ | |||
191 192 193 194 195 196 197 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | - + + | if (buffer.u32[i] != 0) @throw [OFInvalidFormatException exception]; return nil; } entry = [[[OFTarArchiveEntry alloc] |
︙ | |||
226 227 228 229 230 231 232 | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | - + + | pool = objc_autoreleasePoolPush(); [_lastReturnedStream close]; [_lastReturnedStream release]; _lastReturnedStream = nil; |
︙ |
Modified src/OFTarArchiveEntry+Private.h from [bfae02c896] to [f989dc9d7a].
︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | + + - + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFTarArchiveEntry.h" #import "OFString.h" OF_ASSUME_NONNULL_BEGIN @class OFStream; @interface OFTarArchiveEntry () - (instancetype)of_initWithHeader: (unsigned char [_Nonnull 512])header encoding: (of_string_encoding_t)encoding OF_METHOD_FAMILY(init); |
Modified src/OFTarArchiveEntry.m from [426c84e614] to [df56ebf01c].
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 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 139 | - + + - - + + + - + + - + - + - + - + - + + + - + - + - - + + + + - + | #import "OFDate.h" #import "OFStream.h" #import "OFString.h" #import "OFOutOfRangeException.h" static OFString * |
︙ | |||
281 282 283 284 285 286 287 288 289 290 291 292 | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | + - + - + + - + + - + + - + + - + - + - - + + - + + - + + - + + | objc_autoreleasePoolPop(pool); return [ret autorelease]; } - (void)of_writeToStream: (OFStream *)stream encoding: (of_string_encoding_t)encoding { unsigned char buffer[512]; uint64_t modificationDate; uint16_t checksum = 0; |