Record Class SDL_StorageInterface

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_StorageInterface
All Implemented Interfaces:
IPointer, ISDL_StorageInterface

@ValueBasedCandidate @UnsafeConstructor public record SDL_StorageInterface(@NotNull MemorySegment segment) extends Record implements ISDL_StorageInterface

Function interface for SDL_Storage.

Apps that want to supply a custom implementation of SDL_Storage will fill in all the functions in this struct, and then pass it to SDL_OpenStorage to create a custom SDL_Storage object.

It is not usually necessary to do this; SDL provides standard implementations for many things you might expect to do with an SDL_Storage.

This structure should be initialized using SDL_INIT_INTERFACE()

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_INIT_INTERFACE

Structure

typedef struct SDL_StorageInterface {
    Uint32 version;
    PFN_SDL_StorageInterface_close close; // optional
    PFN_SDL_StorageInterface_ready ready; // optional
    PFN_SDL_StorageInterface_enumerate enumerate; // optional
    PFN_SDL_StorageInterface_info info; // optional
    PFN_SDL_StorageInterface_read_file read_file; // optional
    PFN_SDL_StorageInterface_write_file write_file; // optional
    PFN_SDL_StorageInterface_mkdir mkdir; // optional
    PFN_SDL_StorageInterface_remove remove; // optional
    PFN_SDL_StorageInterface_rename rename; // optional
    PFN_SDL_StorageInterface_copy copy; // optional
    PFN_SDL_StorageInterface_space_remaining space_remaining; // optional
} SDL_StorageInterface;

Contracts

The property segment() should always be not-null (segment != NULL && !segment.equals(MemorySegment.NULL)), and properly aligned to LAYOUT.byteAlignment() bytes. To represent null pointer, you may use a Java null instead. See the documentation of IPointer.segment() for more details.

The constructor of this class is marked as UnsafeConstructor, because it does not perform any runtime check. The constructor can be useful for automatic code generators.