package SZXX
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module SZXX.ZipSource
type descriptor = {crc : Core_kernel.Int32.t;compressed_size : Core_kernel.Int64.t;uncompressed_size : Core_kernel.Int64.t;
}type entry = {version_needed : version;flags : int;trailing_descriptor_present : bool;methd : methd;descriptor : descriptor;filename : string;extra_fields : extra_field list;
}val stream_files :
feed:feed ->
(entry -> 'a Action.t) ->
(entry * 'a Data.t) Lwt_stream.t * unit Lwt.tStream files.
SZXX.Zip.stream_files ~feed callback
feed: Produces data for the parser. This data can be simple strings or bigstrings. Return None to indicate EOF.
callback: function called on every file found within the ZIP archive. You must choose an Action for SZXX to perform over each file encountered within the ZIP archive.
Return Action.Skip to skip over the compressed bytes of this file without attempting to uncompress them. Return Action.String to collect the whole uncompressed file into a single string. Return Action.Fold_string to fold this file into a final state, in string chunks of ~1k-5k. Return Action.Fold_bigstring to fold this file into a final state, in bigstring chunks of ~1k-5k. Return Action.Parse to apply an Angstrom.t parser to the file while it is being uncompressed without having to fully uncompress it first.
This function returns stream * success_promise stream contains all files in the same order they were found in the archive. success_promise is a promise that resolves once the entire zip archive has been processed.
Important: bind to/await success_promise in order to capture any errors encountered while processing the file.
See README.md for examples on how to use it.