public class CXUnsavedFile
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
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.
Filename –
the file whose contents have not yet been saved.
This file must already exist in the file system.
Contents – a buffer containing the unsaved contents of this fileLength – the length of the unsaved contents of this buffer
struct CXUnsavedFile {
char const * Filename;
char const * Contents;
unsigned long Length;
}| Modifier and Type | Class and Description |
|---|---|
static class |
CXUnsavedFile.Buffer
An array of
CXUnsavedFile structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
CONTENTS
The struct member offsets.
|
static int |
FILENAME
The struct member offsets.
|
static int |
LENGTH
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
| Constructor and Description |
|---|
CXUnsavedFile(java.nio.ByteBuffer container)
Creates a
CXUnsavedFile instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
static CXUnsavedFile |
calloc()
Returns a new
CXUnsavedFile instance allocated with memCalloc. |
static CXUnsavedFile.Buffer |
calloc(int capacity)
Returns a new
CXUnsavedFile.Buffer instance allocated with memCalloc. |
static CXUnsavedFile |
callocStack()
Returns a new
CXUnsavedFile instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static CXUnsavedFile.Buffer |
callocStack(int capacity)
Returns a new
CXUnsavedFile.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static CXUnsavedFile.Buffer |
callocStack(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. |
static CXUnsavedFile |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
CXUnsavedFile instance allocated on the specified MemoryStack and initializes all its bits to zero. |
java.nio.ByteBuffer |
Contents()
Returns a
ByteBuffer view of the data pointed to by the Contents field. |
CXUnsavedFile |
Contents(java.nio.ByteBuffer value)
Sets the address of the specified
ByteBuffer to the Contents field. |
static CXUnsavedFile |
create()
Returns a new
CXUnsavedFile instance allocated with BufferUtils. |
static CXUnsavedFile.Buffer |
create(int capacity)
Returns a new
CXUnsavedFile.Buffer instance allocated with BufferUtils. |
static CXUnsavedFile |
create(long address)
Returns a new
CXUnsavedFile instance for the specified memory address. |
static CXUnsavedFile.Buffer |
create(long address,
int capacity)
Create a
CXUnsavedFile.Buffer instance at the specified memory. |
static CXUnsavedFile |
createSafe(long address)
|
static CXUnsavedFile.Buffer |
createSafe(long address,
int capacity)
|
java.nio.ByteBuffer |
Filename()
Returns a
ByteBuffer view of the null-terminated string pointed to by the Filename field. |
CXUnsavedFile |
Filename(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to the
Filename field. |
java.lang.String |
FilenameString()
Decodes the null-terminated string pointed to by the
Filename field. |
long |
Length()
Returns the value of the
Length field. |
static CXUnsavedFile |
malloc()
Returns a new
CXUnsavedFile instance allocated with memAlloc. |
static CXUnsavedFile.Buffer |
malloc(int capacity)
Returns a new
CXUnsavedFile.Buffer instance allocated with memAlloc. |
static CXUnsavedFile |
mallocStack()
Returns a new
CXUnsavedFile instance allocated on the thread-local MemoryStack. |
static CXUnsavedFile.Buffer |
mallocStack(int capacity)
Returns a new
CXUnsavedFile.Buffer instance allocated on the thread-local MemoryStack. |
static CXUnsavedFile.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
CXUnsavedFile.Buffer instance allocated on the specified MemoryStack. |
static CXUnsavedFile |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
CXUnsavedFile instance allocated on the specified MemoryStack. |
static java.nio.ByteBuffer |
nContents(long struct)
Unsafe version of
Contents. |
static void |
nContents(long struct,
java.nio.ByteBuffer value)
Unsafe version of
Contents. |
static java.nio.ByteBuffer |
nFilename(long struct)
Unsafe version of
Filename(). |
static void |
nFilename(long struct,
java.nio.ByteBuffer value)
Unsafe version of
Filename. |
static java.lang.String |
nFilenameString(long struct)
Unsafe version of
FilenameString(). |
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. |
CXUnsavedFile |
set(java.nio.ByteBuffer Filename,
java.nio.ByteBuffer Contents)
Initializes this struct with the specified values.
|
CXUnsavedFile |
set(CXUnsavedFile src)
Copies the specified struct data to this struct.
|
int |
sizeof() |
static void |
validate(long struct)
Validates pointer members that should not be
NULL. |
static void |
validate(long array,
int count)
Calls
validate(long) for each struct contained in the specified struct array. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int FILENAME
public static final int CONTENTS
public static final int LENGTH
public CXUnsavedFile(java.nio.ByteBuffer container)
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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic java.nio.ByteBuffer Filename()
ByteBuffer view of the null-terminated string pointed to by the Filename field.public java.lang.String FilenameString()
Filename field.public java.nio.ByteBuffer Contents()
ByteBuffer view of the data pointed to by the Contents field.public long Length()
Length field.public CXUnsavedFile Filename(java.nio.ByteBuffer value)
Filename field.public CXUnsavedFile Contents(java.nio.ByteBuffer value)
ByteBuffer to the Contents field.public CXUnsavedFile set(java.nio.ByteBuffer Filename, java.nio.ByteBuffer Contents)
public CXUnsavedFile set(CXUnsavedFile src)
src - the source structpublic static CXUnsavedFile malloc()
CXUnsavedFile instance allocated with memAlloc. The instance must be explicitly freed.public static CXUnsavedFile calloc()
CXUnsavedFile instance allocated with memCalloc. The instance must be explicitly freed.public static CXUnsavedFile create()
CXUnsavedFile instance allocated with BufferUtils.public static CXUnsavedFile create(long address)
CXUnsavedFile instance for the specified memory address.@Nullable public static CXUnsavedFile createSafe(long address)
public static CXUnsavedFile.Buffer malloc(int capacity)
CXUnsavedFile.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static CXUnsavedFile.Buffer calloc(int capacity)
CXUnsavedFile.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static CXUnsavedFile.Buffer create(int capacity)
CXUnsavedFile.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static CXUnsavedFile.Buffer create(long address, int capacity)
CXUnsavedFile.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static CXUnsavedFile.Buffer createSafe(long address, int capacity)
public static CXUnsavedFile mallocStack()
CXUnsavedFile instance allocated on the thread-local MemoryStack.public static CXUnsavedFile callocStack()
CXUnsavedFile instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static CXUnsavedFile mallocStack(org.lwjgl.system.MemoryStack stack)
CXUnsavedFile instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static CXUnsavedFile callocStack(org.lwjgl.system.MemoryStack stack)
CXUnsavedFile instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static CXUnsavedFile.Buffer mallocStack(int capacity)
CXUnsavedFile.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static CXUnsavedFile.Buffer callocStack(int capacity)
CXUnsavedFile.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static CXUnsavedFile.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
CXUnsavedFile.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static CXUnsavedFile.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
CXUnsavedFile.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static java.nio.ByteBuffer nFilename(long struct)
Filename().public static java.lang.String nFilenameString(long struct)
FilenameString().public static java.nio.ByteBuffer nContents(long struct)
Contents.public static long nLength(long struct)
Length().public static void nFilename(long struct,
java.nio.ByteBuffer value)
Filename.public static void nContents(long struct,
java.nio.ByteBuffer value)
Contents.public static void nLength(long struct,
long value)
Length field of the specified struct.public static void validate(long struct)
NULL.struct - the struct to validatepublic static void validate(long array,
int count)
validate(long) for each struct contained in the specified struct array.array - the struct array to validatecount - the number of structs in arrayCopyright LWJGL. All Rights Reserved. License terms.