Copyright | (C) 2015-2018 Virtual Forge GmbH |
---|---|
License | GPL2 |
Maintainer | Hans-Christian Esperer <hc@hcesperer.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
| (De-)compress SAPCAR files
- data SapCar s m a
- data CarEntry s = CarEntry {
- cfFileType :: !CarFileType
- cfPermissions :: !Word32
- cfLength :: !Word32
- cfTimestamp :: !Word32
- cfFileName :: !Text
- cfFileOffset :: !Int64
- cfPayloadOffset :: !Int64
- data CarFileType
- carEntryFilename :: CarEntry s -> Text
- withSapCarFile :: (MonadIO m, MonadThrow m, MonadMask m) => FilePath -> (forall s. SapCar s m a) -> m a
- withSapCarPath :: (MonadIO m, MonadThrow m, MonadMask m) => Path b File -> (forall s. SapCar s m a) -> m a
- withSapCarHandle :: (MonadIO m, MonadThrow m, MonadMask m) => (forall s. SapCar s m a) -> Handle -> m a
- getEntries :: MonadIO m => SapCar s m [CarEntry s]
- sourceEntry :: MonadIO m => CarEntry s -> Sink ByteString IO a -> SapCar s m a
- writeToFile :: (MonadIO m, MonadMask m, MonadThrow m) => CarEntry s -> Path b File -> SapCar s m ()
- writeToHandle :: (MonadIO m, MonadMask m, MonadThrow m) => CarEntry s -> Handle -> SapCar s m ()
Documentation
The SAPCAR monad. All operations on SAPCAR files should happen inside this monad.
Monad m => Monad (SapCar s m) Source # | |
Functor m => Functor (SapCar s m) Source # | |
Monad m => Applicative (SapCar s m) Source # | |
MonadIO m => MonadIO (SapCar s m) Source # | |
MonadThrow m => MonadThrow (SapCar s m) Source # | |
MonadCatch m => MonadCatch (SapCar s m) Source # | |
MonadMask m => MonadMask (SapCar s m) Source # | |
Meta information about a single file or directory in a SAPCAR archive
CarEntry | |
|
data CarFileType Source #
The type of an entry in the SAPCAR file
CarFile | A regular file |
CarDirectory | A directory |
CarUnknown | Something else |
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.