com.jniwrapper
Class ExternalStringPointer

java.lang.Object
  extended by com.jniwrapper.Parameter
      extended by com.jniwrapper.Pointer.Void
          extended by com.jniwrapper.ExternalStringPointer
All Implemented Interfaces:
IntegerParameter, PointerParameter

public class ExternalStringPointer
extends Pointer.Void

This class is designed for reading externally allocated strings.


Field Summary
 
Fields inherited from class com.jniwrapper.Parameter
LICENSE_TYPE, V
 
Constructor Summary
ExternalStringPointer()
          Creates a null string pointer and sets its character encoding to CharacterEncoding.Unicode.
ExternalStringPointer(boolean unicode)
          Deprecated. use ExternalStringPointer(CharacterEncoding) constructor instead.
ExternalStringPointer(CharacterEncoding encoding)
          Constructs a null string pointer with specified encoding.
ExternalStringPointer(long handle)
          Creates a string pointer by the specified address.
ExternalStringPointer(long handle, boolean unicode)
          Deprecated. use ExternalStringPointer(long, CharacterEncoding) constructor instead
ExternalStringPointer(long handle, CharacterEncoding encoding)
          Creates a string pointer by the specified address and character encoding.
ExternalStringPointer(Pointer.Void value)
          Creates a string pointer by the specified address with ANSI character encoding.
ExternalStringPointer(Pointer.Void handle, CharacterEncoding encoding)
          Creates a string pointer by the specified address and character encoding.
 
Method Summary
 CharacterEncoding getEncoding()
          Returns the specified encoding of this string pointer.
 boolean isUnicodeString()
          Deprecated. use getEncoding() method instead
 java.lang.String readString()
          Reads a string from this pointer depending on the specified character encoding.
 void setEncoding(CharacterEncoding encoding)
          Specifies encoding of this string pointer.
 
Methods inherited from class com.jniwrapper.Pointer.Void
asFunction, asFunction, asTypedPointer, castTo, castTo, clone, equals, getDebugInfo, getLength, getValue, hashCode, isNull, read, setValue, toString, write
 
Methods inherited from class com.jniwrapper.Parameter
acceptIOPerformer, asReturnValue, dataBufferAssigned, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, pop, push, read, read, setDataBuffer, toByteArray, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExternalStringPointer

public ExternalStringPointer()
Creates a null string pointer and sets its character encoding to CharacterEncoding.Unicode.


ExternalStringPointer

public ExternalStringPointer(boolean unicode)
Deprecated. use ExternalStringPointer(CharacterEncoding) constructor instead.

Creates a null string pointer with specified encoding.

Parameters:
unicode - true specifies that the pointer refers to a unicode string; false to an ANSI string

ExternalStringPointer

public ExternalStringPointer(CharacterEncoding encoding)
Constructs a null string pointer with specified encoding.

Parameters:
encoding - specifies the character encoding of a string

ExternalStringPointer

public ExternalStringPointer(long handle)
Creates a string pointer by the specified address.

Parameters:
handle - specifies the address of a string

ExternalStringPointer

public ExternalStringPointer(long handle,
                             boolean unicode)
Deprecated. use ExternalStringPointer(long, CharacterEncoding) constructor instead

Creates a string pointer by the specified address.

Parameters:
handle - specifies the address of a string
unicode - true if the pointer refers to a unicode string; false to an ANSI one

ExternalStringPointer

public ExternalStringPointer(long handle,
                             CharacterEncoding encoding)
Creates a string pointer by the specified address and character encoding.

Parameters:
handle - specifies the string address
encoding - specifies character encoding of a string

ExternalStringPointer

public ExternalStringPointer(Pointer.Void handle,
                             CharacterEncoding encoding)
Creates a string pointer by the specified address and character encoding.

Parameters:
handle - specifies the string address
encoding - specifies character encoding of a string

ExternalStringPointer

public ExternalStringPointer(Pointer.Void value)
Creates a string pointer by the specified address with ANSI character encoding.

Parameters:
value - specifies the string address
Method Detail

readString

public java.lang.String readString()
Reads a string from this pointer depending on the specified character encoding.

Returns:
string from the pointer

isUnicodeString

public boolean isUnicodeString()
Deprecated. use getEncoding() method instead

Checks if an external string is the unicode string.

Returns:
true if an external string is a unicode string; false is an ANSI one.

setEncoding

public final void setEncoding(CharacterEncoding encoding)
Specifies encoding of this string pointer.

Parameters:
encoding - character encoding

getEncoding

public final CharacterEncoding getEncoding()
Returns the specified encoding of this string pointer.

Returns:
specified character encoding