zip-stream-0.2.2.0: ZIP archive streaming using conduits

Safe Haskell | None
Language | Haskell2010

Codec.Archive.Zip.Conduit.Types

Synopsis

- newtype ZipError = ZipError String
- data ZipInfo = ZipInfo {
  - zipComment :: ByteString
  }
- data ZipEntry = ZipEntry {
  - zipEntryName :: Either Text ByteString
  - zipEntryTime :: LocalTime
  - zipEntrySize :: Maybe Word64
  - zipEntryExternalAttributes :: Maybe Word32
  }
- data ZipData (m :: Type -> Type)
  - = ZipDataByteString ByteString
  - | ZipDataSource (ConduitM () ByteString m ())
- sourceZipData :: forall (m :: Type -> Type). Monad m => ZipData m -> ConduitM () ByteString m ()

# Documentation

newtype ZipError Source #

Errors thrown during zip file processing

Constructors

ZipError String |

#### Instances

Instances details

IsString ZipError Source # |
Instance details Defined in Codec.Archive.Zip.Conduit.Types Methods fromString :: String -> ZipError Source #
Exception ZipError Source # |
Instance details Defined in Codec.Archive.Zip.Conduit.Types Methods toException :: ZipError -> SomeException Source # fromException :: SomeException -> Maybe ZipError Source # displayException :: ZipError -> String Source # backtraceDesired :: ZipError -> Bool Source #
Show ZipError Source # |
Instance details Defined in Codec.Archive.Zip.Conduit.Types Methods showsPrec :: Int -> ZipError -> ShowS Source # show :: ZipError -> String Source # showList :: [ZipError] -> ShowS Source #

data ZipInfo Source #

Summary information at the end of a zip stream.

Constructors

ZipInfo |

Fields

- zipComment :: ByteString

#### Instances

Instances details

Show ZipInfo Source # |
Instance details Defined in Codec.Archive.Zip.Conduit.Types Methods showsPrec :: Int -> ZipInfo -> ShowS Source # show :: ZipInfo -> String Source # showList :: [ZipInfo] -> ShowS Source #
Eq ZipInfo Source # |
Instance details Defined in Codec.Archive.Zip.Conduit.Types Methods (==) :: ZipInfo -> ZipInfo -> Bool Source # (/=) :: ZipInfo -> ZipInfo -> Bool Source #

data ZipEntry Source #

(The beginning of) a single entry in a zip stream, which may be any file or directory. As per zip file conventions, directory names should end with a slash and have no data, but this library does not ensure that.

Constructors

ZipEntry |

Fields

- zipEntryName :: Either Text ByteString

  File name (in posix format, no leading slashes), either UTF-8 encoded text or raw bytes (CP437), with a trailing slash for directories

- zipEntryTime :: LocalTime

  Modification time

- zipEntrySize :: Maybe Word64

  Size of file data (if known); checked on zipping and also used as hint to enable zip64. Disables compression for known 0-byte files.

- zipEntryExternalAttributes :: Maybe Word32

  Host-dependent attributes, often MS-DOS directory attribute byte (only supported when zipping)

#### Instances

Instances details

Show ZipEntry Source # |
Instance details Defined in Codec.Archive.Zip.Conduit.Types Methods showsPrec :: Int -> ZipEntry -> ShowS Source # show :: ZipEntry -> String Source # showList :: [ZipEntry] -> ShowS Source #
Eq ZipEntry Source # |
Instance details Defined in Codec.Archive.Zip.Conduit.Types Methods (==) :: ZipEntry -> ZipEntry -> Bool Source # (/=) :: ZipEntry -> ZipEntry -> Bool Source #

data ZipData (m :: Type -> Type) Source #

The data contents for a `ZipEntry`. For empty entries (e.g., directories), use `mempty`.

Constructors

ZipDataByteString ByteString | A known ByteString, which will be fully evaluated (not streamed)
ZipDataSource (ConduitM () ByteString m ()) | A byte stream producer, streamed (and compressed) directly into the zip

#### Instances

Instances details

Monad m => Monoid (ZipData m) Source # |
Instance details Defined in Codec.Archive.Zip.Conduit.Types Methods mempty :: ZipData m Source # mappend :: ZipData m -> ZipData m -> ZipData m Source # mconcat :: [ZipData m] -> ZipData m Source #
Monad m => Semigroup (ZipData m) Source # |
Instance details Defined in Codec.Archive.Zip.Conduit.Types Methods (<>) :: ZipData m -> ZipData m -> ZipData m Source # sconcat :: NonEmpty (ZipData m) -> ZipData m Source # stimes :: Integral b => b -> ZipData m -> ZipData m Source #

sourceZipData :: forall (m :: Type -> Type). Monad m => ZipData m -> ConduitM () ByteString m () Source #

Normalize any `ZipData` to a simple source