object
mime_types
MIME type registry and convenience predicates for mapping file names and URLs to media types.
logtalk_load(mime_types(loader))static, context_switching_calls
Default behavior: Convenience predicates default to lenient lookup by consulting both built-in standard mappings and built-in common mappings.
Path decomposition: File path decomposition uses the
oslibrarydecompose_file_name/4predicate.External overlays: Additional
mime.types-style files can be loaded into the in-memory registry using theload/1-2predicates.
Public predicates
guess_type/3
Guesses the MIME type and content encoding for a URL or file name using lenient lookup. Unknown values are returned as the empty atom.
staticguess_type(Resource,Type,Encoding)guess_type(+atom,-atom,-atom) - oneguess_type/4
Guesses the MIME type and content encoding for a URL or file name. When Strict is true, only built-in standard mappings and strict runtime overlays are consulted.
staticguess_type(Resource,Type,Encoding,Strict)guess_type(+atom,-atom,-atom,+boolean) - oneguess_file_type/3
Guesses the MIME type and content encoding for a file path using lenient lookup. Unknown values are returned as the empty atom.
staticguess_file_type(Path,Type,Encoding)guess_file_type(+atom,-atom,-atom) - oneguess_file_type/4
Guesses the MIME type and content encoding for a file path.
staticguess_file_type(Path,Type,Encoding,Strict)guess_file_type(+atom,-atom,-atom,+boolean) - oneextension_type/2
Returns the MIME type associated with a file extension using lenient lookup.
staticextension_type(Extension,Type)extension_type(+atom,-atom) - zero_or_oneextension_type/3
Returns the MIME type associated with a file extension.
staticextension_type(Extension,Type,Strict)extension_type(+atom,-atom,+boolean) - zero_or_oneguess_extension/2
Returns the preferred file extension associated with a MIME type using lenient lookup.
staticguess_extension(Type,Extension)guess_extension(+atom,-atom) - zero_or_oneguess_extension/3
Returns the preferred file extension associated with a MIME type.
staticguess_extension(Type,Extension,Strict)guess_extension(+atom,-atom,+boolean) - zero_or_oneguess_all_extensions/2
Returns all known file extensions associated with a MIME type using lenient lookup.
staticguess_all_extensions(Type,Extensions)guess_all_extensions(+atom,-list(atom)) - oneguess_all_extensions(+atom,-list(atom)) - oneguess_all_extensions/3
Returns all known file extensions associated with a MIME type.
staticguess_all_extensions(Type,Extensions,Strict)add_type/2
Adds a lenient runtime mapping from a MIME type to a file extension.
staticadd_type(Type,Extension)add_type(+atom,+atom) - oneadd_type/3
Adds a runtime mapping from a MIME type to a file extension.
staticadd_type(Type,Extension,Strict)add_type(+atom,+atom,+boolean) - oneread_mime_types/2
Reads a mime.types-style file returning a list of Extension-Type pairs.
staticread_mime_types(File,Pairs)read_mime_types(+atom,-list(pair(atom,atom))) - oneload/1
Loads a mime.types-style file as a lenient runtime overlay.
staticload(File)load(+atom) - oneload/2
Loads a mime.types-style file as a strict or lenient runtime overlay.
staticload(File,Strict)load(+atom,+boolean) - onereset/0
Clears all runtime MIME type overlays.
staticreset - onesuffix_alias/2
Returns suffix aliases used before splitting encoding and type suffixes.
staticsuffix_alias(Alias,Expanded)suffix_alias(?atom,?atom) - zero_or_moreencoding_suffix/2
Returns content-encoding suffix mappings.
staticencoding_suffix(Extension,Encoding)encoding_suffix(?atom,?atom) - zero_or_moreProtected predicates
(no local declarations; see entity ancestors if any)
Private predicates
runtime_type_/3
Table of runtime MIME type overlays.
dynamicruntime_type_(Strict,Extension,Type)runtime_type_(?boolean,?atom,?atom) - zero_or_moreOperators
(none)