Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New lower-level reading functions #68

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Conversation

nhz2
Copy link
Member

@nhz2 nhz2 commented Aug 29, 2024

This PR exports three new functions useful for lower-level reading of raw entry data.

zip_compression_method(x::HasEntries, i::Integer)::UInt16

Return the compression method used for entry i.
See https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT for a current list of methods.
Only Store(0x0000) and Deflate(0x0008) supported for now.
Note: if the zip file was corrupted, this might be wrong.

zip_general_purpose_bit_flag(x::HasEntries, i::Integer)::UInt16

Return the general purpose bit flag for entry i.

See https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
for a description of the bits.

zip_entry_data_offset(r::ZipReader, i::Integer)::Int64

Return the offset of the start of the compressed data for entry i from
the start of the buffer in r.
Throw an error if the local header is invalid.

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.61%. Comparing base (30cf2f7) to head (49ce34a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #68   +/-   ##
=======================================
  Coverage   99.61%   99.61%           
=======================================
  Files           6        6           
  Lines         783      784    +1     
=======================================
+ Hits          780      781    +1     
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nhz2 nhz2 merged commit 301fb33 into main Aug 29, 2024
20 checks passed
@nhz2 nhz2 deleted the export-new-low-level-methods branch August 29, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant