sdlxGetStorageFileSize function storage

int? sdlxGetStorageFileSize(
  1. Pointer<SdlStorage> storage,
  2. String path
)

Query the size of a file within a storage container.

\param storage a storage container to query. \param path the relative path of the file to query. \param length a pointer to be filled with the file's length. \returns true if the file could be queried or false on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.2.0.

\sa SDL_ReadStorageFile \sa SDL_StorageReady

extern SDL_DECLSPEC bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length)

Implementation

int? sdlxGetStorageFileSize(Pointer<SdlStorage> storage, String path) {
  int? result;
  final lengthPointer = ffi.calloc<Uint64>();
  final bl = sdlGetStorageFileSize(storage, path, lengthPointer);
  if (bl) {
    result = lengthPointer.value;
  }
  lengthPointer.callocFree();
  return result;
}