patterns: A string containing newline separated sets of patterns to match.
A pattern is either a shell-style glob pattern (e.g. "*.txt") or a MIME
type (e.g. "image/png"). Not all platforms support both (and some don't
even support globs), so a portable solution is to specify a MIME type and
simple style globs which Allegro will pick from to match what the platform
supports (e.g. do "image/png;*.png"). Multiple patterns are separated
using a semicolon. If the platform does not provide support for patterns,
this parameter is ignored. Here are some example patterns:
"*.txt" -- defines a single filter, matching *.txt files.
"*.txt;*.md" -- like above, but matching two types of files.
"Text files (*.txt, *.md) *.txt;*.md" -- like above, but with a custom
description (separated from the patterns using a space).
"Text files *.txt\nPNG images image/png;*.png" -- defines two filters,
with the second filter using a MIME type and extension at the same time.
Note: Windows does not support MIME types. Android supports only MIME
types. Instead of file patterns, MacOS supports extensions, so matching
based on filename beyond file type does not work. Allegro will parse your
file pattern to try to extract the file extension. MacOS also supports
MIME types, which behave more predictably. MacOS does not support detailed
descriptions or multiple pattern sets, Allegro will strip the detailed
descriptions and concatenate all patterns into one list.
Here's the new docstring for it:
patterns
: A string containing newline separated sets of patterns to match. A pattern is either a shell-style glob pattern (e.g."*.txt"
) or a MIME type (e.g."image/png"
). Not all platforms support both (and some don't even support globs), so a portable solution is to specify a MIME type and simple style globs which Allegro will pick from to match what the platform supports (e.g. do"image/png;*.png"
). Multiple patterns are separated using a semicolon. If the platform does not provide support for patterns, this parameter is ignored. Here are some example patterns:"*.txt"
-- defines a single filter, matching*.txt
files."*.txt;*.md"
-- like above, but matching two types of files."Text files (*.txt, *.md) *.txt;*.md"
-- like above, but with a custom description (separated from the patterns using a space)."Text files *.txt\nPNG images image/png;*.png"
-- defines two filters, with the second filter using a MIME type and extension at the same time.