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.

    Layout

    
     struct aiString {
         ai_uint32 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
      • Nested classes/interfaces inherited from class org.lwjgl.system.Struct

        org.lwjgl.system.Struct.StructValidation
    • 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.
    • 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 int length()
        Binary length of the string excluding the terminal 0.
      • data, dataString

        public java.nio.ByteBuffer data()
        
        public java.lang.String dataString()
        
        String buffer.
      • 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

        @Deprecated
        public static AIString mallocStack()
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static AIString callocStack()
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • mallocStack

        @Deprecated
        public static AIString mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static AIString callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • mallocStack

        @Deprecated
        public static AIString.Buffer mallocStack​(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
      • callocStack

        @Deprecated
        public static AIString.Buffer callocStack​(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
      • malloc

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

        public static AIString calloc​(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
      • malloc

        public static AIString.Buffer malloc​(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
      • calloc

        public static AIString.Buffer calloc​(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 int 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,
                                   int 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.