filesystem: Added SDL_GlobDirectory() and SDL_GlobStorageDirectory().

Fixes #9287.
This commit is contained in:
Ryan C. Gordon committed 2024-04-04 09:40:13 -04:00
1 parent 810656962c
commit 764207d873
9 files changed
+398 -2

No files matched your search

+18
View File
@@ -22,6 +22,7 @@
#include "SDL_internal.h"
#include "SDL_sysstorage.h"
#include "../filesystem/SDL_sysfilesystem.h"
/* Available title storage drivers */
static TitleStorageBootStrap *titlebootstrap[] = {
@@ -321,3 +322,20 @@ Uint64 SDL_GetStorageSpaceRemaining(SDL_Storage *storage)
return storage->iface.space_remaining(storage->userdata);
}
static int GlobStorageDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata)
{
return SDL_GetStoragePathInfo((SDL_Storage *) userdata, path, info);
}
static int GlobStorageDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata)
{
return SDL_EnumerateStorageDirectory((SDL_Storage *) userdata, path, cb, cbuserdata);
}
char **SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, Uint32 flags, int *count)
{
CHECK_STORAGE_MAGIC_RET(NULL)
return SDL_InternalGlobDirectory(path, pattern, flags, count, GlobStorageDirectoryEnumerator, GlobStorageDirectoryGetPathInfo, storage);
}