Overview
Comment: | OFLHAArchiveEntry: Add support for LHA level 0 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
57f9bc6ace41c1951e8fb94a6c7740a4 |
User & Date: | js on 2018-05-27 11:07:03 |
Other Links: | manifest | tags |
Context
2018-05-27
| ||
11:14 | ofzip: Only print OS identifier if it exists check-in: bfc99fa4ac user: js tags: trunk | |
11:07 | OFLHAArchiveEntry: Add support for LHA level 0 check-in: 57f9bc6ace user: js tags: trunk | |
09:44 | ofzip: Add support for LHA archives check-in: c693041e37 user: js tags: trunk | |
Changes
Modified src/OFLHAArchive.h from [874facd305] to [94d0a087a6].
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + | * * @brief A class for accessing and manipulating LHA files. */ @interface OFLHAArchive: OFObject { OF_KINDOF(OFStream *) _stream; of_string_encoding_t _encoding; OFLHAArchiveEntry *_Nullable _lastEntry; OF_KINDOF(OFStream *) _Nullable _lastReturnedStream; } /*! * @brief The encoding to use for the archive. Defaults to ISO 8859-1. */ @property (nonatomic) of_string_encoding_t encoding; |
︙ |
Modified src/OFLHAArchive.m from [dc06a91f23] to [1011e54787].
︙ | |||
26 27 28 29 30 31 32 33 34 35 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + - | #import "OFStream.h" #import "OFSeekableStream.h" #import "OFString.h" #import "OFInvalidArgumentException.h" #import "OFNotImplementedException.h" #import "OFNotOpenException.h" #import "OFTruncatedDataException.h" @interface OFLHAArchive_FileReadStream: OFStream <OFReadyForReadingObserving> { |
︙ | |||
118 119 120 121 122 123 124 | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | - - + + + + + + - - + + + - - - + + + + - + - - - - - - + + + + + + + + - + - + + + + + + + + + + + + + + - - - - - - - - + + + + + - + - - | [self close]; [super dealloc]; } - (OFLHAArchiveEntry *)nextEntry { |
︙ |
Modified src/OFLHAArchiveEntry+Private.h from [2c161f93e6] to [d79a363508].
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - - - + + + | */ #import "OFLHAArchive.h" OF_ASSUME_NONNULL_BEGIN @interface OFLHAArchiveEntry () |
Modified src/OFLHAArchiveEntry.h from [7d4437acfc] to [88951356da].
︙ | |||
18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | + | #import "OFObject.h" OF_ASSUME_NONNULL_BEGIN @class OFArray OF_GENERIC(ObjectType); @class OFData; @class OFDate; @class OFMutableArray OF_GENERIC(ObjectType); @class OFNumber; @class OFString; /*! * @class OFLHAArchiveEntry OFLHAArchiveEntry.h ObjFW/OFLHAArchiveEntry.h * * @brief A class which represents an entry in the central directory of a LHA |
︙ | |||
42 43 44 45 46 47 48 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - + | uint8_t _level; uint16_t _CRC16; uint8_t _operatingSystemIdentifier; OFString *_Nullable _fileComment; OFNumber *_Nullable _mode, *_Nullable _UID, *_Nullable _GID; OFString *_Nullable _owner, *_Nullable _group; OFDate *_Nullable _modificationDate; |
︙ |
Modified src/OFLHAArchiveEntry.m from [596d16c180] to [5976df7f2a].
︙ | |||
26 27 28 29 30 31 32 33 34 35 36 37 38 39 | 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 | + + + + + + + + + + + + + + + + + + + | #import "OFDate.h" #import "OFNumber.h" #import "OFStream.h" #import "OFString.h" #import "OFInvalidFormatException.h" #import "OFUnsupportedVersionException.h" static OFDate * parseMSDOSDate(uint32_t MSDOSDate) { uint16_t year = ((MSDOSDate & 0xFE000000) >> 25) + 1980; uint8_t month = (MSDOSDate & 0x1E00000) >> 21; uint8_t day = (MSDOSDate & 0x1F); uint8_t hour = (MSDOSDate & 0xF800) >> 11; uint8_t minute = (MSDOSDate & 0x7E0) >> 5; uint8_t second = (MSDOSDate & 0x1F) << 1; OFString *dateString; dateString = [OFString stringWithFormat: @"%04u-%02u-%02u %02u:%02u:%02u", year, month, day, hour, minute, second]; return [OFDate dateWithLocalDateString: dateString format: @"%Y-%m-%d %H:%M:%S"]; } static void parseFileNameExtension(OFLHAArchiveEntry *entry, OFData *extension, of_string_encoding_t encoding) { [entry->_fileName release]; entry->_fileName = nil; |
︙ | |||
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 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 | + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - + - + - + - + - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + | if (function == NULL) return false; function(entry, extension, encoding); return true; } static void readExtensions(OFLHAArchiveEntry *entry, OFStream *stream, of_string_encoding_t encoding) { uint16_t nextSize; while ((nextSize = [stream readLittleEndianInt16]) > 0) { OFData *extension; if (nextSize < 2) @throw [OFInvalidFormatException exception]; extension = [stream readDataWithCount: nextSize - 2]; if (!parseExtension(entry, extension, encoding)) [entry->_extensions addObject: extension]; } } @implementation OFLHAArchiveEntry @synthesize method = _method, compressedSize = _compressedSize; @synthesize uncompressedSize = _uncompressedSize, date = _date; @synthesize level = _level, CRC16 = _CRC16; @synthesize operatingSystemIdentifier = _operatingSystemIdentifier; @synthesize fileComment = _fileComment, mode = _mode, UID = _UID, GID = _GID; @synthesize owner = _owner, group = _group; @synthesize modificationDate = _modificationDate, extensions = _extensions; - (instancetype)init { OF_INVALID_INIT_METHOD } |
︙ |
Modified utils/ofzip/LHAArchive.m from [7bf18d4f42] to [50bf2d19a1].
︙ | |||
66 67 68 69 70 71 72 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | + - + | { self = [super init]; @try { _archive = [[OFLHAArchive alloc] initWithStream: stream mode: mode]; if (encoding != OF_STRING_ENCODING_AUTODETECT) |
︙ | |||
97 98 99 100 101 102 103 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | - + | if (app->_outputLevel >= 1) { OFString *date = [[entry date] localDateStringWithFormat: @"%Y-%m-%d %H:%M:%S"]; OFString *compressedSize = [OFString stringWithFormat: @"%" PRIu32, [entry compressedSize]]; OFString *uncompressedSize = [OFString stringWithFormat: |
︙ |
Modified utils/ofzip/OFZIP.m from [fe40a35a63] to [047f714025].
︙ | |||
166 167 168 169 170 171 172 | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | - + | { 't', @"type", 1, NULL, &type }, { 'v', @"verbose", 0, NULL, NULL }, { 'x', @"extract", 0, NULL, NULL }, { '\0', nil, 0, NULL, NULL } }; OFOptionsParser *optionsParser; of_unichar_t option, mode = '\0'; |
︙ |
Modified utils/ofzip/TarArchive.m from [f7b1262e85] to [53ccc5f3ec].
︙ | |||
66 67 68 69 70 71 72 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | + - + | { self = [super init]; @try { _archive = [[OFTarArchive alloc] initWithStream: stream mode: mode]; if (encoding != OF_STRING_ENCODING_AUTODETECT) |
︙ |