Package org.libvirt.jna
Class CString
java.lang.Object
com.sun.jna.PointerType
org.libvirt.jna.CString
- All Implemented Interfaces:
com.sun.jna.NativeMapped
public class CString
extends com.sun.jna.PointerType
Represents an allocated C-String.
Either call toString()
or free()
. Both methods make
sure to reclaim the memory allocated for the string by calling
Native.free.
-
Constructor Summary
-
Method Summary
Methods inherited from class com.sun.jna.PointerType
equals, getPointer, hashCode, nativeType, setPointer, toNative
-
Constructor Details
-
CString
public CString() -
CString
public CString(com.sun.jna.Pointer p)
-
-
Method Details
-
toString
Returns a String representing the value of this C-StringSide-effect: frees the memory of the C-String.
- Overrides:
toString
in classcom.sun.jna.PointerType
- Returns:
- String represented by C-String or "(null)"
-
fromNative
- Specified by:
fromNative
in interfacecom.sun.jna.NativeMapped
- Overrides:
fromNative
in classcom.sun.jna.PointerType
-
free
public void free()Free the memory used by this C-String
-