sdlSaveFileIo function iostream

bool sdlSaveFileIo(
  1. Pointer<SdlIoStream> src,
  2. Pointer<NativeType> data,
  3. int datasize,
  4. bool closeio,
)

Save all the data into an SDL data stream.

\param src the SDL_IOStream to write all data to. \param data the data to be written. If datasize is 0, may be NULL or a invalid pointer. \param datasize the number of bytes to be written. \param closeio if true, calls SDL_CloseIO() on src before returning, even in the case of an error. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety Do not use the same SDL_IOStream from two threads at once.

\since This function is available since SDL 3.2.0.

\sa SDL_SaveFile \sa SDL_LoadFile_IO

extern SDL_DECLSPEC bool SDLCALL SDL_SaveFile_IO(SDL_IOStream *src, const void *data, size_t datasize, bool closeio)

Implementation

bool sdlSaveFileIo(
  Pointer<SdlIoStream> src,
  Pointer<NativeType> data,
  int datasize,
  bool closeio,
) {
  final sdlSaveFileIoLookupFunction = _libSdl
      .lookupFunction<
        Uint8 Function(
          Pointer<SdlIoStream> src,
          Pointer<NativeType> data,
          Uint32 datasize,
          Uint8 closeio,
        ),
        int Function(
          Pointer<SdlIoStream> src,
          Pointer<NativeType> data,
          int datasize,
          int closeio,
        )
      >('SDL_SaveFile_IO');
  return sdlSaveFileIoLookupFunction(src, data, datasize, closeio ? 1 : 0) == 1;
}