Added SDL_CopyFile() and SDL_CopyStorageFile()

Fixes https://github.com/libsdl-org/SDL/issues/9553
This commit is contained in:
Sam Lantinga
2024-07-21 19:32:16 -07:00
parent 128df75e05
commit 033c9c5951
14 changed files with 213 additions and 0 deletions

View File

@@ -291,6 +291,24 @@ int SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char
return storage->iface.rename(storage->userdata, oldpath, newpath);
}
int SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath)
{
CHECK_STORAGE_MAGIC()
if (!oldpath) {
return SDL_InvalidParamError("oldpath");
}
if (!newpath) {
return SDL_InvalidParamError("newpath");
}
if (!storage->iface.copy) {
return SDL_Unsupported();
}
return storage->iface.copy(storage->userdata, oldpath, newpath);
}
int SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info)
{
SDL_PathInfo dummy;