Class CXUnsavedFile

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

    public class CXUnsavedFile
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Provides the contents of a file that has not yet been saved to disk.

    Each CXUnsavedFile instance provides the name of a file on the system along with the current contents of that file that have not yet been saved to disk.

    Layout

    
     struct CXUnsavedFile {
         char const * Filename();
         char const * Contents();
         unsigned long Length();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • FILENAME, CONTENTS, LENGTH

        The struct member offsets.
    • Constructor Detail

      • CXUnsavedFile

        public CXUnsavedFile​(java.nio.ByteBuffer container)
        Creates a CXUnsavedFile 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
      • Filename, FilenameString

        public java.nio.ByteBuffer Filename()
        
        public java.lang.String FilenameString()
        
        the file whose contents have not yet been saved.

        This file must already exist in the file system.

      • Contents

        public java.nio.ByteBuffer Contents()
        a buffer containing the unsaved contents of this file
      • Length

        public long Length()
        the length of the unsaved contents of this buffer
      • Filename

        public CXUnsavedFile Filename​(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the Filename() field.
      • Contents

        public CXUnsavedFile Contents​(java.nio.ByteBuffer value)
        Sets the address of the specified ByteBuffer to the Contents() field.
      • set

        public CXUnsavedFile set​(java.nio.ByteBuffer Filename,
                                 java.nio.ByteBuffer Contents)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static CXUnsavedFile.Buffer calloc​(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new CXUnsavedFile.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
      • nFilename

        public static java.nio.ByteBuffer nFilename​(long struct)
        Unsafe version of Filename().
      • nFilenameString

        public static java.lang.String nFilenameString​(long struct)
        Unsafe version of FilenameString().
      • nContents

        public static java.nio.ByteBuffer nContents​(long struct)
        Unsafe version of Contents.
      • nLength

        public static long nLength​(long struct)
        Unsafe version of Length().
      • nFilename

        public static void nFilename​(long struct,
                                     java.nio.ByteBuffer value)
        Unsafe version of Filename.
      • nContents

        public static void nContents​(long struct,
                                     java.nio.ByteBuffer value)
        Unsafe version of Contents.
      • nLength

        public static void nLength​(long struct,
                                   long value)
        Sets the specified value to the Length field of the specified struct.
      • validate

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