Copyright | Copyright (C) 2014 John MacFarlane |
---|---|
License | GNU GPL, version 2 or above |
Maintainer | John MacFarlane <jgm@berkeley.edu> |
Stability | alpha |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
Definition of a MediaBag object to hold binary resources, and an interface for interacting with it.
- data MediaBag
- lookupMedia :: FilePath -> MediaBag -> Maybe (MimeType, ByteString)
- insertMedia :: FilePath -> Maybe MimeType -> ByteString -> MediaBag -> MediaBag
- mediaDirectory :: MediaBag -> [(String, MimeType, Int)]
- extractMediaBag :: Bool -> FilePath -> MediaBag -> IO ()
Documentation
lookupMedia :: FilePath -> MediaBag -> Maybe (MimeType, ByteString) Source #
Lookup a media item in a MediaBag
, returning mime type and contents.
:: FilePath | relative path and canonical name of resource |
-> Maybe MimeType | mime type (Nothing = determine from extension) |
-> ByteString | contents of resource |
-> MediaBag | |
-> MediaBag |
Insert a media item into a MediaBag
, replacing any existing
value with the same name.