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[Assimp.MAXLEN] – String buffer.

    Layout

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

      Nested Classes 
      Modifier and Type Class 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 Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int DATA
      LENGTH
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      AIString​(java.nio.ByteBuffer container)
      Creates a AIString instance at the current position of the specified ByteBuffer container.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static AIString calloc()
      Returns a new AIString instance allocated with memCalloc.
      static AIString.Buffer calloc​(int capacity)
      Returns a new AIString.Buffer instance allocated with memCalloc.
      static AIString callocStack()
      Returns a new AIString instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      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.
      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.
      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.
      static AIString create()
      Returns a new AIString instance allocated with BufferUtils.
      static AIString.Buffer create​(int capacity)
      Returns a new AIString.Buffer instance allocated with BufferUtils.
      static AIString create​(long address)
      Returns a new AIString instance for the specified memory address.
      static AIString.Buffer create​(long address, int capacity)
      Create a AIString.Buffer instance at the specified memory.
      static AIString createSafe​(long address)
      Like create, but returns null if address is NULL.
      static AIString.Buffer createSafe​(long address, int capacity)
      Like create, but returns null if address is NULL.
      java.nio.ByteBuffer data()
      Returns a ByteBuffer view of the data field.
      AIString data​(java.nio.ByteBuffer value)
      Copies the specified encoded string to the data field.
      java.lang.String dataString()
      Decodes the null-terminated string stored in the data field.
      long length()
      Returns the value of the length field.
      static AIString malloc()
      Returns a new AIString instance allocated with memAlloc.
      static AIString.Buffer malloc​(int capacity)
      Returns a new AIString.Buffer instance allocated with memAlloc.
      static AIString mallocStack()
      Returns a new AIString instance allocated on the thread-local MemoryStack.
      static AIString.Buffer mallocStack​(int capacity)
      Returns a new AIString.Buffer instance allocated on the thread-local MemoryStack.
      static AIString.Buffer mallocStack​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new AIString.Buffer instance allocated on the specified MemoryStack.
      static AIString mallocStack​(org.lwjgl.system.MemoryStack stack)
      Returns a new AIString instance allocated on the specified MemoryStack.
      static java.nio.ByteBuffer ndata​(long struct)
      Unsafe version of data().
      static void ndata​(long struct, java.nio.ByteBuffer value)
      Unsafe version of data.
      static java.lang.String ndataString​(long struct)
      Unsafe version of dataString().
      static long nlength​(long struct)
      Unsafe version of length().
      static void nlength​(long struct, long value)
      Sets the specified value to the length field of the specified struct.
      AIString set​(AIString src)
      Copies the specified struct data to this struct.
      int sizeof()  
      • Methods inherited from interface org.lwjgl.system.NativeResource

        close, free
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from class org.lwjgl.system.Pointer.Default

        address, equals, hashCode, toString
      • Methods inherited from class org.lwjgl.system.Struct

        clear, free, isNull
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • LENGTH, DATA

        The struct member offsets.
    • 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
      • nlength

        public static long nlength​(long struct)
        Unsafe version of length().
      • ndata

        public static java.nio.ByteBuffer ndata​(long struct)
        Unsafe version of data().
      • ndataString

        public static java.lang.String ndataString​(long struct)
        Unsafe version of dataString().
      • nlength

        public static void nlength​(long struct,
                                   long value)
        Sets the specified value to the length field of the specified struct.
      • ndata

        public static void ndata​(long struct,
                                 java.nio.ByteBuffer value)
        Unsafe version of data.