Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Zip
- data OpenFlag = O_CHECKCONS
- openZip :: FilePath -> [OpenFlag] -> IO Zip
- getNumEntries :: Zip -> IO Int
- data PathFlag
- getPathByIndex :: Zip -> Int -> [PathFlag] -> IO ByteString
- data GetFileFlag = GF_FL_COMPRESSED
- unfoldFileAtPath :: MonadIO m => Unfold m (Zip, [GetFileFlag], String) ByteString
- unfoldFileAtIndex :: MonadIO m => Unfold m (Zip, [GetFileFlag], Int) ByteString
Open archive
O_CHECKCONS | Perform additional stricter consistency checks on the archive, and error if they fail. |
Archive information
Paths
P_FL_ENC_RAW | Return the unmodified names as it is in the ZIP archive. |
P_FL_ENC_GUESS | (Default.) Guess the encoding of the name in the ZIP archive and convert it to UTF-8, if necessary. (Only CP-437 and UTF-8 are recognized.) |
P_FL_ENC_STRICT | Follow the ZIP specification and expect CP-437 encoded names in the ZIP archive (except if they are explicitly marked as UTF-8). Convert it to UTF-8. |
getPathByIndex :: Zip -> Int -> [PathFlag] -> IO ByteString Source #
Gets the path (e.g., "foo.txt"
, "foo/"
, or "foo/bar.txt"
) of the file at the given
0-based index in the given zip archive. Please use getNumEntries
to find the upper bound for
the index.
Streamly
data GetFileFlag Source #
GF_FL_COMPRESSED | Read the compressed data. Otherwise the data is uncompressed when reading. |
Instances
Eq GetFileFlag Source # | |
Defined in Streamly.External.Zip.Internal (==) :: GetFileFlag -> GetFileFlag -> Bool # (/=) :: GetFileFlag -> GetFileFlag -> Bool # | |
Ord GetFileFlag Source # | |
Defined in Streamly.External.Zip.Internal compare :: GetFileFlag -> GetFileFlag -> Ordering # (<) :: GetFileFlag -> GetFileFlag -> Bool # (<=) :: GetFileFlag -> GetFileFlag -> Bool # (>) :: GetFileFlag -> GetFileFlag -> Bool # (>=) :: GetFileFlag -> GetFileFlag -> Bool # max :: GetFileFlag -> GetFileFlag -> GetFileFlag # min :: GetFileFlag -> GetFileFlag -> GetFileFlag # |
unfoldFileAtPath :: MonadIO m => Unfold m (Zip, [GetFileFlag], String) ByteString Source #
Creates an Unfold
with which one can stream data out of the entry at the given path (e.g.,
"foo.txt"
, "foo/"
, or "foo/bar.txt"
).
unfoldFileAtIndex :: MonadIO m => Unfold m (Zip, [GetFileFlag], Int) ByteString Source #
Creates an Unfold
with which one can stream data out of the entry at the given index. Please
use getNumEntries
to find the upper bound for the index.