GMime 2.4 Reference Manual | ||||
---|---|---|---|---|
GMimeContentType; GMimeContentType* g_mime_content_type_new (const char *type, const char *subtype); GMimeContentType* g_mime_content_type_new_from_string (const char *str); char* g_mime_content_type_to_string (GMimeContentType *mime_type); gboolean g_mime_content_type_is_type (GMimeContentType *mime_type, const char *type, const char *subtype); const char* g_mime_content_type_get_media_type (GMimeContentType *mime_type); void g_mime_content_type_set_media_type (GMimeContentType *mime_type, const char *type); const char* g_mime_content_type_get_media_subtype (GMimeContentType *mime_type); void g_mime_content_type_set_media_subtype (GMimeContentType *mime_type, const char *subtype); const GMimeParam* g_mime_content_type_get_params (GMimeContentType *mime_type); void g_mime_content_type_set_params (GMimeContentType *mime_type, GMimeParam *params); const char* g_mime_content_type_get_parameter (GMimeContentType *mime_type, const char *attribute); void g_mime_content_type_set_parameter (GMimeContentType *mime_type, const char *attribute, const char *value);
typedef struct _GMimeContentType GMimeContentType;
A data structure representing a Content-Type.
GMimeContentType* g_mime_content_type_new (const char *type, const char *subtype);
Creates a Content-Type object with type type
and subtype subtype
.
|
MIME type (or NULL for "text")
|
|
MIME subtype (or NULL for "plain")
|
Returns : |
a new GMimeContentType object. |
GMimeContentType* g_mime_content_type_new_from_string (const char *str);
Constructs a new Content-Type object based on the input string.
|
input string containing a content-type (and params) |
Returns : |
a new GMimeContentType object based on the input string. |
char* g_mime_content_type_to_string (GMimeContentType *mime_type);
Allocates a string buffer containing the type and subtype defined
by the mime_type
.
|
a GMimeContentType object |
Returns : |
an allocated string containing the type and subtype of the content-type in the format: type/subtype. |
gboolean g_mime_content_type_is_type (GMimeContentType *mime_type, const char *type, const char *subtype);
Compares the given type and subtype with that of the given mime type object.
|
a GMimeContentType object |
|
MIME type to compare against |
|
MIME subtype to compare against |
Returns : |
TRUE if the MIME types match or FALSE otherwise. You may
use "*" in place of type and/or subtype as a wilcard.
|
const char* g_mime_content_type_get_media_type (GMimeContentType *mime_type);
Gets the Content-Type's media type.
|
a GMimeContentType object |
Returns : |
the Content-Type's media type. |
void g_mime_content_type_set_media_type (GMimeContentType *mime_type, const char *type);
Sets the Content-Type's media type.
|
a GMimeContentType object |
|
media type |
const char* g_mime_content_type_get_media_subtype (GMimeContentType *mime_type);
Gets the Content-Type's media sub-type.
|
a GMimeContentType object |
Returns : |
the Content-Type's media sub-type. |
void g_mime_content_type_set_media_subtype (GMimeContentType *mime_type, const char *subtype);
Sets the Content-Type's media subtype.
|
a GMimeContentType object |
|
media subtype |
const GMimeParam* g_mime_content_type_get_params (GMimeContentType *mime_type);
Gets the Content-Type's parameter list.
|
a GMimeContentType object |
Returns : |
the Content-Type's parameter list. |
void g_mime_content_type_set_params (GMimeContentType *mime_type, GMimeParam *params);
Sets the Content-Type's parameter list.
|
a GMimeContentType object |
|
a list of GMimeParam objects |
const char* g_mime_content_type_get_parameter (GMimeContentType *mime_type, const char *attribute);
Gets the parameter value specified by attribute
if it's available.
|
a GMimeContentType object |
|
parameter name (aka attribute) |
Returns : |
a const pointer to the paramer value specified by
attribute or NULL on fail.
|
void g_mime_content_type_set_parameter (GMimeContentType *mime_type, const char *attribute, const char *value);
Sets a parameter on the Content-Type.
|
MIME Content-Type |
|
parameter name (aka attribute) |
|
parameter value |