Record Class SDL_DialogFileFilter

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_DialogFileFilter
All Implemented Interfaces:
IPointer, ISDL_DialogFileFilter

@ValueBasedCandidate @UnsafeConstructor public record SDL_DialogFileFilter(@NotNull MemorySegment segment) extends Record implements ISDL_DialogFileFilter

An entry for filters for file dialogs.

name is a user-readable label for the filter (for example, "Office document").

pattern is a semicolon-separated list of file extensions (for example, "doc;docx"). File extensions may only contain alphanumeric characters, hyphens, underscores and periods. Alternatively, the whole string can be a single asterisk ("*"), which serves as an "All files" filter.

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_DialogFileCallback
  • SDL_ShowOpenFileDialog
  • SDL_ShowSaveFileDialog
  • SDL_ShowOpenFolderDialog
  • SDL_ShowFileDialogWithProperties

Structure

typedef struct SDL_DialogFileFilter {
    char const* name;
    char const* pattern;
} SDL_DialogFileFilter;

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.

  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$name

      public static final MemoryLayout.PathElement PATH$name
    • PATH$pattern

      public static final MemoryLayout.PathElement PATH$pattern
    • LAYOUT$name

      public static final AddressLayout LAYOUT$name
    • LAYOUT$pattern

      public static final AddressLayout LAYOUT$pattern
    • SIZE$name

      public static final long SIZE$name
    • SIZE$pattern

      public static final long SIZE$pattern
    • OFFSET$name

      public static final long OFFSET$name
    • OFFSET$pattern

      public static final long OFFSET$pattern
  • Constructor Details

    • SDL_DialogFileFilter

      public SDL_DialogFileFilter(@NotNull @NotNull MemorySegment segment)
      Creates an instance of a SDL_DialogFileFilter record class.
      Parameters:
      segment - the value for the segment record component
  • Method Details

    • allocate

      public static SDL_DialogFileFilter allocate(Arena arena)
    • allocate

      public static SDL_DialogFileFilter.Ptr allocate(Arena arena, long count)
    • clone

      public static SDL_DialogFileFilter clone(Arena arena, SDL_DialogFileFilter src)
    • name

      @Nullable public @Nullable BytePtr name()
      Note: the returned BytePtr does not have correct BytePtr.size() property. It's up to user to track the size of the buffer, and use BytePtr.reinterpret(long) to set the size before actually reading from or writing to the buffer.
    • name

      public SDL_DialogFileFilter name(@Nullable @Nullable BytePtr value)
    • nameRaw

      @Pointer(comment="int8_t*") public MemorySegment nameRaw()
    • nameRaw

      public void nameRaw(@Pointer(comment="int8_t*") MemorySegment value)
    • pattern

      @Nullable public @Nullable BytePtr pattern()
      Note: the returned BytePtr does not have correct BytePtr.size() property. It's up to user to track the size of the buffer, and use BytePtr.reinterpret(long) to set the size before actually reading from or writing to the buffer.
    • pattern

      public SDL_DialogFileFilter pattern(@Nullable @Nullable BytePtr value)
    • patternRaw

      @Pointer(comment="int8_t*") public MemorySegment patternRaw()
    • patternRaw

      public void patternRaw(@Pointer(comment="int8_t*") MemorySegment value)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • segment

      @NotNull public @NotNull MemorySegment segment()
      Returns the value of the segment record component.
      Specified by:
      segment in interface IPointer
      Returns:
      the value of the segment record component