Top |
const char * | gnome_vfs_mime_type_from_name () |
const char * | gnome_vfs_mime_type_from_name_or_default () |
const char * | gnome_vfs_get_mime_type_common () |
const char * | gnome_vfs_get_mime_type_from_uri () |
const char * | gnome_vfs_get_mime_type_from_file_data () |
const char * | gnome_vfs_get_file_mime_type_fast () |
const char * | gnome_vfs_get_file_mime_type () |
gboolean | gnome_vfs_mime_type_is_supertype () |
char * | gnome_vfs_get_supertype_from_mime_type () |
void | gnome_vfs_mime_info_cache_reload () |
void | gnome_vfs_mime_reload () |
void | gnome_vfs_mime_shutdown () |
const char *
gnome_vfs_mime_type_from_name (const char *filename
);
gnome_vfs_mime_type_from_name
is deprecated and should not be used in newly-written code.
This function is deprecated, use
gnome_vfs_get_mime_type_for_name()
instead.
Determine the mime type for filename
.
the mime-type for this filename. Will return
GNOME_VFS_MIME_TYPE_UNKNOWN
if mime-type could not be found.
const char * gnome_vfs_mime_type_from_name_or_default (const char *filename
,const char *defaultv
);
This routine tries to determine the mime-type of the filename only by looking at the filename from the GNOME database of mime-types.
const char *
gnome_vfs_get_mime_type_common (GnomeVFSURI *uri
);
Tries to guess the mime type of the file represented by uri
.
Favors using the file data to the uri
extension.
Handles uri
of a non-existent file by falling back
on returning a type based on the extension. If cant find the mime-type based on the
extension also then returns 'application/octet-stream'.
FIXME: This function will not necessarily return the same mime type as doing a get file info on the text uri.
const char *
gnome_vfs_get_mime_type_from_uri (GnomeVFSURI *uri
);
Tries to guess the mime type of the file uri
by
checking the file name extension. Works on non-existent
files.
const char *
gnome_vfs_get_mime_type_from_file_data
(GnomeVFSURI *uri
);
gnome_vfs_get_mime_type_from_file_data
is deprecated and should not be used in newly-written code.
Tries to guess the mime type of the file uri
by
checking the file data using the magic patterns. Does not handle text files properly.
const char * gnome_vfs_get_file_mime_type_fast (const char *path
,const struct stat *optional_stat_info
);
Tries to guess the mime type of the file represented by path
.
It uses extention/name detection first, and if that fails
it falls back to mime-magic based lookup. This is faster
than always doing mime-magic but doesn't always produce
the right answer, so for important decisions
you should use gnome_vfs_get_file_mime_type()
.
const char * gnome_vfs_get_file_mime_type (const char *path
,const struct stat *optional_stat_info
,gboolean suffix_only
);
Tries to guess the mime type of the file represented by path
.
If suffix_only
is false, uses the mime-magic based lookup first.
Handles path
of a non-existent file by falling back
on returning a type based on the extension.
If you need a faster, less accurate version, use
gnome_vfs_get_file_mime_type_fast()
.
gboolean
gnome_vfs_mime_type_is_supertype (const char *mime_type
);
char *
gnome_vfs_get_supertype_from_mime_type
(const char *mime_type
);
void
gnome_vfs_mime_info_cache_reload (const char *dir
);
Reload the mime information for the dir
.