mime-0.4.0.2: Working with MIME types.

Copyright | (c) 2006-2009, Galois, Inc.
License | BSD3
Maintainer | Sigbjorn Finne <sigbjorn.finne@gmail.com>
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Codec.MIME.Type

Description

Representing MIME types and values.

Synopsis

- data MIMEParam = MIMEParam {
  - paramName :: Text
  - paramValue :: Text
  }
- data Type = Type {
  - mimeType :: MIMEType
  - mimeParams :: [MIMEParam]
  }
- nullType :: Type
- showType :: Type -> Text
- showMIMEParams :: [MIMEParam] -> Text
- data MIMEType
  - = Application SubType
  - | Audio SubType
  - | Image SubType
  - | Message SubType
  - | Model SubType
  - | Multipart Multipart
  - | Text TextType
  - | Video SubType
  - | Other {
    - otherType :: Text
    - otherSubType :: SubType
    }
- showMIMEType :: MIMEType -> Text
- data MIMEPair = MIMEPair Text SubType
- showMIMEPair :: MIMEPair -> Text
- type SubType = Text
- type TextType = SubType
- subTypeString :: Type -> Text
- majTypeString :: Type -> Text
- data Multipart
  - = Alternative
  - | Byteranges
  - | Digest
  - | Encrypted
  - | FormData
  - | Mixed
  - | Parallel
  - | Related
  - | Signed
  - | Extension Text
  - | OtherMulti Text
- isXmlBased :: Type -> Bool
- isXmlType :: Type -> Bool
- showMultipart :: Multipart -> Text
- type Content = Text
- data MIMEValue = MIMEValue {
  - mime_val_type :: Type
  - mime_val_disp :: Maybe Disposition
  - mime_val_content :: MIMEContent
  - mime_val_headers :: [MIMEParam]
  - mime_val_inc_type :: Bool
  }
- nullMIMEValue :: MIMEValue
- data MIMEContent
  - = Single Content
  - | Multi [MIMEValue]
- data Disposition = Disposition {
  - dispType :: DispType
  - dispParams :: [DispParam]
  }
- data DispType
  - = DispInline
  - | DispAttachment
  - | DispFormData
  - | DispOther Text
- data DispParam
  - = Name Text
  - | Filename Text
  - | CreationDate Text
  - | ModDate Text
  - | ReadDate Text
  - | Size Text
  - | OtherParam Text Text

# Documentation

data MIMEParam Source

Constructors

MIMEParam |

Fields

paramName :: Text
paramValue :: Text

Instances

Eq MIMEParam Source |
Ord MIMEParam Source |
Show MIMEParam Source |

data Type Source

Constructors

Type |

Fields

mimeType :: MIMEType
mimeParams :: [MIMEParam]

Instances

Eq Type Source |
Ord Type Source |
Show Type Source |

nullType :: Type Source

The `null` MIME record type value; currently a `text/plain`.

showType :: Type -> Text Source

showMIMEParams :: [MIMEParam] -> Text Source

data MIMEType Source

Constructors

Application SubType |
Audio SubType |
Image SubType |
Message SubType |
Model SubType |
Multipart Multipart |
Text TextType |
Video SubType |
Other |

Fields

otherType :: Text
otherSubType :: SubType

Instances

Eq MIMEType Source |
Ord MIMEType Source |
Show MIMEType Source |

showMIMEType :: MIMEType -> Text Source

data MIMEPair Source

a (type, subtype) MIME pair.

Constructors

MIMEPair Text SubType |

Instances

Eq MIMEPair Source |

showMIMEPair :: MIMEPair -> Text Source

type SubType = Text Source

default subtype representation.

type TextType = SubType Source

subtype for text content; currently just a string.

subTypeString :: Type -> Text Source

majTypeString :: Type -> Text Source

data Multipart Source

Constructors

Alternative |
Byteranges |
Digest |
Encrypted |
FormData |
Mixed |
Parallel |
Related |
Signed |
Extension Text | e.g., 'x-foo' (i.e., includes the 'x-' bit)
OtherMulti Text |

Instances

Eq Multipart Source |
Ord Multipart Source |
Show Multipart Source |

isXmlBased :: Type -> Bool Source

isXmlType :: Type -> Bool Source

showMultipart :: Multipart -> Text Source

type Content = Text Source

data MIMEValue Source

Constructors

MIMEValue |

Fields

mime_val_type :: Type
mime_val_disp :: Maybe Disposition
mime_val_content :: MIMEContent
mime_val_headers :: [MIMEParam]
mime_val_inc_type :: Bool

Instances

Eq MIMEValue Source |
Show MIMEValue Source |

nullMIMEValue :: MIMEValue Source

data MIMEContent Source

Constructors

Single Content |
Multi [MIMEValue] |

Instances

Eq MIMEContent Source |
Show MIMEContent Source |

data Disposition Source

Constructors

Disposition |

Fields

dispType :: DispType
dispParams :: [DispParam]

Instances

Eq Disposition Source |
Show Disposition Source |

data DispType Source

Constructors

DispInline |
DispAttachment |
DispFormData |
DispOther Text |

Instances

Eq DispType Source |
Show DispType Source |

data DispParam Source

Constructors

Name Text |
Filename Text |
CreationDate Text |
ModDate Text |
ReadDate Text |
Size Text |
OtherParam Text Text |

Instances

Eq DispParam Source |
Show DispParam Source |