gmime-content-type

Name

gmime-content-type -- 

Synopsis



struct      GMimeContentType;
GMimeContentType* g_mime_content_type_new   (const gchar *type,
                                             const gchar *subtype);
GMimeContentType* g_mime_content_type_new_from_string
                                            (const gchar *string);
void        g_mime_content_type_destroy     (GMimeContentType *mime_type);
gchar*      g_mime_content_type_to_string   (const GMimeContentType *mime_type);
gboolean    g_mime_content_type_is_type     (const GMimeContentType *mime_type,
                                             const char *type,
                                             const char *subtype);
void        g_mime_content_type_add_parameter
                                            (GMimeContentType *mime_type,
                                             const gchar *attribute,
                                             const gchar *value);
const gchar* g_mime_content_type_get_parameter
                                            (const GMimeContentType *mime_type,
                                             const gchar *attribute);

Description

Details

struct GMimeContentType

struct GMimeContentType {
	gchar *type;
	gchar *subtype;
	
	GList *params;   /* of type GMimeParam */
	GHashTable *param_hash;
};


g_mime_content_type_new ()

GMimeContentType* g_mime_content_type_new   (const gchar *type,
                                             const gchar *subtype);

type : MIME type (or NULL for "text")
subtype : MIME subtype (or NULL for "plain")
Returns :a new MIME Content-Type.


g_mime_content_type_new_from_string ()

GMimeContentType* g_mime_content_type_new_from_string
                                            (const gchar *string);

string : input string containing a content-type (and params)
Returns :a new MIME Content-Type based on the input string.


g_mime_content_type_destroy ()

void        g_mime_content_type_destroy     (GMimeContentType *mime_type);

Destroys the given MIME Content-Type object.

mime_type : MIME Content-Type object to destroy


g_mime_content_type_to_string ()

gchar*      g_mime_content_type_to_string   (const GMimeContentType *mime_type);

mime_type : MIME Content-Type
Returns :an allocated string containing the type and subtype of the content-type in the format: type/subtype.


g_mime_content_type_is_type ()

gboolean    g_mime_content_type_is_type     (const GMimeContentType *mime_type,
                                             const char *type,
                                             const char *subtype);

mime_type : MIME Content-Type
type : MIME type to compare against
subtype : 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.


g_mime_content_type_add_parameter ()

void        g_mime_content_type_add_parameter
                                            (GMimeContentType *mime_type,
                                             const gchar *attribute,
                                             const gchar *value);

Adds a parameter to the Content-Type.

mime_type : MIME Content-Type
attribute : parameter name (aka attribute)
value : parameter value


g_mime_content_type_get_parameter ()

const gchar* g_mime_content_type_get_parameter
                                            (const GMimeContentType *mime_type,
                                             const gchar *attribute);

mime_type : MIME Content-Type
attribute : parameter name (aka attribute)
Returns :a const pointer to the paramer value specified by attribute.