[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4. Content-Type 欄の情報

Content-Type 欄 は media-type (media-type) や MIME charset といった entity (@ref{entity}) の内容の種類や表現形式などを記述 するためのもので、RFC 2045 (RFC 2045) で定義されています。

[Memo]

歴史的には RFC 1049 で Content-Type 欄が提案されている。但し、MIME の media-type のような type と subtype の区別はなく、MIME charset のような 文字符号の種類を表現することもできない。

FLIM は Content-Type 欄を構文解析する関数と Content-Type 欄の解析結果を 格納する構造体 mime-content-type を提供します。


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 Content-Type 欄の形式

Content-Type 欄の形式は以下のように定義されています:

“Content-Type” “:” type “/” subtype *( “;” parameter )

例えば、

 
Content-Type: image/jpeg

 
Content-Type: text/plain; charset=iso-2022-jp

などのように用いられます。

ここで、‘type’ と ‘subtype’ は entity の形式を示すもので、両者を総称し て、‘media-type’ と呼ぶことにします。上記の例における ‘image/jpeg’ や ‘text/plain’ は media-type の1つです。

[Memo]

Content-Type 欄のない entity は

 
Content-Type: text/plain; charset=us-ascii

として解釈される。(cf. us-ascii)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2 mime-content-type 構造体

Structure: mime-content-type

Content-Type 欄の情報を格納するための構造体。

この構造体を参照するには mime-content-type-要素名 という名前の参 照関数を用いる。

この構造体の要素は以下の通りである:

primary-type

media-type の主型 (symbol).

subtype

media-type の副型 (symbol).

parameters

Content-Type 欄の parameter (連想 list).

Function: make-mime-content-type type subtype

&optional parameters

content-type の生成子。

Function: mime-content-type-parameter content-type parameter

content-typeparameter の値を返す。


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3 Content-Type 欄の解析器

Function: mime-parse-Content-Type string

string を content-type として解析した結果を返す。

Function: mime-read-Content-Type

現在の buffer の Content-Type 欄を読み取り、解析した結果を返す。

Content-Type 欄が存在しない場合は nil を返す。


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4 Content-Type に関する有用な関数

Function: mime-type/subtype-string type &optional subtype

typesubtype から type/subtype 形式の文字列を返す。


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Yasutaka SHINDOH on May 11, 2011 using texi2html 1.82.