Class AIFile

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


    public class AIFile
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Actually, it's a data structure to wrap a set of fXXXX (e.g fopen) replacement functions.

    The default implementation of the functions utilizes the fXXX functions from the CRT. However, you can supply a custom implementation to Assimp by delivering a custom AIFileIO. Use this to enable reading from other sources, such as ZIP archives or memory locations.

    Member documentation

    • ReadProc – Callback to read from a file
    • WriteProc – Callback to write to a file
    • TellProc – Callback to retrieve the current position of the file cursor (ftell())
    • FileSizeProc – Callback to retrieve the size of the file, in bytes
    • SeekProc – Callback to set the current position of the file cursor (fseek())
    • FlushProc – Callback to flush the file contents
    • UserData – User-defined, opaque data

    Layout

     struct aiFile {
         aiFileReadProc ReadProc;
         aiFileWriteProc WriteProc;
         aiFileTellProc TellProc;
         aiFileTellProc FileSizeProc;
         aiFileSeek SeekProc;
         aiFileFlushProc FlushProc;
         aiUserData UserData;
     }
    • Field Detail

      • SIZEOF

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

      • AIFile

        public AIFile(java.nio.ByteBuffer container)
        Creates a AIFile 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
      • ReadProc

        public AIFileReadProc ReadProc()
        Returns the value of the ReadProc field.
      • WriteProc

        public AIFileWriteProc WriteProc()
        Returns the value of the WriteProc field.
      • TellProc

        public AIFileTellProc TellProc()
        Returns the value of the TellProc field.
      • FileSizeProc

        public AIFileTellProc FileSizeProc()
        Returns the value of the FileSizeProc field.
      • SeekProc

        public AIFileSeek SeekProc()
        Returns the value of the SeekProc field.
      • FlushProc

        public AIFileFlushProc FlushProc()
        Returns the value of the FlushProc field.
      • UserData

        public long UserData()
        Returns the value of the UserData field.
      • ReadProc

        public AIFile ReadProc(AIFileReadProcI value)
        Sets the specified value to the ReadProc field.
      • WriteProc

        public AIFile WriteProc(AIFileWriteProcI value)
        Sets the specified value to the WriteProc field.
      • TellProc

        public AIFile TellProc(AIFileTellProcI value)
        Sets the specified value to the TellProc field.
      • FileSizeProc

        public AIFile FileSizeProc(AIFileTellProcI value)
        Sets the specified value to the FileSizeProc field.
      • SeekProc

        public AIFile SeekProc(AIFileSeekI value)
        Sets the specified value to the SeekProc field.
      • FlushProc

        public AIFile FlushProc(AIFileFlushProcI value)
        Sets the specified value to the FlushProc field.
      • UserData

        public AIFile UserData(long value)
        Sets the specified value to the UserData field.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static AIFile.Buffer callocStack(int capacity,
                                                org.lwjgl.system.MemoryStack stack)
        Returns a new AIFile.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
      • validate

        public static void validate(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate(long array,
                                    int count)
        Calls AIFile.validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array