hascar-0.2.2.0: Decompress SAPCAR archives

Safe HaskellNone
LanguageHaskell2010

Codec.Archive.SAPCAR

Description

(De-)compress SAPCAR files

Copyright (C) 2016, Virtual Forge GmbH

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Synopsis

Documentation

data SapCar s m a Source #

The SAPCAR monad. All operations on SAPCAR files should happen inside this monad.

Instances

Monad m => Monad (SapCar s m) Source # 

Methods

(>>=) :: SapCar s m a -> (a -> SapCar s m b) -> SapCar s m b #

(>>) :: SapCar s m a -> SapCar s m b -> SapCar s m b #

return :: a -> SapCar s m a #

fail :: String -> SapCar s m a #

Functor m => Functor (SapCar s m) Source # 

Methods

fmap :: (a -> b) -> SapCar s m a -> SapCar s m b #

(<$) :: a -> SapCar s m b -> SapCar s m a #

Monad m => Applicative (SapCar s m) Source # 

Methods

pure :: a -> SapCar s m a #

(<*>) :: SapCar s m (a -> b) -> SapCar s m a -> SapCar s m b #

liftA2 :: (a -> b -> c) -> SapCar s m a -> SapCar s m b -> SapCar s m c #

(*>) :: SapCar s m a -> SapCar s m b -> SapCar s m b #

(<*) :: SapCar s m a -> SapCar s m b -> SapCar s m a #

MonadIO m => MonadIO (SapCar s m) Source # 

Methods

liftIO :: IO a -> SapCar s m a #

MonadThrow m => MonadThrow (SapCar s m) Source # 

Methods

throwM :: Exception e => e -> SapCar s m a #

MonadCatch m => MonadCatch (SapCar s m) Source # 

Methods

catch :: Exception e => SapCar s m a -> (e -> SapCar s m a) -> SapCar s m a #

MonadMask m => MonadMask (SapCar s m) Source # 

Methods

mask :: ((forall a. SapCar s m a -> SapCar s m a) -> SapCar s m b) -> SapCar s m b #

uninterruptibleMask :: ((forall a. SapCar s m a -> SapCar s m a) -> SapCar s m b) -> SapCar s m b #

data CarEntry s Source #

Meta information about a single file or directory in a SAPCAR archive

Constructors

CarEntry 

Fields

Instances

carEntryFilename :: CarEntry s -> Text Source #

Get the filename of a car entry

withSapCarFile :: (MonadIO m, MonadThrow m, MonadMask m) => FilePath -> (forall s. SapCar s m a) -> m a Source #

Run all actions in the SapCar monad.

withSapCarPath :: (MonadIO m, MonadThrow m, MonadMask m) => Path b File -> (forall s. SapCar s m a) -> m a Source #

Run all actions in the SapCar monad.

withSapCarHandle :: (MonadIO m, MonadThrow m, MonadMask m) => (forall s. SapCar s m a) -> Handle -> m a Source #

Run all actions in the SapCar monad.

getEntries :: MonadIO m => SapCar s m [CarEntry s] Source #

Get all entries contained inside the SapCar file.

sourceEntry :: MonadIO m => CarEntry s -> Sink ByteString IO a -> SapCar s m a Source #

Stream the contents of the given SapCar entry to the specified conduit sink.

writeToFile :: (MonadIO m, MonadMask m, MonadThrow m) => CarEntry s -> Path b File -> SapCar s m () Source #

Write a SapCar entry to the specified file.

writeToHandle :: (MonadIO m, MonadMask m, MonadThrow m) => CarEntry s -> Handle -> SapCar s m () Source #

Write a SapCar entry to the specified handle.