Top |
GnomeVFSMimeEquivalence | gnome_vfs_mime_type_get_equivalence () |
gboolean | gnome_vfs_mime_type_is_equal () |
const char * | gnome_vfs_get_mime_type_for_name () |
const char * | gnome_vfs_get_mime_type_for_data () |
const char * | gnome_vfs_get_mime_type_for_name_and_data () |
char * | gnome_vfs_get_mime_type () |
char * | gnome_vfs_get_slow_mime_type () |
GnomeVFSMimeEquivalence gnome_vfs_mime_type_get_equivalence (const char *mime_type
,const char *base_mime_type
);
Compares mime_type
to base_mime_type
. There are three possible
relationships between the two strings.
If they are identical and mime_type
is the same as base_mime_type
,
then GNOME_VFS_MIME_IDENTICAL
is returned. This would be the case if
"audio/midi" and "audio/x-midi" are passed in.
If base_mime_type
is a parent type of mime_type
, then
GNOME_VFS_MIME_PARENT
is returned. As an example, "text/plain" is a parent
of "text/rss", "image" is a parent of "image/png", and
"application/octet-stream" is a parent of almost all types.
Finally, if the two mime types are unrelated, then GNOME_VFS_MIME_UNRELATED
is returned.
mime_type |
a const char * containing a mime type, e.g. "image/png". |
|
base_mime_type |
a const char * containing either a mime type or a base mime type. |
A GnomeVFSMimeEquivalence indicating the relationship between mime_type
and base_mime_type
.
gboolean gnome_vfs_mime_type_is_equal (const char *a
,const char *b
);
Compares two mime types to determine if they are equivalent. They are equivalent if and only if they refer to the same mime type.
const char *
gnome_vfs_get_mime_type_for_name (const char *filename
);
Determine the mime type for filename
. The file filename
may
not exist, this function does not access the actual file.
If the mime-type cannot be determined, GNOME_VFS_MIME_TYPE_UNKNOWN
is returned.
the mime-type for this filename or
GNOME_VFS_MIME_TYPE_UNKNOWN
if mime-type could not be determined.
Since: 2.14
const char * gnome_vfs_get_mime_type_for_data (gconstpointer data
,int data_size
);
Tries to guess the mime type of the data in data
using the magic patterns.
const char * gnome_vfs_get_mime_type_for_name_and_data (const char *filename
,gconstpointer data
,gssize data_size
);
Determine the mime-type for filename
and data
. This function tries
to be smart (e.g. mime subclassing) about returning the right mime-type
by looking at both the data
and the filename
. The file will not be
accessed.
If the mime-type cannot be determined, GNOME_VFS_MIME_TYPE_UNKNOWN
is returned.
the mime-type for this filename or
GNOME_VFS_MIME_TYPE_UNKNOWN
if mime-type could not be determined.
Since: 2.14
char *
gnome_vfs_get_mime_type (const char *text_uri
);
Determine the mime type of text_uri
. The mime type is determined
in the same way as by gnome_vfs_get_file_info()
. This is meant as
a convenient function for times when you only want the mime type.
char *
gnome_vfs_get_slow_mime_type (const char *text_uri
);
Determine the mime type of text_uri
. The mime type is determined
in the same way as by gnome_vfs_get_file_info()
. This is meant as
a convenience function for times when you only want the mime type.
Since: 2.14
#define GNOME_VFS_MIME_TYPE_UNKNOWN "application/octet-stream"
The value returned for the MIME type when a file did not match any entries in the MIME database. May be treated as a file of an unknown type.
Describes the possible relationship between two MIME types, returned by
gnome_vfs_mime_type_get_equivalence()
.