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:
TingPing
2017-03-08 23:02:10 -05:00
committed by Matthias Clasen
parent 525b33c05f
commit fe1a749ca6
3 changed files with 40 additions and 0 deletions

View File

@@ -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)
{