Safe Haskell | None |
---|---|
Language | Haskell2010 |
(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
- 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.