[rcore] LoadDirectoryFilesEx(), count files if not recursive (#5496)

* LoadDirectoryFilesEx on not recursive loading count files

* Removed FilePathList.capacity

* Added security check in case of memory leak

* Fix stop loading paths early on recursive loading

* Fix count directories only if filter contains DIRECTORY_FILTER_TAG

* rlparser: update raylib_api.* by CI

* GetDirectoryFileCount() and GetDirectoryFileCountEx() made visible

* rlparser: update raylib_api.* by CI

* Added new file and directories filter tags

* Renamed `fileCount` in `ScanDirectoryFiles()` to `expectedFileCount`

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Catania
2026-01-23 13:48:26 +01:00
committed by GitHub
parent c610d228a2
commit 594f5429b2
6 changed files with 615 additions and 595 deletions

View File

@ -1324,11 +1324,6 @@
"name": "FilePathList",
"description": "File path list",
"fields": [
{
"type": "unsigned int",
"name": "capacity",
"description": "Filepaths max entries"
},
{
"type": "unsigned int",
"name": "count",
@ -4734,6 +4729,36 @@
}
]
},
{
"name": "GetDirectoryFileCount",
"description": "Get the file count in a directory",
"returnType": "unsigned int",
"params": [
{
"type": "const char *",
"name": "dirPath"
}
]
},
{
"name": "GetDirectoryFileCountEx",
"description": "Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result",
"returnType": "unsigned int",
"params": [
{
"type": "const char *",
"name": "basePath"
},
{
"type": "const char *",
"name": "filter"
},
{
"type": "bool",
"name": "scanSubdirs"
}
]
},
{
"name": "CompressData",
"description": "Compress data (DEFLATE algorithm), memory must be MemFree()",