Timofey Solomko
753839f195
[TAR] Implement gnu tar headers fields creation
2021-07-24 14:33:40 +03:00
Timofey Solomko
5de2bc5768
Change conversion of utf8 strings to data without optional unwraps
2021-07-24 14:26:14 +03:00
Timofey Solomko
3e96a84f62
[TAR] Add a docs note to TarCreateError about it being never used
2021-07-24 14:23:10 +03:00
Timofey Solomko
505f35fc28
[TAR] Make TarContainer.create non-throwing by removing the usage of TarCreateError.utf8NonEncodable
2021-07-24 14:21:27 +03:00
Timofey Solomko
c87e8bece7
[TAR] Remove unused generateContainerData function from TarEntry[Info]
2021-07-24 14:16:15 +03:00
Timofey Solomko
017afa06b8
[TAR] Add TarContainer.create(from:force:) function which can be used to specify tar format
...
In addition use this new function in the old TarContainer.create(from:) function with .pax format.
2021-07-24 14:15:35 +03:00
Timofey Solomko
7c54d2b991
[TAR] Implement TarHeader.generateContainerData
2021-07-24 14:10:04 +03:00
Timofey Solomko
082aaf5092
[TAR] Reorder and comment properties of TarHeader to clarify used formats
2021-07-24 14:09:34 +03:00
Timofey Solomko
11a2054498
[TAR] Move Data extensions from TarEntryInfo into separate file
...
In addition Data.append(tarString:maxLength:) has been modified to not be throwing.
2021-07-24 13:56:52 +03:00
Timofey Solomko
0bc1987500
[TAR] Add two new initializers to TarHeader
...
One creates a header based on TarEntryInfo, and the second one creates a header for special entries like pax headers.
2021-07-23 16:52:42 +03:00
Timofey Solomko
bdf22b2cc5
[TAR] Add a Data extension function which pads to 512 bytes and appends
2021-07-23 16:40:21 +03:00
Timofey Solomko
1730eabc1c
[TAR] TarEntryInfo (internal) init is no longer throwing
2021-07-23 15:18:39 +03:00
Timofey Solomko
1ec17a3137
[TAR] Rename several properties of TarHeader for consistency
2021-07-22 23:52:54 +03:00
Timofey Solomko
a65f66c473
[TAR] Update TarEntryInfo.init and TarEntryInfoProvider to use TarHeader
...
Temporarily we had to leave the code that is being moved to TarHeader (such as TarEntryInfo.specialEntryType and blockStartIndex properties), because the format and create functionalities of TAR currently rely on it being present in TarEntryInfo to work. However, we were able to remove TarEntryInfo.SpecialEntryType enum, and use the TarHeader's version of it.
2021-07-22 23:49:47 +03:00
Timofey Solomko
0815fee187
[TAR] Rename TarEntryInfoProvider.byteReader to reader
2021-07-22 23:08:19 +03:00
Timofey Solomko
bc3362c568
[TAR] Add TarHeader struct
2021-07-21 20:22:20 +03:00
Timofey Solomko
7646ec34a1
[TAR] Remove pre-Swift 5.0 crash workaround
2021-07-21 19:34:48 +03:00
Timofey Solomko
aba14af8c5
Small changes to code comments
2021-07-17 11:14:53 +03:00
Timofey Solomko
5245a73a6c
Merge branch 'hotfix-4.5.11' into develop
2021-06-12 18:53:45 +03:00
Timofey Solomko
f766fbc7ed
[TAR] Add a comment explaining why the new data indices check uses strict inequalitites
2021-06-09 21:14:58 +03:00
Timofey Solomko
d197d76769
[TAR] Check if the data is truncated before extracting entry data
2021-06-08 20:26:42 +03:00
Timofey Solomko
1fca632c2d
Update copyright year to 2021
2021-03-26 13:50:20 +02:00
Timofey Solomko
e83f23effa
Update copyright year to 2021
2021-01-11 11:20:57 +02:00
Timofey Solomko
deab72a831
Merge branch 'hotfix-4.5.7' into develop
2020-10-16 15:57:08 +03:00
Timofey Solomko
a07fc290a0
Small fixes to code comments
2020-10-15 23:35:34 +03:00
Timofey Solomko
a844b34436
Update copyright year to 2020
2020-03-20 09:43:42 +03:00
Timofey Solomko
f6949a8f66
Replace the usage of the deprecated Data(bytes:) initializer
2020-03-20 09:40:48 +03:00
Timofey Solomko
31ec1f1553
Update copyright year to 2020
2020-01-01 19:06:33 +03:00
Timofey Solomko
75b21ae107
Replace usage of ByteReader with LittleEndianByteReader
2019-05-01 19:34:30 +03:00
Timofey Solomko
db82490ed8
Replace the usage of the deprecated Data(bytes:) initializer
2019-05-01 19:30:48 +03:00
Timofey Solomko
c93a783d21
[docs] Fix grammar issues with regards to a/the/null articles, while/during, and extra commas
2019-03-13 12:27:08 +03:00
Timofey Solomko
ce47019097
Update copyright year to 2019
2019-01-02 23:15:43 +03:00
Timofey Solomko
9559979233
[docs] Small improvements to TAR's docs
2018-12-22 20:10:09 +03:00
Timofey Solomko
79b5a951e2
Better detect pre-4.2 Swift in Data.prefix(upTo:) crash workaround in TarEntryInfo.generateContainerData()
2018-12-16 12:42:18 +03:00
Timofey Solomko
0f65983f49
[docs] Small typo fix in docs for TarEntryInfo.ownerUserName
2018-08-15 16:52:51 +03:00
Timofey Solomko
160e55d9ce
[TAR] Return a copy of data for entries in open function
...
This is consistent behavior with other containers and solves two problems: non-zero based indices and (probably) keeping entire container data in memory for the data of single entry (for example, all other entries were discarded).
2018-08-09 22:11:00 +03:00
Timofey Solomko
6d63e02d21
[docs] Add docs to all new TAR-create-related APIs
2018-08-07 21:05:36 +03:00
Timofey Solomko
cc03c48847
[docs] Add docs to TarEntry.data to explain its connection with info.size
2018-08-07 21:05:28 +03:00
Timofey Solomko
6836384a34
[docs] Update TarEntryInfo properties docs to explain how their values influence creation of PAX headers
2018-08-07 21:05:24 +03:00
Timofey Solomko
455a3c9de0
[TAR] Length of ownerUser/GroupName is now taken into account when deciding if creation of PAX header is necessary
2018-08-07 19:01:57 +03:00
Timofey Solomko
bd8562c966
[TAR] Remove unused empty TarExtendedHeader.init()
2018-08-07 19:01:23 +03:00
Timofey Solomko
45fb997f2b
[TAR] info.size is no longer nil when Data is nil
...
This was causing problems with generated containers because size is a "required" field.
2018-08-07 18:31:24 +03:00
Timofey Solomko
0ae4c685c1
[TAR] Use "TarEntryInfo.generateContainerData prefx-runtime-crash-Swift-bug" workaround only on Linux with Swift version less than 4.2
2018-08-06 18:33:28 +03:00
Timofey Solomko
cc6d82c753
[TAR] Add a workaround for swift runtime crash on linux when creating name prefix
...
For some reason Data.prefix(upTo:).range(of:options:) crashes on linux and doesn't crash on macOS, so I've added a, hopefully, temporary workaround for this problem.
2018-08-05 23:34:23 +03:00
Timofey Solomko
25d6b80ad8
[docs] Remove "never thrown" note from docs for TarError.wrongField
2018-08-05 13:06:11 +03:00
Timofey Solomko
02f7db0e39
[TAR] TarEntryInfo.size is now never nil (again)
...
This fixes potential force-unwrapping crashes in TarEntryInfoProvider and makes TarError.wrongField being in use again.
2018-08-05 13:05:35 +03:00
Timofey Solomko
1d0af24755
[TAR] Create pax headers if name or linkname cannot fit into tar header
2018-07-31 21:03:49 +03:00
Timofey Solomko
bf96273ea8
[TAR] Apply base-256 encoding to negative values as well
2018-07-31 18:56:18 +03:00
Timofey Solomko
6477cc63e7
[TAR] Restore info.size being nil for directories
2018-07-30 22:46:02 +03:00
Timofey Solomko
4b0a361aea
[TAR] Add ext headers creation to TarContainer.create
2018-07-29 19:25:12 +03:00