mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
Create g_content_type_is_mime_type()
Convenience wrapper around g_content_type_is_a(). https://bugzilla.gnome.org/show_bug.cgi?id=734946
This commit is contained in:
parent
525b33c05f
commit
fe1a749ca6
@ -130,6 +130,23 @@ g_content_type_is_a (const gchar *type,
|
||||
return res;
|
||||
}
|
||||
|
||||
gboolean
|
||||
g_content_type_is_mime_type (const gchar *type,
|
||||
const gchar *mime_type)
|
||||
{
|
||||
gchar *content_type;
|
||||
gboolean ret;
|
||||
|
||||
g_return_val_if_fail (type != NULL, FALSE);
|
||||
g_return_val_if_fail (mime_type != NULL, FALSE);
|
||||
|
||||
content_type = g_content_type_from_mime_type (mime_type);
|
||||
ret = g_content_type_is_a (type, content_type);
|
||||
g_free (content_type);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
gboolean
|
||||
g_content_type_is_unknown (const gchar *type)
|
||||
{
|
||||
|
@ -161,6 +161,26 @@ g_content_type_is_a (const gchar *type,
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_content_type_is_mime_type:
|
||||
* @type: a content type string
|
||||
* @mime_type: a mime type string
|
||||
*
|
||||
* Determines if @type is a subset of @mime_type.
|
||||
* Convenience wrapper around g_content_type_is_a().
|
||||
*
|
||||
* Returns: %TRUE if @type is a kind of @mime_type,
|
||||
* %FALSE otherwise.
|
||||
*
|
||||
* Since: 2.52
|
||||
*/
|
||||
gboolean
|
||||
g_content_type_is_mime_type (const gchar *type,
|
||||
const gchar *mime_type)
|
||||
{
|
||||
return g_content_type_is_a (type, mime_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* g_content_type_is_unknown:
|
||||
* @type: a content type string
|
||||
|
@ -35,6 +35,9 @@ gboolean g_content_type_equals (const gchar *type1,
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
gboolean g_content_type_is_a (const gchar *type,
|
||||
const gchar *supertype);
|
||||
GLIB_AVAILABLE_IN_2_52
|
||||
gboolean g_content_type_is_mime_type (const gchar *type,
|
||||
const gchar *mime_type);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
gboolean g_content_type_is_unknown (const gchar *type);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
|
Loading…
Reference in New Issue
Block a user