Comment: | OFArchiveEntry: Add more properties |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
406134b5e206652717d1170af5a7a493 |
User & Date: | js on 2022-08-27 23:53:22 |
Other Links: | manifest | tags |
2022-08-29
| ||
20:15 | OFThread: Rename threadBlock to block check-in: 0cca95da46 user: js tags: trunk | |
2022-08-27
| ||
23:53 | OFArchiveEntry: Add more properties check-in: 406134b5e2 user: js tags: trunk | |
22:29 | OFTarArchiveEntry: Make mode/UID/GID an OFNumber check-in: d281c3198b user: js tags: trunk | |
Modified src/OFArchiveEntry.h from [0835e2a472] to [70aea150d9].
︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + + + + | * 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 "OFObject.h" #import "OFString.h" OF_ASSUME_NONNULL_BEGIN @class OFDate; @class OFNumber; /** * @protocol OFArchiveEntry OFArchiveEntry.h ObjFW/OFArchiveEntry.h * * @brief A class which represents an entry in an archive. */ @protocol OFArchiveEntry <OFObject> |
︙ | |||
34 35 36 37 38 39 40 41 42 43 44 45 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | */ @property (readonly, nonatomic) unsigned long long compressedSize; /** * @brief The uncompressed size of the entry's file. */ @property (readonly, nonatomic) unsigned long long uncompressedSize; @optional /** * @brief The modification date of the file. */ @property (readonly, retain, nonatomic) OFDate *modificationDate; /** * @brief The comment of the entry's file. */ @property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFString *fileComment; /** * @brief The POSIX permissions of the file. */ @property OF_NULLABLE_PROPERTY (readonly, retain, nonatomic) OFNumber *POSIXPermissions; /** * @brief The file owner's account ID. */ @property OF_NULLABLE_PROPERTY (readonly, retain, nonatomic) OFNumber *ownerAccountID; /** * @brief The file owner's group account ID. */ @property OF_NULLABLE_PROPERTY (readonly, retain, nonatomic) OFNumber *groupOwnerAccountID; /** * @brief The file owner's account name. */ @property OF_NULLABLE_PROPERTY (readonly, retain, nonatomic) OFString *ownerAccountName; /** * @brief The file owner's group account name. */ @property OF_NULLABLE_PROPERTY (readonly, retain, nonatomic) OFString *groupOwnerAccountName; @end OF_ASSUME_NONNULL_END #import "OFMutableArchiveEntry.h" |
Modified src/OFLHAArchiveEntry.h from [dbd8020d72] to [89ea23a8c1].
︙ | |||
36 37 38 39 40 41 42 | 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 | + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | OFString *_fileName, *_Nullable _directoryName, *_compressionMethod; unsigned long long _compressedSize, _uncompressedSize; OFDate *_modificationDate; uint8_t _headerLevel; uint16_t _CRC16; uint8_t _operatingSystemIdentifier; OFString *_Nullable _fileComment; OFNumber *_Nullable _POSIXPermissions, *_Nullable _ownerAccountID; |
Modified src/OFLHAArchiveEntry.m from [c71c080e0a] to [b338459827].
︙ | |||
109 110 111 112 113 114 115 | 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 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 | - + - - + + - - + + + - + - + - - + + - - + + - - + + - - + + + - - + + + - - + + - + - - + + - + | length: extension.count - 1]; } static void parsePermissionsExtension(OFLHAArchiveEntry *entry, OFData *extension, OFStringEncoding encoding) { |
︙ | |||
414 415 416 417 418 419 420 | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | - - - - - + + + + + | - (void)dealloc { [_compressionMethod release]; [_fileName release]; [_directoryName release]; [_modificationDate release]; [_fileComment release]; |
︙ | |||
450 451 452 453 454 455 456 | 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | - - - - - + + + + + | copy->_compressedSize = _compressedSize; copy->_uncompressedSize = _uncompressedSize; copy->_modificationDate = [_modificationDate copy]; copy->_headerLevel = _headerLevel; copy->_CRC16 = _CRC16; copy->_operatingSystemIdentifier = _operatingSystemIdentifier; copy->_fileComment = [_fileComment copy]; |
︙ | |||
512 513 514 515 516 517 518 | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | - + - + - + - + - + - + - + - + - + - + | } - (OFString *)fileComment { return _fileComment; } |
︙ | |||
627 628 629 630 631 632 633 | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 | - + + - + - - + + - + + - + - - - + + + - + - + - - + + + - - - + + + - + - + - - + + + | tmp16 = OFToLittleEndian16((uint16_t)fileCommentLength + 3); [data addItems: &tmp16 count: sizeof(tmp16)]; [data addItem: "\x3F"]; [data addItems: [_fileComment cStringWithEncoding: encoding] count: fileCommentLength]; } |
︙ | |||
717 718 719 720 721 722 723 | 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | - + - + + + + + + - + - - - - - + + + + + - - + + + | objc_autoreleasePoolPop(pool); } - (OFString *)description { void *pool = objc_autoreleasePoolPush(); |
Modified src/OFMutableArchiveEntry.h from [05740ff0eb] to [ffb170561c].
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | * * 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. */ |
︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | */ @property (readwrite, nonatomic) unsigned long long compressedSize; /** * @brief The uncompressed size of the entry's file. */ @property (readwrite, nonatomic) unsigned long long uncompressedSize; @optional /** * @brief The modification date of the file. */ @property (readwrite, retain, nonatomic) OFDate *modificationDate; /** * @brief The comment of the entry's file. */ @property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *fileComment; /** * @brief The POSIX permissions of the file. */ @property OF_NULLABLE_PROPERTY (readwrite, retain, nonatomic) OFNumber *POSIXPermissions; /** * @brief The file owner's account ID. */ @property OF_NULLABLE_PROPERTY (readwrite, retain, nonatomic) OFNumber *ownerAccountID; /** * @brief The file owner's group account ID. */ @property OF_NULLABLE_PROPERTY (readwrite, retain, nonatomic) OFNumber *groupOwnerAccountID; /** * @brief The file owner's account name. */ @property OF_NULLABLE_PROPERTY (readwrite, retain, nonatomic) OFString *ownerAccountName; /** * @brief The file owner's group account name. */ @property OF_NULLABLE_PROPERTY (readwrite, retain, nonatomic) OFString *groupOwnerAccountName; @end OF_ASSUME_NONNULL_END #import "OFMutableArchiveEntry.h" |
Modified src/OFMutableLHAArchiveEntry.h from [ee76c82277] to [5bfb2f1e47].
︙ | |||
30 31 32 33 34 35 36 | 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 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | } /** * @brief The compression method of the entry. */ @property (readwrite, copy, nonatomic) OFString *compressionMethod; |
︙ |
Modified src/OFMutableLHAArchiveEntry.m from [423181bd19] to [5cc0ae4076].
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + + | #import "OFDate.h" #import "OFNumber.h" #import "OFString.h" @implementation OFMutableLHAArchiveEntry @dynamic fileName, compressionMethod, compressedSize, uncompressedSize; @dynamic modificationDate, headerLevel, CRC16, operatingSystemIdentifier; |
︙ | |||
109 110 111 112 113 114 115 | 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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + | - (void)setFileComment: (OFString *)fileComment { OFString *old = _fileComment; _fileComment = [fileComment copy]; [old release]; } |
︙ |
Modified src/OFMutableTarArchiveEntry.h from [d942abe401] to [d5cbafa370].
︙ | |||
25 26 27 28 29 30 31 | 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 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | * @brief A class which represents a mutable entry of a tar archive. */ @interface OFMutableTarArchiveEntry: OFTarArchiveEntry <OFMutableArchiveEntry> { OF_RESERVE_IVARS(OFMutableTarArchiveEntry, 4) } |
︙ |
Modified src/OFMutableTarArchiveEntry.m from [c563d173e3] to [f1fcc51707].
︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + - - + + | #import "OFMutableTarArchiveEntry.h" #import "OFTarArchiveEntry+Private.h" #import "OFDate.h" #import "OFNumber.h" #import "OFString.h" @implementation OFMutableTarArchiveEntry @dynamic fileName, POSIXPermissions, ownerAccountID, groupOwnerAccountID; |
︙ | |||
57 58 59 60 61 62 63 | 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 | - + - - + + - + - - + + - + - - + + | - (void)setFileName: (OFString *)fileName { OFString *old = _fileName; _fileName = [fileName copy]; [old release]; } |
︙ | |||
107 108 109 110 111 112 113 | 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 | - + - - + + - + - - + + | - (void)setTargetFileName: (OFString *)targetFileName { OFString *old = _targetFileName; _targetFileName = [targetFileName copy]; [old release]; } |
︙ |
Modified src/OFMutableZIPArchiveEntry.h from [1e72e2f1c2] to [019337b54d].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - - - - - - | * a ZIP archive. */ @interface OFMutableZIPArchiveEntry: OFZIPArchiveEntry <OFMutableArchiveEntry> { OF_RESERVE_IVARS(OFMutableZIPArchiveEntry, 4) } |
︙ | |||
59 60 61 62 63 64 65 | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - - - - - - - | * The lower 8 bits are the ZIP specification version.@n * The upper 8 bits are the attribute compatibility. * See @ref OFZIPArchiveEntryAttributeCompatibility. */ @property (readwrite, nonatomic) OFZIPArchiveEntryAttributeCompatibility minVersionNeeded; |
︙ |
Modified src/OFTarArchiveEntry.h from [bbe0bc8d5f] to [a18b395a59].
︙ | |||
50 51 52 53 54 55 56 | 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 | - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | * * @brief A class which represents an entry of a tar archive. */ @interface OFTarArchiveEntry: OFObject <OFArchiveEntry, OFCopying, OFMutableCopying> { OFString *_fileName; |
︙ |
Modified src/OFTarArchiveEntry.m from [91a459baa0] to [330cc9ede8].
︙ | |||
82 83 84 85 86 87 88 | 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 | + - + - + - + + - + | - (instancetype)of_init { self = [super init]; @try { _type = OFTarArchiveEntryTypeFile; _POSIXPermissions = |
︙ | |||
127 128 129 130 131 132 133 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | + - + - - - + + | if (_type == '\0') _type = OFTarArchiveEntryTypeFile; if (memcmp(header + 257, "ustar\0" "00", 8) == 0) { OFString *prefix; _ownerAccountName = |
︙ | |||
159 160 161 162 163 164 165 | 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 231 232 233 234 | - - - + + + - - + + + - + + - - + + - + - + - + - + - + - + | return self; } - (void)dealloc { [_fileName release]; |
︙ | |||
244 245 246 247 248 249 250 | 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 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | - + - + - + - + + + + + + + - + - - - + + + - - + + - - - + + + + + - - + + - - + + - - + + - - + + | } - (OFString *)targetFileName { return _targetFileName; } |
︙ |
Modified src/OFZIPArchiveEntry.h from [920d757f40] to [463b0f575c].
︙ | |||
117 118 119 120 121 122 123 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | - - - - - - | uint32_t _startDiskNumber; uint16_t _internalAttributes; uint32_t _versionSpecificAttributes; int64_t _localFileHeaderOffset; OF_RESERVE_IVARS(OFZIPArchiveEntry, 4) } |
︙ | |||
150 151 152 153 154 155 156 | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | - - - - - - - | * The lower 8 bits are the ZIP specification version.@n * The upper 8 bits are the attribute compatibility. * See @ref OFZIPArchiveEntryAttributeCompatibility. */ @property (readonly, nonatomic) OFZIPArchiveEntryAttributeCompatibility minVersionNeeded; |
︙ |
Modified utils/ofarc/LHAArchive.m from [a1e8c6e072] to [7f7a619844].
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | - + - + - - + + - + | withString: @"\n\t"]; } static void setPermissions(OFString *path, OFLHAArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS |
︙ | |||
162 163 164 165 166 167 168 | 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 | - - - - + + + + + - - - + + + + - + - - - + + + + - + - - + + - + - - - + + + - + - - - + + + | @"crc16", CRC16)]; [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED( @"list_modification_date", @"Modification date: %[date]", @"date", modificationDate)]; |
︙ | |||
440 441 442 443 444 445 446 | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | - - + + - - - - - - + + + + + + + + | @"file", fileName)]; attributes = [fileManager attributesOfItemAtPath: fileName]; type = attributes.fileType; entry = [OFMutableLHAArchiveEntry entryWithFileName: fileName]; #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS |
︙ |
Modified utils/ofarc/TarArchive.m from [e32d96f125] to [1feea72626].
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | - - + + - + | static OFArc *app; static void setPermissions(OFString *path, OFTarArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS |
︙ | |||
113 114 115 116 117 118 119 | 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 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 | + - - + + + - - - - + + + - + - - - + + + + - - - + + + + - + - - - + + + - + - - - + + + | [OFStdOut writeLine: entry.fileName]; if (app->_outputLevel >= 1) { OFString *date = [entry.modificationDate localDateStringWithFormat: @"%Y-%m-%d %H:%M:%S"]; OFString *size = [OFString stringWithFormat: @"%llu", entry.uncompressedSize]; OFString *permissionsString = [OFString |
︙ | |||
474 475 476 477 478 479 480 | 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | + - + + - - + + - - + + + | @"file", fileName)]; attributes = [fileManager attributesOfItemAtPath: fileName]; type = attributes.fileType; entry = [OFMutableTarArchiveEntry entryWithFileName: fileName]; #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS entry.POSIXPermissions = |
︙ |
Modified utils/ofarc/lang/de.json from [1249658b50] to [173fef355f].
︙ | |||
71 72 73 74 75 76 77 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | - - - + + + + + | "list_size": [ "Größe: ", [ {"size == 1": "1 Byte"}, {"": "%[size] Bytes"} ] ], |
︙ |