public abstract class ZeroTerminatedString extends Parameter implements StringParameter, AlignmentAwareParameter
NOTE: All string lengths include the terminating zero character unless otherwise noted.
LICENSE_TYPE, V
Modifier | Constructor and Description |
---|---|
protected |
ZeroTerminatedString(byte[] bytes,
int lenBytes,
int charLength)
Constructs a string with specified value, maximum length and characted type
(1-byte or 2-byte).
|
Modifier and Type | Method and Description |
---|---|
protected Parameter |
asReturnValue()
Returns a parameter that represents this one as a return value.
|
protected abstract java.lang.String |
bytesToString(byte[] bytes) |
boolean |
equals(java.lang.Object obj)
Compares this
Parameter object to a given object. |
protected int |
getAlignedLength()
Returns a parameter length in bytes aligned to default alignment.
|
java.lang.String |
getDebugInfo()
Return debug info for JNIWrapper parameter.
|
int |
getFirstMemberSize()
Should return first member size.
|
int |
getLength()
Returns the length of this string object.
|
int |
getMaxLength()
Returns the maximum length of a string.
|
protected abstract int |
getStrLen(DataBuffer dataBuffer,
int startOffset) |
java.lang.String |
getValue() |
int |
hashCode() |
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Reads this parameter from a specified data source.
|
void |
setValue(java.lang.String value)
Sets the value for the parameter.
|
protected abstract byte[] |
stringToBytes(java.lang.String value) |
java.lang.String |
toString() |
void |
write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes this parameter to a specified data source.
|
acceptIOPerformer, clone, dataBufferAssigned, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, pop, push, read, read, setDataBuffer, toByteArray, write
protected ZeroTerminatedString(byte[] bytes, int lenBytes, int charLength)
bytes
- a string as byteslenBytes
- the maximum string length in bytescharLength
- the character lengtin in bytespublic int getMaxLength()
charLength
is 1. In these cases
ANSI string may not be able to hold getMaxLength()
characters. Creating a new
AnsiString
object with the string as a parameter or using WideString
eliminates this problem.public final void setValue(java.lang.String value)
StringParameter
setValue
in interface StringParameter
value
- the value to set.public final java.lang.String getValue()
getValue
in interface StringParameter
protected abstract int getStrLen(DataBuffer dataBuffer, int startOffset)
public int getLength()
getMaxLength()
method.protected int getAlignedLength()
Parameter
getAlignedLength
in class Parameter
protected Parameter asReturnValue()
Parameter
asReturnValue
in class Parameter
this
public void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameter
write
in class Parameter
MemoryAccessViolationException
public void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameter
read
in class Parameter
MemoryAccessViolationException
public java.lang.String getDebugInfo()
Parameter
getDebugInfo
in class Parameter
public boolean equals(java.lang.Object obj)
Parameter
Parameter
object to a given object. Two
Parameter
objects are considered equal if their byte
representations are equal and they are of the same type. Subclasses may
override this method as appropriate.protected abstract byte[] stringToBytes(java.lang.String value)
protected abstract java.lang.String bytesToString(byte[] bytes)
public java.lang.String toString()
toString
in class java.lang.Object
public int getFirstMemberSize()
AlignmentAwareParameter
getFirstMemberSize
in interface AlignmentAwareParameter