[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()",

View File

@ -1324,11 +1324,6 @@ return {
name = "FilePathList",
description = "File path list",
fields = {
{
type = "unsigned int",
name = "capacity",
description = "Filepaths max entries"
},
{
type = "unsigned int",
name = "count",
@ -4230,6 +4225,24 @@ return {
{type = "FilePathList", name = "files"}
}
},
{
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()",

File diff suppressed because it is too large Load Diff

View File

@ -280,8 +280,7 @@
<Field type="float[2]" name="scale" desc="VR distortion scale" />
<Field type="float[2]" name="scaleIn" desc="VR distortion scale in" />
</Struct>
<Struct name="FilePathList" fieldCount="3" desc="File path list">
<Field type="unsigned int" name="capacity" desc="Filepaths max entries" />
<Struct name="FilePathList" fieldCount="2" desc="File path list">
<Field type="unsigned int" name="count" desc="Filepaths entries count" />
<Field type="char **" name="paths" desc="Filepaths entries" />
</Struct>
@ -679,7 +678,7 @@
<Param type="unsigned int" name="frames" desc="" />
</Callback>
</Callbacks>
<Functions count="597">
<Functions count="599">
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
@ -1137,6 +1136,14 @@
<Function name="UnloadDroppedFiles" retType="void" paramCount="1" desc="Unload dropped filepaths">
<Param type="FilePathList" name="files" desc="" />
</Function>
<Function name="GetDirectoryFileCount" retType="unsigned int" paramCount="1" desc="Get the file count in a directory">
<Param type="const char *" name="dirPath" desc="" />
</Function>
<Function name="GetDirectoryFileCountEx" retType="unsigned int" paramCount="3" desc="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">
<Param type="const char *" name="basePath" desc="" />
<Param type="const char *" name="filter" desc="" />
<Param type="bool" name="scanSubdirs" desc="" />
</Function>
<Function name="CompressData" retType="unsigned char *" paramCount="3" desc="Compress data (DEFLATE algorithm), memory must be MemFree()">
<Param type="const unsigned char *" name="data" desc="" />
<Param type="int" name="dataSize" desc="" />