public class NkStr
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
NkTextEdit object inside one of the copy and
paste functions and even there only for more advanced cases.
len – in codepoints/runes/glyphs
struct nk_str {
struct nk_buffer buffer;
int len;
}| Modifier and Type | Class and Description |
|---|---|
static class |
NkStr.Buffer
An array of
NkStr structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
BUFFER
The struct member offsets.
|
static int |
LEN
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
| Constructor and Description |
|---|
NkStr(java.nio.ByteBuffer container)
Creates a
NkStr instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
NkBuffer |
buffer()
Returns a
NkBuffer view of the buffer field. |
static NkStr |
calloc()
Returns a new
NkStr instance allocated with memCalloc. |
static NkStr.Buffer |
calloc(int capacity)
Returns a new
NkStr.Buffer instance allocated with memCalloc. |
static NkStr |
callocStack()
Returns a new
NkStr instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static NkStr.Buffer |
callocStack(int capacity)
Returns a new
NkStr.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static NkStr.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
NkStr.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static NkStr |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
NkStr instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static NkStr |
create()
Returns a new
NkStr instance allocated with BufferUtils. |
static NkStr.Buffer |
create(int capacity)
Returns a new
NkStr.Buffer instance allocated with BufferUtils. |
static NkStr |
create(long address)
Returns a new
NkStr instance for the specified memory address. |
static NkStr.Buffer |
create(long address,
int capacity)
Create a
NkStr.Buffer instance at the specified memory. |
static NkStr |
createSafe(long address)
|
static NkStr.Buffer |
createSafe(long address,
int capacity)
|
int |
len()
Returns the value of the
len field. |
static NkStr |
malloc()
Returns a new
NkStr instance allocated with memAlloc. |
static NkStr.Buffer |
malloc(int capacity)
Returns a new
NkStr.Buffer instance allocated with memAlloc. |
static NkStr |
mallocStack()
Returns a new
NkStr instance allocated on the thread-local MemoryStack. |
static NkStr.Buffer |
mallocStack(int capacity)
Returns a new
NkStr.Buffer instance allocated on the thread-local MemoryStack. |
static NkStr.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
NkStr.Buffer instance allocated on the specified MemoryStack. |
static NkStr |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
NkStr instance allocated on the specified MemoryStack. |
static NkBuffer |
nbuffer(long struct)
Unsafe version of
buffer(). |
static int |
nlen(long struct)
Unsafe version of
len(). |
int |
sizeof() |
public static final int SIZEOF
public static final int ALIGNOF
public static final int BUFFER
public static final int LEN
public NkStr(java.nio.ByteBuffer container)
NkStr 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 int len()
len field.public static NkStr malloc()
NkStr instance allocated with memAlloc. The instance must be explicitly freed.public static NkStr calloc()
NkStr instance allocated with memCalloc. The instance must be explicitly freed.public static NkStr create()
NkStr instance allocated with BufferUtils.public static NkStr create(long address)
NkStr instance for the specified memory address.@Nullable public static NkStr createSafe(long address)
public static NkStr.Buffer malloc(int capacity)
NkStr.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static NkStr.Buffer calloc(int capacity)
NkStr.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static NkStr.Buffer create(int capacity)
NkStr.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static NkStr.Buffer create(long address, int capacity)
NkStr.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static NkStr.Buffer createSafe(long address, int capacity)
public static NkStr mallocStack()
NkStr instance allocated on the thread-local MemoryStack.public static NkStr callocStack()
NkStr instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static NkStr mallocStack(org.lwjgl.system.MemoryStack stack)
NkStr instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static NkStr callocStack(org.lwjgl.system.MemoryStack stack)
NkStr instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static NkStr.Buffer mallocStack(int capacity)
NkStr.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static NkStr.Buffer callocStack(int capacity)
NkStr.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static NkStr.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
NkStr.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static NkStr.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
NkStr.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 int nlen(long struct)
len().Copyright LWJGL. All Rights Reserved. License terms.