214 Commits

Author SHA1 Message Date
Timofey Solomko 3f07b0d571 [TAR] Define autoreleasepool on Android and Wasm
Apparently, Swift Package Index is trying to build SWC on these two platforms as well. While we do not currently support them, we can try to at least fix some issues.
2026-05-26 20:33:47 +08:00
Timofey Solomko 5d4b4d2493 [TAR] Fix code comment to refer to TarParser instead of Provider 2026-03-01 20:35:22 +08:00
Timofey Solomko 273b6ed9e9 Remove redundant imports 2026-02-18 12:21:57 +08:00
Timofey Solomko ea9aaccfb9 Update copyright year to 2026 2026-01-31 15:30:24 +08:00
Timofey Solomko fa4af5803a [TAR] Remove compatibility functions for FileHandle 2024-04-21 17:18:53 +03:00
Timofey Solomko ed66991cbd Update copyright year to 2024 2024-01-11 16:57:04 +03:00
Timofey Solomko 6a6e75d752 [docs] Fix an error in documentation for TarEntryInfo.deviceMinorNumber 2023-09-20 11:45:27 +03:00
Timofey Solomko 43132fc39d Update copyright year to 2023 2023-02-07 15:31:45 +02:00
Timofey Solomko c1ecadbcb7 Update some code comments 2022-12-17 19:02:19 +03:00
Timofey Solomko db48b07ec2 [TAR] TarReader now always returns nil after reaching EOF
Previosuly, repeated calls of read() or process() after reaching EOF would result in DataError.truncated being thrown. This behavior caused issues when there was no EOF marker in the TAR container.
2022-12-17 19:02:19 +03:00
Timofey Solomko efd67feb07 [TAR] Handle PAX headers with non-utf8 values and values with newline characters
For example, Apple's implementation of TAR on macOS produces such containers, which technically do not conform to the (informal) specifications.
2022-10-22 18:42:44 +03:00
Timofey Solomko 5b590803b8 [TAR] Remove outdated code comment 2022-10-21 19:33:50 +03:00
Timofey Solomko 55cc5a9036 [docs] Remove mentions of "older than Swift 5.2" versions since they are no longer supported 2022-09-24 14:27:21 +03:00
Timofey Solomko 52886a0bbf [TAR] Remove compatibility with pre-Swift 5.2 compilers 2022-09-24 13:25:46 +03:00
Timofey Solomko f9994d6e6f [docs] Minor change to TarWriter documentation 2022-01-23 18:56:33 +03:00
Timofey Solomko 1d57f6adc1 [docs] Mention obj-c exceptions and swift 5.2 issues in the docs for TarReader/Writer 2022-01-22 16:24:26 +03:00
Timofey Solomko 552cb31336 [docs] Add documentation for TarReader 2022-01-22 14:26:54 +03:00
Timofey Solomko 859178d5f2 [docs] Add documentation for TarWriter 2022-01-22 14:26:42 +03:00
Timofey Solomko 4ccb5e1de8 [docs] Small fixes to the documentation of TarContainer.create(from:force:) 2022-01-22 13:39:40 +03:00
Timofey Solomko ba7e4448d1 [TAR] Simplify TarWriter.finalize
This is possible since the write function already performs the synchronization the file handle.
2022-01-22 13:38:32 +03:00
Timofey Solomko 3388cb047b [TAR] Rename the second argument of TarWriter.init to force
This is for consistency with TarContainer.create.
2022-01-09 14:17:00 +03:00
Timofey Solomko c8d8c7b4fd [TAR] TarReader.read now throws DataError.truncated if the entry data is truncated 2022-01-08 23:13:46 +03:00
Timofey Solomko a3677a0cb7 [TAR] TarReader now sets TarEntry.data to nil for directories
This is the same behavior as TarContainer.open.
2022-01-08 23:00:21 +03:00
Timofey Solomko 79a0aa8d08 Fix compilation issues on Linux and Windows due to the absence of autoreleasepool 2022-01-08 15:47:16 +03:00
Timofey Solomko 79295db930 Update copyright year to 2022 2022-01-08 15:02:59 +03:00
Timofey Solomko ddb789b645 [TAR] Add TarReader.process(_:) 2022-01-08 14:33:50 +03:00
Timofey Solomko fe9453173a [TAR] Rename TarReader.next() to read() 2022-01-08 14:33:40 +03:00
Timofey Solomko 643f2c9866 [TAR] Remove argument label from TarWriter.append 2021-11-21 12:36:56 +03:00
Timofey Solomko 4545d6b1f0 [TAR] Add TarWriter 2021-11-20 23:45:05 +03:00
Timofey Solomko 7c1a12bb0d [TAR] Initialize optional vars explicitly in TarParser and TarReader 2021-11-20 21:32:29 +03:00
Timofey Solomko 44ff3de44f [TAR] Add conditional compilation for FileHandle to fix issues with Swift 5.1 2021-11-20 17:51:34 +03:00
Timofey Solomko 49becf4a9f [TAR] Remove getChunk and add getOffset and set(offset:) 2021-11-20 17:48:04 +03:00
Timofey Solomko 61eac884da [TAR] Add TarReader 2021-11-20 12:28:33 +03:00
Timofey Solomko 0ac48ae704 [docs] Add documentation for TarContainer.create(from:force:) 2021-08-04 10:52:31 +03:00
Timofey Solomko 4e8be1d4fc [TAR] Remove TarEntryInfo.format in favor of working with header format directly 2021-08-03 18:39:03 +03:00
Timofey Solomko 925986b9ed [TAR] Add an assertion that verifies that base-256 encoding will always succeed 2021-07-31 12:23:37 +03:00
Timofey Solomko d335ed450e [TAR] Counters for special entries are now UInt to prevent overflowing into negatives 2021-07-31 12:23:00 +03:00
Timofey Solomko 417ef7ded8 [TAR] Small code comments changes 2021-07-28 11:17:49 +03:00
Timofey Solomko 2a8fe7d37f [TAR] Remove an extra check in TarContainer functions for very small files
This situation is already covered by the check in TarParser, which results in ParsingResult.truncated. In addition, we repurposed TarError.tooSmallFileIsPassed for this cases (updated documentation).
2021-07-26 21:37:00 +03:00
Timofey Solomko 36f34c4e8f [TAR] Remove TarEntryInfo.blockStartIndex
To accomplish this, we added a second associated value to ParsingResult.entryInfo and rewrote TarContainer.open in similar way to TarContainer.info.
2021-07-26 21:22:03 +03:00
Timofey Solomko 265191ea05 [TAR] Remove TarEntryInfo.specialEntryType 2021-07-26 21:16:48 +03:00
Timofey Solomko b2f7084a0e [TAR] Rename TarEntryInfoProvider to TarParser 2021-07-26 21:15:06 +03:00
Timofey Solomko 49c4adf8e9 [TAR] Return ParsingResult from TarEntryInfoProvider.next()
ParsingResult is a new enum. This allows us to better distinguish between different situtations encounterd during parsing a TAR container.
2021-07-26 21:13:27 +03:00
Timofey Solomko a743229456 [docs] Mention format forcing in the docs for TarEntryInfo properties 2021-07-25 15:55:31 +03:00
Timofey Solomko 3d7a4a8fbc [docs] Remove Throws section from TarContainer.create 2021-07-25 15:54:29 +03:00
Timofey Solomko cc217f8f93 [TAR] The names of created special entries are now quasi-unique 2021-07-25 15:54:00 +03:00
Timofey Solomko af516f4090 [TAR] Add several asserts to TarEntryInfoProvider.next() 2021-07-24 15:28:37 +03:00
Timofey Solomko 5012788be4 [TAR] Rename ByteReader+Tar to LittleEndianByteReader+Tar 2021-07-24 15:28:19 +03:00
Timofey Solomko 8415cee9ae [TAR] Fix missing return statement in TarContainer.create 2021-07-24 15:15:29 +03:00
Timofey Solomko b344fe1f1f [TAR] Write ustar fields also for gnu format for 2021-07-24 15:00:13 +03:00