Record Class STB_VorbisComment

java.lang.Object
java.lang.Record
club.doki7.stb.vorbis.datatype.STB_VorbisComment
All Implemented Interfaces:
IPointer, ISTB_VorbisComment

@ValueBasedCandidate @UnsafeConstructor public record STB_VorbisComment(@NotNull MemorySegment segment) extends Record implements ISTB_VorbisComment

Represents a pointer to a stb_vorbis_comment structure in native memory.

Structure

typedef struct stb_vorbis_comment {
    char* vendor;
    int commentListLength;
    char** commentList;
} stb_vorbis_comment;

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$vendor

      public static final MemoryLayout.PathElement PATH$vendor
    • PATH$commentListLength

      public static final MemoryLayout.PathElement PATH$commentListLength
    • PATH$commentList

      public static final MemoryLayout.PathElement PATH$commentList
    • LAYOUT$vendor

      public static final AddressLayout LAYOUT$vendor
    • LAYOUT$commentListLength

      public static final ValueLayout.OfInt LAYOUT$commentListLength
    • LAYOUT$commentList

      public static final AddressLayout LAYOUT$commentList
    • SIZE$vendor

      public static final long SIZE$vendor
    • SIZE$commentListLength

      public static final long SIZE$commentListLength
    • SIZE$commentList

      public static final long SIZE$commentList
    • OFFSET$vendor

      public static final long OFFSET$vendor
    • OFFSET$commentListLength

      public static final long OFFSET$commentListLength
    • OFFSET$commentList

      public static final long OFFSET$commentList
  • Constructor Details

    • STB_VorbisComment

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

    • allocate

      public static STB_VorbisComment allocate(Arena arena)
    • allocate

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

      public static STB_VorbisComment clone(Arena arena, STB_VorbisComment src)
    • vendor

      @Nullable public @Nullable BytePtr vendor()
      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.
    • vendor

      public STB_VorbisComment vendor(@Nullable @Nullable BytePtr value)
    • vendorRaw

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

      public void vendorRaw(@Pointer(comment="int8_t*") @NotNull @NotNull MemorySegment value)
    • commentListLength

      public int commentListLength()
    • commentListLength

      public STB_VorbisComment commentListLength(int value)
    • commentList

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

      public STB_VorbisComment commentList(@Nullable @Nullable PointerPtr value)
    • commentListRaw

      @Pointer(comment="void**") @NotNull public @NotNull MemorySegment commentListRaw()
    • commentListRaw

      public void commentListRaw(@Pointer(comment="void**") @NotNull @NotNull 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