| struct ContentType コンテンツタイプの実体となる構造体です。 |
| struct ContentType * | ContentType_ コンテンツタイプを生成します。 |
| void | ContentType_ コンテンツタイプを解放します。 |
| int | ContentType_ コンテンツタイプを比較します。 |
| char * | ContentType_ コンテンツタイプのタイプを表す文字列を取得します。 |
| struct Parameter * | ContentType_ パラメータを取得します。 |
| struct ContentType * ContentType_create( | const char * s) |
sが表す文字列はRFC 2045に示される次の形式である必要があります。
type "/" subtype *(";" parameter)
ただしparameterはRFC 2045と互換性ある次の形式でなければなりません。
parameter := attribute ["=" value] attribute := token ; Matching of attributes is ALWAYS case-insensitive. value := token / quoted-string
パラメータの値valueがquoted-stringである場合、両端のクォート文字(")は取り除かれます。
戻り値が参照するオブジェクトはContentType_
| void ContentType_free( | struct ContentType * ct) |
ctがNULLのときはなにもしません。呼び出し後はctが参照するオブジェクトを参照してはなりません。
| int ContentType_matches( | struct ContentType * ct, |
| const char * mainType, | |
| const char * subType) |
subTypeがNULLの場合は主タイプとmainTypeが等しい場合にマッチします。
subTypeが非NULLの場合は主タイプとmainTypeが等しく、かつsubTypeと副タイプが等しい場合にマッチします。
| char * ContentType_getType( | struct ContentType * ct) |
戻り値が参照するオブジェクトはctを解放するまで有効です。戻り値が参照するオブジェクトを変更、解放してはなりません。
| struct Parameter * ContentType_getParameter( | struct ContentType * ct, |
| const char * name) |
名前がnameと一致するパラメータを取得します。パラメータの名前とnameを比較する際には大文字小文字は区別されません。一致するパラメータが存在しない場合はNULLを返します。
戻り値が参照するオブジェクトはctを解放するまで有効です。戻り値が参照するオブジェクトを解放してはなりません。