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()
orfree()
. Both methods make sure to reclaim the memory allocated for the string by calling Native.free.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
free()
Free the memory used by this C-StringCString
fromNative(java.lang.Object nativeValue, com.sun.jna.FromNativeContext context)
java.lang.String
toString()
Returns a String representing the value of this C-String
-
-
-
Method Detail
-
toString
public java.lang.String 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
public CString fromNative(java.lang.Object nativeValue, com.sun.jna.FromNativeContext context)
- 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
-
-