mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-26 17:24:27 +00:00
filesystem: Added SDL_GlobDirectory() and SDL_GlobStorageDirectory().
Fixes #9287.
This commit is contained in:
@@ -110,10 +110,23 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (base_path) {
|
||||
char **globlist;
|
||||
|
||||
if (SDL_EnumerateDirectory(base_path, enum_callback, NULL) < 0) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Base path enumeration failed!");
|
||||
}
|
||||
|
||||
globlist = SDL_GlobDirectory(base_path, "*/test*/Test*", SDL_GLOBDIR_CASEINSENSITIVE, NULL);
|
||||
if (!globlist) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Base path globbing failed!");
|
||||
} else {
|
||||
int i;
|
||||
for (i = 0; globlist[i]; i++) {
|
||||
SDL_Log("GLOB[%d]: '%s'", i, globlist[i]);
|
||||
}
|
||||
SDL_free(globlist);
|
||||
}
|
||||
|
||||
/* !!! FIXME: put this in a subroutine and make it test more thoroughly (and put it in testautomation). */
|
||||
if (SDL_CreateDirectory("testfilesystem-test") == -1) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_CreateDirectory('testfilesystem-test') failed: %s", SDL_GetError());
|
||||
|
||||
Reference in New Issue
Block a user