public class CXString
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
The CXString type is used to return strings from the interface when the ownership of that string might differ from one call to the next. Use
getCString to retrieve the string data and, once finished with the string data, call disposeString to free the string.
struct CXString {
void const * data;
unsigned private_flags;
}| Modifier and Type | Class and Description |
|---|---|
static class |
CXString.Buffer
An array of
CXString structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
DATA
The struct member offsets.
|
static int |
PRIVATE_FLAGS
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
| Constructor and Description |
|---|
CXString(java.nio.ByteBuffer container)
Creates a
CXString instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
static CXString |
calloc()
Returns a new
CXString instance allocated with memCalloc. |
static CXString.Buffer |
calloc(int capacity)
Returns a new
CXString.Buffer instance allocated with memCalloc. |
static CXString |
callocStack()
Returns a new
CXString instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static CXString.Buffer |
callocStack(int capacity)
Returns a new
CXString.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static CXString.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
CXString.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static CXString |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
CXString instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static CXString |
create()
Returns a new
CXString instance allocated with BufferUtils. |
static CXString.Buffer |
create(int capacity)
Returns a new
CXString.Buffer instance allocated with BufferUtils. |
static CXString |
create(long address)
Returns a new
CXString instance for the specified memory address. |
static CXString.Buffer |
create(long address,
int capacity)
Create a
CXString.Buffer instance at the specified memory. |
static CXString |
createSafe(long address)
|
static CXString.Buffer |
createSafe(long address,
int capacity)
|
java.nio.ByteBuffer |
data(int capacity)
Returns a
ByteBuffer view of the data pointed to by the data field. |
static CXString |
malloc()
Returns a new
CXString instance allocated with memAlloc. |
static CXString.Buffer |
malloc(int capacity)
Returns a new
CXString.Buffer instance allocated with memAlloc. |
static CXString |
mallocStack()
Returns a new
CXString instance allocated on the thread-local MemoryStack. |
static CXString.Buffer |
mallocStack(int capacity)
Returns a new
CXString.Buffer instance allocated on the thread-local MemoryStack. |
static CXString.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
CXString.Buffer instance allocated on the specified MemoryStack. |
static CXString |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
CXString instance allocated on the specified MemoryStack. |
static java.nio.ByteBuffer |
ndata(long struct,
int capacity)
Unsafe version of
data. |
static int |
nprivate_flags(long struct)
Unsafe version of
private_flags(). |
int |
private_flags()
Returns the value of the
private_flags field. |
int |
sizeof() |
public static final int SIZEOF
public static final int ALIGNOF
public static final int DATA
public static final int PRIVATE_FLAGS
public CXString(java.nio.ByteBuffer container)
CXString 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 data(int capacity)
ByteBuffer view of the data pointed to by the data field.capacity - the number of elements in the returned bufferpublic int private_flags()
private_flags field.public static CXString malloc()
CXString instance allocated with memAlloc. The instance must be explicitly freed.public static CXString calloc()
CXString instance allocated with memCalloc. The instance must be explicitly freed.public static CXString create()
CXString instance allocated with BufferUtils.public static CXString create(long address)
CXString instance for the specified memory address.@Nullable public static CXString createSafe(long address)
public static CXString.Buffer malloc(int capacity)
CXString.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static CXString.Buffer calloc(int capacity)
CXString.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static CXString.Buffer create(int capacity)
CXString.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static CXString.Buffer create(long address, int capacity)
CXString.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static CXString.Buffer createSafe(long address, int capacity)
public static CXString mallocStack()
CXString instance allocated on the thread-local MemoryStack.public static CXString callocStack()
CXString instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static CXString mallocStack(org.lwjgl.system.MemoryStack stack)
CXString instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static CXString callocStack(org.lwjgl.system.MemoryStack stack)
CXString instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static CXString.Buffer mallocStack(int capacity)
CXString.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static CXString.Buffer callocStack(int capacity)
CXString.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static CXString.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
CXString.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static CXString.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
CXString.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 ndata(long struct,
int capacity)
data.public static int nprivate_flags(long struct)
private_flags().Copyright LWJGL. All Rights Reserved. License terms.