Package de.intarsys.nativec.type
Class NativeString
- java.lang.Object
-
- de.intarsys.nativec.type.NativeObject
-
- de.intarsys.nativec.type.NativeString
-
- All Implemented Interfaces:
INativeObject
public class NativeString extends NativeObject
A wrapper for a C single byte null terminated string.
-
-
Field Summary
Fields Modifier and Type Field Description static NativeStringTypeMETAThe meta class instance-
Fields inherited from class de.intarsys.nativec.type.NativeObject
DEBUG, handle, SHIFT_INT, SHIFT_LONG, SHIFT_LONGLONG, SIZE_BYTE, SIZE_INT, SIZE_LONG, SIZE_LONGLONG, SIZE_PTR, SIZE_SHORT
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNativeString(NativeStringType pType)protectedNativeString(NativeStringType pType, INativeHandle handle)protectedNativeString(NativeStringType pType, java.lang.String value)NativeString(java.lang.String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NativeStringcreateFromAddress(long address)intgetByteCount()The number of bytes occupied by this.INativeTypegetNativeType()The meta information and behavior for the NativeObject.java.lang.ObjectgetValue()A Java side representation from the memory.voidsetValue(java.lang.Object value)Assign (and marshall to memory) the Java side representation.voidsetValue(java.lang.String value)java.lang.StringstringValue()The java object corresponding to this.-
Methods inherited from class de.intarsys.nativec.type.NativeObject
allocate, cast, createReference, getByte, getByteArray, getBytes, getCLong, getInt, getNativeHandle, getNativeHandle, getShort, getString, getWideString, isNull, setByte, setByteArray, setCLong, setInt, setNativeHandle, setShort, setString, setWideString, toNestedString
-
-
-
-
Field Detail
-
META
public static final NativeStringType META
The meta class instance
-
-
Constructor Detail
-
NativeString
protected NativeString(NativeStringType pType)
-
NativeString
protected NativeString(NativeStringType pType, INativeHandle handle)
-
NativeString
protected NativeString(NativeStringType pType, java.lang.String value)
-
NativeString
public NativeString(java.lang.String value)
-
-
Method Detail
-
createFromAddress
public static NativeString createFromAddress(long address)
-
getByteCount
public int getByteCount()
Description copied from class:NativeObjectThe number of bytes occupied by this.- Specified by:
getByteCountin classNativeObject- Returns:
- The number of bytes occupied by this.
-
getNativeType
public INativeType getNativeType()
Description copied from class:NativeObjectThe meta information and behavior for the NativeObject.There is exactly one meta instance for all NativeObject instances of a certain type.
- Specified by:
getNativeTypein interfaceINativeObject- Specified by:
getNativeTypein classNativeObject- Returns:
- The meta information and behavior for the NativeObject.
-
getValue
public java.lang.Object getValue()
Description copied from interface:INativeObjectA Java side representation from the memory.- Returns:
- A Java side representation for the
INativeObject.
-
setValue
public void setValue(java.lang.Object value)
Description copied from interface:INativeObjectAssign (and marshall to memory) the Java side representation.- Parameters:
value- The new Java value.
-
setValue
public void setValue(java.lang.String value)
-
stringValue
public java.lang.String stringValue()
The java object corresponding to this.- Returns:
- The java object corresponding to this.
-
-