mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-01 23:48:29 +00:00
Added SDL_CopyFile() and SDL_CopyStorageFile()
Fixes https://github.com/libsdl-org/SDL/issues/9553
This commit is contained in:
@@ -327,6 +327,18 @@ extern SDL_DECLSPEC int SDLCALL SDL_RemovePath(const char *path);
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Copy a file.
|
||||
*
|
||||
* \param oldpath the old path.
|
||||
* \param newpath the new path.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Get information about a filesystem path.
|
||||
*
|
||||
|
@@ -83,6 +83,9 @@ typedef struct SDL_StorageInterface
|
||||
/* Rename a path, optional for read-only storage */
|
||||
int (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath);
|
||||
|
||||
/* Copy a file, optional for read-only storage */
|
||||
int (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath);
|
||||
|
||||
/* Get the space remaining, optional for read-only storage */
|
||||
Uint64 (SDLCALL *space_remaining)(void *userdata);
|
||||
} SDL_StorageInterface;
|
||||
@@ -337,6 +340,21 @@ extern SDL_DECLSPEC int SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, cons
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Copy a file in a writable storage container.
|
||||
*
|
||||
* \param storage a storage container.
|
||||
* \param oldpath the old path.
|
||||
* \param newpath the new path.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Get information about a filesystem path in a storage container.
|
||||
*
|
||||
|
Reference in New Issue
Block a user