Expose stream, seek, and span archive input modes - #373
Merged
Merged
Conversation
Hawkynt
force-pushed
the
feat/archive-input-modes
branch
7 times, most recently
from
September 19, 2026 03:18
a63779c to
adbc8c3
Compare
Hawkynt
force-pushed
the
feat/archive-input-modes
branch
from
September 19, 2026 03:45
adbc8c3 to
6eacce5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
*Streaming,*Seekable, and*Spanread/list/extract entry points toIArchiveFormatOperations.Streammethods as the compatibility/native descriptor hooks, so every existing archive and pseudo-archive gains all three source modes without duplicating adapter code.Design decisions
Libarchive was used as architectural reference, not as implementation source. Its archive-read API treats forward reads as the primary callback, exposes seek separately, and supports memory-backed input. CompressionWorkbench now exposes the same three input shapes at the common archive/pseudo-archive boundary while preserving existing descriptor implementations.
The compatibility streaming path does not pretend a legacy random-access parser is genuinely one-pass: it spools only when the caller supplies a non-seekable stream. Formats with true sequential parsers can override
ListStreaming,ExtractStreaming, andOpenEntryStreaming. Native random-access parsers can override the*Seekablepath, and native span parsers can overrideListSpan,ExtractSpan, andOpenEntrySpanto avoid the compatibility copy.The span API uses explicit
*Spannames instead of overloads. An initial overload design made existing XML references toIArchiveFormatOperations.Listambiguous throughout the repository; explicit mode names preserve source/documentation compatibility and make the three source capabilities obvious at call sites.No new dependencies were introduced. No libarchive source code was copied or translated.
Reference material
archive.hread/skip/seek callback contractValidation
crefsyntax and the ambiguous span-overload design.