Commit 6136d0a
committed
Tar: allow reading archive content while iterating over archive entries.
So far there was no way to read the data from a file in an archive
without extracting it and extraction of a single file required rereading
of a whole archive. This commit changes the yieldContents() in a way it
does not skip to the next header entry before returning a current header
content. A position of the next header entry is remembered instead and
rewinded to only at the next next() call on the generator. This allows
to read the current entry content until the next() call. For that the
Tar::readCurrentEntry() method was added.1 parent 3e51582 commit 6136d0a
1 file changed
+21
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
121 | | - | |
| 124 | + | |
| 125 | + | |
122 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| 135 | + | |
126 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
127 | 141 | | |
128 | 142 | | |
129 | 143 | | |
| |||
439 | 453 | | |
440 | 454 | | |
441 | 455 | | |
442 | | - | |
| 456 | + | |
443 | 457 | | |
444 | | - | |
| 458 | + | |
445 | 459 | | |
446 | | - | |
| 460 | + | |
447 | 461 | | |
| 462 | + | |
| 463 | + | |
448 | 464 | | |
449 | 465 | | |
450 | 466 | | |
| |||
494 | 510 | | |
495 | 511 | | |
496 | 512 | | |
| 513 | + | |
497 | 514 | | |
498 | 515 | | |
499 | 516 | | |
| |||
0 commit comments