Package org.lwjgl.llvm
Class CXUnsavedFile
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.llvm.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.Member documentation
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
Layout
struct CXUnsavedFile { char const * Filename; char const * Contents; unsigned long Length; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CXUnsavedFile.Buffer
An array ofCXUnsavedFile
structs.
-
Constructor Summary
Constructors Constructor Description CXUnsavedFile(java.nio.ByteBuffer container)
Creates aCXUnsavedFile
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CXUnsavedFile
calloc()
Returns a newCXUnsavedFile
instance allocated withmemCalloc
.static CXUnsavedFile.Buffer
calloc(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated withmemCalloc
.static CXUnsavedFile
callocStack()
Returns a newCXUnsavedFile
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static CXUnsavedFile.Buffer
callocStack(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static CXUnsavedFile.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCXUnsavedFile.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static CXUnsavedFile
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newCXUnsavedFile
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.java.nio.ByteBuffer
Contents()
Returns aByteBuffer
view of the data pointed to by theContents
field.CXUnsavedFile
Contents(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to theContents
field.static CXUnsavedFile
create()
Returns a newCXUnsavedFile
instance allocated withBufferUtils
.static CXUnsavedFile.Buffer
create(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated withBufferUtils
.static CXUnsavedFile
create(long address)
Returns a newCXUnsavedFile
instance for the specified memory address.static CXUnsavedFile.Buffer
create(long address, int capacity)
Create aCXUnsavedFile.Buffer
instance at the specified memory.static CXUnsavedFile
createSafe(long address)
static CXUnsavedFile.Buffer
createSafe(long address, int capacity)
java.nio.ByteBuffer
Filename()
Returns aByteBuffer
view of the null-terminated string pointed to by theFilename
field.CXUnsavedFile
Filename(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to theFilename
field.java.lang.String
FilenameString()
Decodes the null-terminated string pointed to by theFilename
field.long
Length()
Returns the value of theLength
field.static CXUnsavedFile
malloc()
Returns a newCXUnsavedFile
instance allocated withmemAlloc
.static CXUnsavedFile.Buffer
malloc(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated withmemAlloc
.static CXUnsavedFile
mallocStack()
Returns a newCXUnsavedFile
instance allocated on the thread-localMemoryStack
.static CXUnsavedFile.Buffer
mallocStack(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated on the thread-localMemoryStack
.static CXUnsavedFile.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCXUnsavedFile.Buffer
instance allocated on the specifiedMemoryStack
.static CXUnsavedFile
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newCXUnsavedFile
instance allocated on the specifiedMemoryStack
.static java.nio.ByteBuffer
nContents(long struct)
Unsafe version ofContents
.static void
nContents(long struct, java.nio.ByteBuffer value)
Unsafe version ofContents
.static java.nio.ByteBuffer
nFilename(long struct)
Unsafe version ofFilename()
.static void
nFilename(long struct, java.nio.ByteBuffer value)
Unsafe version ofFilename
.static java.lang.String
nFilenameString(long struct)
Unsafe version ofFilenameString()
.static long
nLength(long struct)
Unsafe version ofLength()
.static void
nLength(long struct, long value)
Sets the specified value to theLength
field of the specifiedstruct
.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 beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
CXUnsavedFile
public CXUnsavedFile(java.nio.ByteBuffer container)
Creates aCXUnsavedFile
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
Filename
public java.nio.ByteBuffer Filename()
Returns aByteBuffer
view of the null-terminated string pointed to by theFilename
field.
-
FilenameString
public java.lang.String FilenameString()
Decodes the null-terminated string pointed to by theFilename
field.
-
Contents
public java.nio.ByteBuffer Contents()
Returns aByteBuffer
view of the data pointed to by theContents
field.
-
Length
public long Length()
Returns the value of theLength
field.
-
Filename
public CXUnsavedFile Filename(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to theFilename
field.
-
Contents
public CXUnsavedFile Contents(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to theContents
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 newCXUnsavedFile
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static CXUnsavedFile calloc()
Returns a newCXUnsavedFile
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static CXUnsavedFile create()
Returns a newCXUnsavedFile
instance allocated withBufferUtils
.
-
create
public static CXUnsavedFile create(long address)
Returns a newCXUnsavedFile
instance for the specified memory address.
-
createSafe
@Nullable public static CXUnsavedFile createSafe(long address)
-
malloc
public static CXUnsavedFile.Buffer malloc(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static CXUnsavedFile.Buffer calloc(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static CXUnsavedFile.Buffer create(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static CXUnsavedFile.Buffer create(long address, int capacity)
Create aCXUnsavedFile.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static CXUnsavedFile.Buffer createSafe(long address, int capacity)
-
mallocStack
public static CXUnsavedFile mallocStack()
Returns a newCXUnsavedFile
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static CXUnsavedFile callocStack()
Returns a newCXUnsavedFile
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static CXUnsavedFile mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newCXUnsavedFile
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static CXUnsavedFile callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newCXUnsavedFile
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static CXUnsavedFile.Buffer mallocStack(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static CXUnsavedFile.Buffer callocStack(int capacity)
Returns a newCXUnsavedFile.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static CXUnsavedFile.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCXUnsavedFile.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static CXUnsavedFile.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCXUnsavedFile.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nFilename
public static java.nio.ByteBuffer nFilename(long struct)
Unsafe version ofFilename()
.
-
nFilenameString
public static java.lang.String nFilenameString(long struct)
Unsafe version ofFilenameString()
.
-
nContents
public static java.nio.ByteBuffer nContents(long struct)
Unsafe version ofContents
.
-
nLength
public static long nLength(long struct)
Unsafe version ofLength()
.
-
nFilename
public static void nFilename(long struct, java.nio.ByteBuffer value)
Unsafe version ofFilename
.
-
nContents
public static void nContents(long struct, java.nio.ByteBuffer value)
Unsafe version ofContents
.
-
nLength
public static void nLength(long struct, long value)
Sets the specified value to theLength
field of the specifiedstruct
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-