You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As-per discussion here the filesystem callbacks are useful and work great, when trying to implement a virtual filesystem (I am using physfs), but there are still some functions without hooks or macros that need to some way to be overwritten:
I made a little library here and just added FS to the end of the names, to prevent collision. Also @RobLoach made raylib-physfs, which doesn't use callbacks, but takes a similar naming-approach.
I think either a macro or the callback-system are fine, I just need a way to overwrite these, so when the user calls FileExists it calls PHYSFS_stat.
I am happy to PR for a macro or callback, whatever everyone thinks is better.
@konsumer Just realized that I did not answer to this improvement proposal, I'm still considering it.
Just for completion, here it is the full list of functions accessing the file system:
LoadFileData() - Implemented SetLoadFileDataCallback() for customization
SaveFileData() - Implemented SetSaveFileDataCallback() for customization
LoadFileText() - Implemented SetLoadFileTextCallback() for customization
SaveFileText() - Implemented SetSaveFileTextCallback() for customization
FileExists()
GetFileLength()
GetFileModTime()
IsPathFile()
DirectoryExists()
ChangeDirectory()
LoadDirectoryFiles()
LoadDirectoryFilesEx()
I'd prefer to avoid a dozen of callback functions, thinking about the available mechanisms to accomplish it, maybe using some macro or some intermediate internal function for files/directory data retrieval (internally used by above ones)
Issue description
As-per discussion here the filesystem callbacks are useful and work great, when trying to implement a virtual filesystem (I am using physfs), but there are still some functions without hooks or macros that need to some way to be overwritten:
I made a little library here and just added
FS
to the end of the names, to prevent collision. Also @RobLoach made raylib-physfs, which doesn't use callbacks, but takes a similar naming-approach.I think either a macro or the callback-system are fine, I just need a way to overwrite these, so when the user calls
FileExists
it callsPHYSFS_stat
.I am happy to PR for a macro or callback, whatever everyone thinks is better.
Code Example
It might look like either of these:
The text was updated successfully, but these errors were encountered: