Added SDL_OpenFileStorage() for local file storage

This commit is contained in:
Sam Lantinga
2024-03-16 09:08:00 -07:00
parent ee0a23c7ab
commit ec3ba387d1
7 changed files with 78 additions and 5 deletions

View File

@@ -85,8 +85,8 @@ extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *override,
*
* While title storage can generally be kept open throughout runtime, user
* storage should only be opened when the client is ready to read/write files.
* This allows the backend to properly batch R/W operations and flush them
* when the container has been closed; ensuring safe and optimal save I/O.
* This allows the backend to properly batch file operations and flush them when
* the container has been closed; ensuring safe and optimal save I/O.
*
* \param org the name of your organization
* \param app the name of your application
@@ -107,6 +107,26 @@ extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *override,
*/
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenUserStorage(const char *org, const char *app, SDL_PropertiesID props);
/**
* Opens up a container for local filesystem storage.
*
* This is provided for development and tools. Portable applications should use SDL_OpenTitleStorage() for access to game data and SDL_OpenUserStorage() for access to user data.
*
* \param path the base path prepended to all storage paths, or NULL for no base path
* \returns a filesystem storage container on success or NULL on failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_OpenStorage
* \sa SDL_CloseStorage
* \sa SDL_StorageReady
* \sa SDL_GetStorageFileSize
* \sa SDL_ReadStorageFile
* \sa SDL_WriteStorageFile
* \sa SDL_GetStorageSpaceRemaining
*/
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenFileStorage(const char *path);
/**
* Opens up a container using a client-provided storage interface.
*