Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Zip = Zip (ForeignPtr Zip_t)
- data OpenFlag = O_CHECKCONS
- openFlags :: Map OpenFlag CInt
- openZip :: FilePath -> [OpenFlag] -> IO Zip
- getNumEntries :: Zip -> IO Int
- data PathFlag
- pathFlags :: Map PathFlag Zip_flags_t
- getPathByIndex :: Zip -> Int -> [PathFlag] -> IO ByteString
- data File = File !(Ptr Zip_file_t) !IOFinalizer
- data GetFileFlag = GF_FL_COMPRESSED
- getFileFlags :: Map GetFileFlag Zip_flags_t
- getFileByPathOrIndex :: Zip -> [GetFileFlag] -> Either String Int -> IO File
- unfoldFile :: MonadIO m => Unfold m (Zip, [GetFileFlag], Either String Int) ByteString
- chunkSize :: Zip_uint64_t
- combineFlags :: (Ord flagType, Bits a, Num a) => Map flagType a -> [flagType] -> a
- unfoldFileAtPath :: MonadIO m => Unfold m (Zip, [GetFileFlag], String) ByteString
- unfoldFileAtIndex :: MonadIO m => Unfold m (Zip, [GetFileFlag], Int) ByteString
Documentation
O_CHECKCONS | Perform additional stricter consistency checks on the archive, and error if they fail. |
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.
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 # |
getFileByPathOrIndex :: Zip -> [GetFileFlag] -> Either String Int -> IO File Source #
unfoldFile :: MonadIO m => Unfold m (Zip, [GetFileFlag], Either String Int) ByteString Source #
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.