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

-- | Parsers for the HTTP multipart format
--   
--   Parsers and data types for the HTTP multipart format from RFC2046.
@package multipart
@version 0.2.1

-- | Parsing of HTTP headers (name, value pairs) Partly based on code from
--   WASHMail.
module Network.Multipart.Header

-- | HTTP headers.
type Headers = [(HeaderName, String)]

-- | A string with case insensitive equality and comparisons.
newtype HeaderName
HeaderName :: String -> HeaderName
class HeaderValue a
parseHeaderValue :: HeaderValue a => Parser a
prettyHeaderValue :: HeaderValue a => a -> String
pHeaders :: Parser Headers

-- | A MIME media type value. The Show instance is derived
--   automatically. Use showContentType to obtain the standard
--   string representation. See http://www.ietf.org/rfc/rfc2046.txt
--   for more information about MIME media types.
data ContentType
ContentType :: String -> String -> [(String, String)] -> ContentType

-- | The top-level media type, the general type of the data. Common
--   examples are "text", "image", "audio", "video", "multipart", and
--   "application".
[ctType] :: ContentType -> String

-- | The media subtype, the specific data format. Examples include "plain",
--   "html", "jpeg", "form-data", etc.
[ctSubtype] :: ContentType -> String

-- | Media type parameters. On common example is the charset parameter for
--   the "text" top-level type, e.g. ("charset","ISO-8859-1").
[ctParameters] :: ContentType -> [(String, String)]
getContentType :: MonadFail m => Headers -> m ContentType

-- | Parse the standard representation of a content-type. If the input
--   cannot be parsed, this function calls fail with a (hopefully)
--   informative error message.
parseContentType :: MonadFail m => String -> m ContentType
showContentType :: ContentType -> String
data ContentTransferEncoding
ContentTransferEncoding :: String -> ContentTransferEncoding
getContentTransferEncoding :: MonadFail m => Headers -> m ContentTransferEncoding
data ContentDisposition
ContentDisposition :: String -> [(String, String)] -> ContentDisposition
getContentDisposition :: MonadFail m => Headers -> m ContentDisposition
parseM :: MonadFail m => Parser a -> SourceName -> String -> m a
caseInsensitiveEq :: String -> String -> Bool
caseInsensitiveCompare :: String -> String -> Ordering
lexeme :: Parser a -> Parser a

-- | RFC 822 LWSP-char
ws1 :: Parser Char
p_token :: Parser String
instance GHC.Classes.Eq Network.Multipart.Header.ContentDisposition
instance GHC.Classes.Eq Network.Multipart.Header.ContentTransferEncoding
instance GHC.Classes.Eq Network.Multipart.Header.ContentType
instance GHC.Classes.Eq Network.Multipart.Header.HeaderName
instance Network.Multipart.Header.HeaderValue Network.Multipart.Header.ContentDisposition
instance Network.Multipart.Header.HeaderValue Network.Multipart.Header.ContentTransferEncoding
instance Network.Multipart.Header.HeaderValue Network.Multipart.Header.ContentType
instance GHC.Classes.Ord Network.Multipart.Header.ContentDisposition
instance GHC.Classes.Ord Network.Multipart.Header.ContentTransferEncoding
instance GHC.Classes.Ord Network.Multipart.Header.ContentType
instance GHC.Classes.Ord Network.Multipart.Header.HeaderName
instance GHC.Internal.Read.Read Network.Multipart.Header.ContentDisposition
instance GHC.Internal.Read.Read Network.Multipart.Header.ContentTransferEncoding
instance GHC.Internal.Read.Read Network.Multipart.Header.ContentType
instance GHC.Internal.Show.Show Network.Multipart.Header.ContentDisposition
instance GHC.Internal.Show.Show Network.Multipart.Header.ContentTransferEncoding
instance GHC.Internal.Show.Show Network.Multipart.Header.ContentType
instance GHC.Internal.Show.Show Network.Multipart.Header.HeaderName

-- | Parsing of the multipart format from RFC2046. Partly based on code
--   from WASHMail.
module Network.Multipart
data MultiPart
MultiPart :: [BodyPart] -> MultiPart
data BodyPart
BodyPart :: Headers -> ByteString -> BodyPart

-- | Read a multi-part message from a ByteString.
parseMultipartBody :: String -> ByteString -> MultiPart

-- | Read a multi-part message from a Handle. Fails on parse errors.
hGetMultipartBody :: String -> Handle -> IO MultiPart
showMultipartBody :: String -> MultiPart -> ByteString

-- | HTTP headers.
type Headers = [(HeaderName, String)]

-- | A string with case insensitive equality and comparisons.
newtype HeaderName
HeaderName :: String -> HeaderName

-- | A MIME media type value. The Show instance is derived
--   automatically. Use showContentType to obtain the standard
--   string representation. See http://www.ietf.org/rfc/rfc2046.txt
--   for more information about MIME media types.
data ContentType
ContentType :: String -> String -> [(String, String)] -> ContentType

-- | The top-level media type, the general type of the data. Common
--   examples are "text", "image", "audio", "video", "multipart", and
--   "application".
[ctType] :: ContentType -> String

-- | The media subtype, the specific data format. Examples include "plain",
--   "html", "jpeg", "form-data", etc.
[ctSubtype] :: ContentType -> String

-- | Media type parameters. On common example is the charset parameter for
--   the "text" top-level type, e.g. ("charset","ISO-8859-1").
[ctParameters] :: ContentType -> [(String, String)]
data ContentTransferEncoding
ContentTransferEncoding :: String -> ContentTransferEncoding
data ContentDisposition
ContentDisposition :: String -> [(String, String)] -> ContentDisposition

-- | Parse the standard representation of a content-type. If the input
--   cannot be parsed, this function calls fail with a (hopefully)
--   informative error message.
parseContentType :: MonadFail m => String -> m ContentType
getContentType :: MonadFail m => Headers -> m ContentType
getContentTransferEncoding :: MonadFail m => Headers -> m ContentTransferEncoding
getContentDisposition :: MonadFail m => Headers -> m ContentDisposition
instance GHC.Classes.Eq Network.Multipart.BodyPart
instance GHC.Classes.Eq Network.Multipart.MultiPart
instance GHC.Classes.Ord Network.Multipart.BodyPart
instance GHC.Classes.Ord Network.Multipart.MultiPart
instance GHC.Internal.Show.Show Network.Multipart.BodyPart
instance GHC.Internal.Show.Show Network.Multipart.MultiPart
