Package org.lwjgl.llvm
Class CXString
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.llvm.CXString
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class CXString extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceA character string.The
CXStringtype is used to return strings from the interface when the ownership of that string might differ from one call to the next. UsegetCStringto retrieve the string data and, once finished with the string data, calldisposeStringto free the string.Layout
struct CXString { void const * data; unsigned private_flags; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCXString.BufferAn array ofCXStringstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intDATA
PRIVATE_FLAGSThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description CXString(java.nio.ByteBuffer container)Creates aCXStringinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CXStringcalloc()Returns a newCXStringinstance allocated withmemCalloc.static CXString.Buffercalloc(int capacity)Returns a newCXString.Bufferinstance allocated withmemCalloc.static CXString.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCXString.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CXStringcalloc(org.lwjgl.system.MemoryStack stack)Returns a newCXStringinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CXStringcallocStack()Deprecated.static CXString.BuffercallocStack(int capacity)Deprecated.static CXString.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static CXStringcallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static CXStringcreate()Returns a newCXStringinstance allocated withBufferUtils.static CXString.Buffercreate(int capacity)Returns a newCXString.Bufferinstance allocated withBufferUtils.static CXStringcreate(long address)Returns a newCXStringinstance for the specified memory address.static CXString.Buffercreate(long address, int capacity)Create aCXString.Bufferinstance at the specified memory.static CXStringcreateSafe(long address)static CXString.BuffercreateSafe(long address, int capacity)java.nio.ByteBufferdata(int capacity)static CXStringmalloc()Returns a newCXStringinstance allocated withmemAlloc.static CXString.Buffermalloc(int capacity)Returns a newCXString.Bufferinstance allocated withmemAlloc.static CXString.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCXString.Bufferinstance allocated on the specifiedMemoryStack.static CXStringmalloc(org.lwjgl.system.MemoryStack stack)Returns a newCXStringinstance allocated on the specifiedMemoryStack.static CXStringmallocStack()Deprecated.static CXString.BuffermallocStack(int capacity)Deprecated.static CXString.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static CXStringmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static java.nio.ByteBufferndata(long struct, int capacity)Unsafe version ofdata.static intnprivate_flags(long struct)Unsafe version ofprivate_flags().intprivate_flags()intsizeof()
-
-
-
Constructor Detail
-
CXString
public CXString(java.nio.ByteBuffer container)
Creates aCXStringinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
data
public java.nio.ByteBuffer data(int capacity)
- Parameters:
capacity- the number of elements in the returned buffer- Returns:
- a
ByteBufferview of the data pointed to by thedatafield.
-
private_flags
public int private_flags()
- Returns:
- the value of the
private_flagsfield.
-
malloc
public static CXString malloc()
Returns a newCXStringinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static CXString calloc()
Returns a newCXStringinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static CXString create()
Returns a newCXStringinstance allocated withBufferUtils.
-
create
public static CXString create(long address)
Returns a newCXStringinstance for the specified memory address.
-
createSafe
@Nullable public static CXString createSafe(long address)
-
malloc
public static CXString.Buffer malloc(int capacity)
Returns a newCXString.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static CXString.Buffer calloc(int capacity)
Returns a newCXString.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static CXString.Buffer create(int capacity)
Returns a newCXString.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static CXString.Buffer create(long address, int capacity)
Create aCXString.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static CXString.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static CXString mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static CXString callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static CXString mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static CXString callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static CXString.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static CXString.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static CXString.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static CXString.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static CXString malloc(org.lwjgl.system.MemoryStack stack)
Returns a newCXStringinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static CXString calloc(org.lwjgl.system.MemoryStack stack)
Returns a newCXStringinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static CXString.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCXString.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static CXString.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCXString.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ndata
public static java.nio.ByteBuffer ndata(long struct, int capacity)Unsafe version ofdata.
-
nprivate_flags
public static int nprivate_flags(long struct)
Unsafe version ofprivate_flags().
-
-