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

-- | Working with MIME types.
--   
--   Working with MIME types.
@package mime
@version 0.4.0.2

-- | Base64 decoding and encoding routines, multiple entry points for
--   either depending on use and level of control wanted over the encoded
--   output (and its input form on the decoding side.)
module Codec.MIME.Base64
encodeRaw :: Bool -> [Word8] -> String
encodeRawString :: Bool -> String -> String

-- | encodeRawPrim lets you control what non-alphanum characters
--   to use (The base64url variation uses * and -, for
--   instance.) No support for mapping these to multiple characters in the
--   output though.
encodeRawPrim :: Bool -> Char -> Char -> [Word8] -> String

-- | formatOutput n mbLT str formats str, splitting it
--   into lines of length n. The optional value lets you control
--   what line terminator sequence to use; the default is CRLF (as per
--   MIME.)
formatOutput :: Int -> Maybe String -> String -> String
decode :: String -> [Word8]
decodeToString :: String -> String
decodePrim :: Char -> Char -> String -> [Word8]

module Codec.MIME.QuotedPrintable

-- | decode incoming quoted-printable content, stripping out soft
--   line breaks and translating =XY sequences into their decoded
--   byte/octet. The output encoding/representation is still a String, not
--   a sequence of bytes.
decode :: String -> String

-- | encode converts a sequence of characeter _octets_ into
--   quoted-printable form; suitable for transmission in MIME payloads.
--   Note the stress on _octets_; it is assumed that you have already
--   converted Unicode into a <=8-bit encoding (UTF-8, most likely.)
encode :: String -> String

module Codec.MIME.Decode

-- | decodeBody enc str decodes str according to the
--   scheme specified by enc. Currently, base64 and
--   quoted-printable are the only two encodings supported. If you
--   supply anything else for enc, decodeBody returns
--   str.
decodeBody :: String -> String -> String
decodeWord :: String -> Maybe (String, String)
decodeWords :: String -> String

-- | Representing MIME types and values.
module Codec.MIME.Type
data MIMEParam
MIMEParam :: Text -> Text -> MIMEParam
[paramName] :: MIMEParam -> Text
[paramValue] :: MIMEParam -> Text
data Type
Type :: MIMEType -> [MIMEParam] -> Type
[mimeType] :: Type -> MIMEType
[mimeParams] :: Type -> [MIMEParam]

-- | The null MIME record type value; currently a
--   text/plain.
nullType :: Type
showType :: Type -> Text
showMIMEParams :: [MIMEParam] -> Text
data MIMEType
Application :: SubType -> MIMEType
Audio :: SubType -> MIMEType
Image :: SubType -> MIMEType
Message :: SubType -> MIMEType
Model :: SubType -> MIMEType
Multipart :: Multipart -> MIMEType
Text :: TextType -> MIMEType
Video :: SubType -> MIMEType
Other :: Text -> SubType -> MIMEType
[otherType] :: MIMEType -> Text
[otherSubType] :: MIMEType -> SubType
showMIMEType :: MIMEType -> Text

-- | a (type, subtype) MIME pair.
data MIMEPair
MIMEPair :: Text -> SubType -> MIMEPair
showMIMEPair :: MIMEPair -> Text

-- | default subtype representation.
type SubType = Text

-- | subtype for text content; currently just a string.
type TextType = SubType
subTypeString :: Type -> Text
majTypeString :: Type -> Text
data Multipart
Alternative :: Multipart
Byteranges :: Multipart
Digest :: Multipart
Encrypted :: Multipart
FormData :: Multipart
Mixed :: Multipart
Parallel :: Multipart
Related :: Multipart
Signed :: Multipart

-- | e.g., 'x-foo' (i.e., includes the 'x-' bit)
Extension :: Text -> Multipart
OtherMulti :: Text -> Multipart
isXmlBased :: Type -> Bool
isXmlType :: Type -> Bool
showMultipart :: Multipart -> Text
type Content = Text
data MIMEValue
MIMEValue :: Type -> Maybe Disposition -> MIMEContent -> [MIMEParam] -> Bool -> MIMEValue
[mime_val_type] :: MIMEValue -> Type
[mime_val_disp] :: MIMEValue -> Maybe Disposition
[mime_val_content] :: MIMEValue -> MIMEContent
[mime_val_headers] :: MIMEValue -> [MIMEParam]
[mime_val_inc_type] :: MIMEValue -> Bool
nullMIMEValue :: MIMEValue
data MIMEContent
Single :: Content -> MIMEContent
Multi :: [MIMEValue] -> MIMEContent
data Disposition
Disposition :: DispType -> [DispParam] -> Disposition
[dispType] :: Disposition -> DispType
[dispParams] :: Disposition -> [DispParam]
data DispType
DispInline :: DispType
DispAttachment :: DispType
DispFormData :: DispType
DispOther :: Text -> DispType
data DispParam
Name :: Text -> DispParam
Filename :: Text -> DispParam
CreationDate :: Text -> DispParam
ModDate :: Text -> DispParam
ReadDate :: Text -> DispParam
Size :: Text -> DispParam
OtherParam :: Text -> Text -> DispParam
instance GHC.Show.Show Codec.MIME.Type.MIMEContent
instance GHC.Classes.Eq Codec.MIME.Type.MIMEContent
instance GHC.Classes.Eq Codec.MIME.Type.MIMEValue
instance GHC.Show.Show Codec.MIME.Type.MIMEValue
instance GHC.Classes.Eq Codec.MIME.Type.Disposition
instance GHC.Show.Show Codec.MIME.Type.Disposition
instance GHC.Classes.Eq Codec.MIME.Type.DispParam
instance GHC.Show.Show Codec.MIME.Type.DispParam
instance GHC.Classes.Eq Codec.MIME.Type.DispType
instance GHC.Show.Show Codec.MIME.Type.DispType
instance GHC.Classes.Eq Codec.MIME.Type.Type
instance GHC.Classes.Ord Codec.MIME.Type.Type
instance GHC.Show.Show Codec.MIME.Type.Type
instance GHC.Classes.Eq Codec.MIME.Type.MIMEType
instance GHC.Classes.Ord Codec.MIME.Type.MIMEType
instance GHC.Show.Show Codec.MIME.Type.MIMEType
instance GHC.Classes.Eq Codec.MIME.Type.Multipart
instance GHC.Classes.Ord Codec.MIME.Type.Multipart
instance GHC.Show.Show Codec.MIME.Type.Multipart
instance GHC.Classes.Eq Codec.MIME.Type.MIMEPair
instance GHC.Classes.Eq Codec.MIME.Type.MIMEParam
instance GHC.Classes.Ord Codec.MIME.Type.MIMEParam
instance GHC.Show.Show Codec.MIME.Type.MIMEParam

-- | Parsing MIME content.
module Codec.MIME.Parse
parseMIMEBody :: [MIMEParam] -> Text -> MIMEValue
parseMIMEType :: Text -> Maybe Type
parseMIMEMessage :: Text -> MIMEValue
parseHeaders :: Text -> ([MIMEParam], Text)
parseMultipart :: Type -> Text -> (MIMEValue, Text)
parseContentType :: Text -> Maybe Type
splitMulti :: Text -> Text -> ([MIMEValue], Text)
normalizeCRLF :: Text -> Text

-- | Extracting content from MIME values and types.
module Codec.MIME.Utils

-- | Given a parameter name, locate it within a MIME value, returning the
--   corresponding (sub) MIME value.
findMultipartNamed :: Text -> MIMEValue -> Maybe MIMEValue
