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
Timofey Solomko
d33ae76d85
[TAR] Add initializer to ext header which creates header with only necessary fields
2018-07-29 19:24:19 +03:00
Timofey Solomko
b0be2ab38f
[TAR] Sync TarEntry.data.count and TarEntry.info.size via property observer
2018-07-29 19:23:05 +03:00
Timofey Solomko
52b8a62f93
[TAR] Make TarEntry's info and data var-properties
2018-07-29 19:22:27 +03:00
Timofey Solomko
74b50be568
[TAR] Make TarEntry.init public and add argument labels
2018-07-29 19:21:25 +03:00
Timofey Solomko
9c7937504e
[TAR] Add ustar implementation part of TarEntryInfo.generateContainerData
2018-07-29 18:04:25 +03:00
Timofey Solomko
d3949524a1
[TAR] Add create function to TarContainer
2018-07-29 18:04:24 +03:00
Timofey Solomko
57a87dc1c8
[TAR] Implement TarEntry.generateContainerData()
2018-07-29 18:04:24 +03:00
Timofey Solomko
16e7fc7d44
[TAR] Add pre-POSIX implementation part of TarEntryInfo.generateContainerData()
2018-07-29 18:04:24 +03:00
Timofey Solomko
0281f11a86
[TAR] Add Data extension function which appends string field
2018-07-29 18:04:24 +03:00
Timofey Solomko
40ea63c456
[TAR] Add Data extension which appends numeric field value either in octal or base-256 format
2018-07-29 18:04:24 +03:00
Timofey Solomko
46bf2a6d94
[TAR] Add fileprivate extension to Data which works like String.padding and Data.prefix combined
2018-07-29 18:04:19 +03:00
Timofey Solomko
2e40dc903a
[TAR] Add fileTypeIndicator property to TAR's ContainerEntryType extension
2018-07-29 18:04:19 +03:00
Timofey Solomko
dcabef6e95
[TAR] Add basic public initializer to TarEntryInfo
...
It takes two the most necessary properties of EntryInfo as arguments: name and type.
2018-07-29 18:04:19 +03:00
Timofey Solomko
14a4df3182
[TAR] Make almost all properties of TarEntryInfo var (instead of let)
...
This also makes several nil-initializations redundant.
2018-07-29 18:04:11 +03:00
Timofey Solomko
3725c14fe4
[TAR] Implement generateContainerData for extended header
2018-07-25 20:59:03 +03:00
Timofey Solomko
14b3fb2774
[TAR] Add enum for creation errors
...
First case: unable to encode a string with UTF-8 encoding
2018-07-25 20:59:03 +03:00
Timofey Solomko
53d0c951e5
[TAR] Make extended header's unknownRecords variable and add empty init() so extended header could be used in tests
2018-07-25 20:59:03 +03:00
Timofey Solomko
f2e3a02518
[TAR] Skip leading zeros and whitespaces in numeric fields
...
This is used by some other (old) implementations.
2018-07-25 20:49:13 +03:00
Timofey Solomko
d17e772abf
[TAR] Support Sun's version of pax extended headers
...
Their version's only noticeable difference is in the typeflag (aka fileTypeIndicator) used ("X" instead of "x").
2018-07-24 22:52:34 +03:00
Timofey Solomko
1a583b5bc8
[TAR] Remove radix argument from ByteReader.tarInt function
...
Reason: it is always equals to 8.
2018-07-24 22:42:52 +03:00
Timofey Solomko
e795924b5d
[TAR] Correctly read device major/minor number as octal number
2018-07-24 22:42:05 +03:00
Timofey Solomko
3a208ee047
[TAR] Handle base-256 encoding used for big or negative integer fields
2018-07-23 19:04:14 +03:00