Class AIString

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer


    public class AIString
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Represents an UTF-8 string, zero byte terminated.

    Member documentation

    • length – Binary length of the string excluding the terminal 0.
    • data – String buffer.

    Layout

     struct aiString {
         size_t length;
         char data[Assimp.MAXLEN];
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  AIString.Buffer
      An array of AIString structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int SIZEOF
      The struct size in bytes.
      • Fields inherited from interface org.lwjgl.system.Pointer

        POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor and Description
      AIString(java.nio.ByteBuffer container)
      Creates a AIString instance at the current position of the specified ByteBuffer container.
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • Constructor Detail

      • AIString

        public AIString(java.nio.ByteBuffer container)
        Creates a AIString instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • length

        public long length()
        Returns the value of the length field.
      • data

        public java.nio.ByteBuffer data()
        Returns a ByteBuffer view of the data field.
      • dataString

        public java.lang.String dataString()
        Decodes the null-terminated string stored in the data field.
      • data

        public AIString data(java.nio.ByteBuffer value)
        Copies the specified encoded string to the data field.
      • set

        public AIString set(AIString src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static AIString malloc()
        Returns a new AIString instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static AIString calloc()
        Returns a new AIString instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static AIString create()
        Returns a new AIString instance allocated with BufferUtils.
      • create

        public static AIString create(long address)
        Returns a new AIString instance for the specified memory address.
      • createSafe

        @Nullable
        public static AIString createSafe(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static AIString.Buffer malloc(int capacity)
        Returns a new AIString.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static AIString.Buffer calloc(int capacity)
        Returns a new AIString.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static AIString.Buffer create(int capacity)
        Returns a new AIString.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • create

        public static AIString.Buffer create(long address,
                                             int capacity)
        Create a AIString.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static AIString.Buffer createSafe(long address,
                                                 int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static AIString mallocStack()
        Returns a new AIString instance allocated on the thread-local MemoryStack.
      • callocStack

        public static AIString callocStack()
        Returns a new AIString instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static AIString mallocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new AIString instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static AIString callocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new AIString instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • mallocStack

        public static AIString.Buffer mallocStack(int capacity)
        Returns a new AIString.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static AIString.Buffer callocStack(int capacity)
        Returns a new AIString.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static AIString.Buffer mallocStack(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new AIString.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static AIString.Buffer callocStack(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new AIString.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity