SDL_GlobDirectory - Enumerate a directory tree, filtered by pattern, and return a list.
Contents
Availability
This function is available since SDL 3.2.0.
Simple Directmedia Layer SDL 3.2.20 SDL_GlobDirectory(3)
Description
Files are filtered out if they don't match the string in pattern, which may contain wildcard characters
' "'(matcheverything)and'?'(matchonecharacter).IfpatternisNULL,nofilteringisdoneandallresultsarereturned.Subdirectoriesarepermitted,andarespecifiedwithapathseparatorof'/'.Wildcardcharacters'
and '?' never match a path separator.
flags may be set to SDL_GLOB_CASEINSENSITIVE to make the pattern matching case-insensitive.
The returned array is always NULL-terminated, for your iterating convenience, but if count is non-NULL,
on return it will contain the number of items in the array, not counting the NULL terminator.
Function Parameters
path the path of the directory to enumerate.
pattern
the pattern that files in the directory must match. Can be NULL.
flagsSDL_GLOB_* bitflags that affect this search.
count on return, will be set to the number of items in the returned array. Can be NULL.
Name
SDL_GlobDirectory - Enumerate a directory tree, filtered by pattern, and return a list.
Return Value
for more information. This is a single allocation that should be freed with SDL_free() when it is no
longer needed.
Synopsis
#include<SDL3/SDL_filesystem.h>char**SDL_GlobDirectory(constchar*path,constchar*pattern,SDL_GlobFlagsflags,int*count);
Thread Safety
It is safe to call this function from any thread.
