-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Library for creating and modifying zip archives.
--   
--   The zip-archive library provides functions for creating, modifying,
--   and extracting files from zip archives.
@package zip-archive
@version 0.1.3.4

-- | The zip-archive library provides functions for creating, modifying,
--   and extracting files from zip archives.
--   
--   Certain simplifying assumptions are made about the zip archives: in
--   particular, there is no support for encryption, zip files that span
--   multiple disks, ZIP64, OS-specific file attributes, or compression
--   methods other than Deflate. However, the library should be able to
--   read the most common zip archives, and the archives it produces should
--   be readable by all standard unzip programs.
--   
--   As an example of the use of the library, a standalone zip archiver and
--   extracter, Zip.hs, is provided in the source distribution.
--   
--   For more information on the format of zip archives, consult
--   http://www.pkware.com/documents/casestudies/APPNOTE.TXT
module Codec.Archive.Zip

-- | Structured representation of a zip archive, including directory
--   information and contents (in lazy bytestrings).
data Archive
Archive :: [Entry] -> Maybe ByteString -> ByteString -> Archive

-- | Files in zip archive
zEntries :: Archive -> [Entry]

-- | Digital signature
zSignature :: Archive -> Maybe ByteString

-- | Comment for whole zip archive
zComment :: Archive -> ByteString

-- | Representation of an archived file, including content and metadata.
data Entry
Entry :: FilePath -> CompressionMethod -> Integer -> Word32 -> Word32 -> Word32 -> ByteString -> ByteString -> Word16 -> Word32 -> ByteString -> Entry

-- | Relative path, using / as separator
eRelativePath :: Entry -> FilePath

-- | Compression method
eCompressionMethod :: Entry -> CompressionMethod

-- | Modification time (seconds since unix epoch)
eLastModified :: Entry -> Integer

-- | CRC32 checksum
eCRC32 :: Entry -> Word32

-- | Compressed size in bytes
eCompressedSize :: Entry -> Word32

-- | Uncompressed size in bytes
eUncompressedSize :: Entry -> Word32

-- | Extra field - unused by this library
eExtraField :: Entry -> ByteString

-- | File comment - unused by this library
eFileComment :: Entry -> ByteString

-- | Internal file attributes - unused by this library
eInternalFileAttributes :: Entry -> Word16

-- | External file attributes (system-dependent)
eExternalFileAttributes :: Entry -> Word32

-- | Compressed contents of file
eCompressedData :: Entry -> ByteString

-- | Compression methods.
data CompressionMethod
Deflate :: CompressionMethod
NoCompression :: CompressionMethod

-- | Options for addFilesToArchive and
--   extractFilesFromArchive.
data ZipOption

-- | Recurse into directories when adding files
OptRecursive :: ZipOption

-- | Print information to stderr
OptVerbose :: ZipOption

-- | A zip archive with no contents.
emptyArchive :: Archive

-- | Reads an Archive structure from a raw zip archive (in a lazy
--   bytestring).
toArchive :: ByteString -> Archive

-- | Writes an Archive structure to a raw zip archive (in a lazy
--   bytestring).
fromArchive :: Archive -> ByteString

-- | Returns a list of files in a zip archive.
filesInArchive :: Archive -> [FilePath]

-- | Adds an entry to a zip archive, or updates an existing entry.
addEntryToArchive :: Entry -> Archive -> Archive

-- | Deletes an entry from a zip archive.
deleteEntryFromArchive :: FilePath -> Archive -> Archive

-- | Returns Just the zip entry with the specified path, or Nothing.
findEntryByPath :: FilePath -> Archive -> Maybe Entry

-- | Returns uncompressed contents of zip entry.
fromEntry :: Entry -> ByteString

-- | Create an Entry with specified file path, modification time,
--   and contents.
toEntry :: FilePath -> Integer -> ByteString -> Entry

-- | Generates a Entry from a file or directory.
readEntry :: [ZipOption] -> FilePath -> IO Entry

-- | Writes contents of an Entry to a file.
writeEntry :: [ZipOption] -> Entry -> IO ()

-- | Add the specified files to an Archive. If OptRecursive
--   is specified, recursively add files contained in directories. If
--   OptVerbose is specified, print messages to stderr.
addFilesToArchive :: [ZipOption] -> Archive -> [FilePath] -> IO Archive

-- | Extract all files from an Archive, creating directories as
--   needed. If OptVerbose is specified, print messages to stderr.
--   Note that the last-modified time is set correctly only in POSIX, not
--   in Windows.
extractFilesFromArchive :: [ZipOption] -> Archive -> IO ()
instance Read CompressionMethod
instance Show CompressionMethod
instance Eq CompressionMethod
instance Read Entry
instance Show Entry
instance Eq Entry
instance Read Archive
instance Show Archive
instance Read ZipOption
instance Show ZipOption
instance Eq ZipOption
instance Read MSDOSDateTime
instance Show MSDOSDateTime
instance Eq MSDOSDateTime
