public class Str extends Parameter implements StringParameter, AlignmentAwareParameter
WideString, otherwise as AnsiString.LICENSE_TYPE, V| Constructor and Description |
|---|
Str()
Constructs a string with the maximum length of 256 characters.
|
Str(int maxLen)
Constructs a string with a specified maximum length.
|
Str(int maxLen,
boolean unicode)
Constructs a string with a specified maximum length and character type.
|
Str(Str s)
Constructs a copy of the passed instance.
|
Str(java.lang.String s)
Constructs a string with a specified value.
|
Str(java.lang.String s,
boolean unicode)
Constructs a string with a specified value and character type.
|
Str(java.lang.String s,
int maxLen)
Constructs a string with a specified value and maximum length.
|
Str(java.lang.String s,
int maxLen,
boolean unicode)
Constructs a string with a specified value, maximum length and character
type.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
acceptIOPerformer(IOPerformer performer,
DataBuffer buffer,
int initialOffset,
boolean isReadOperation,
boolean invokedByCallback)
Implementation of a Visitor pattern for parameter IO.
|
protected Parameter |
asReturnValue()
Returns a parameter that represents this one as a return value.
|
java.lang.Object |
clone() |
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.
|
int |
getAlignmentRequirement() |
protected DataBuffer |
getDataBuffer()
Returns a current data storage.
|
protected int |
getDataBufferOffset()
Returns a current offset within data storage.
|
java.lang.String |
getDebugInfo()
Return debug info for JNIWrapper parameter.
|
int |
getFirstMemberSize()
Should return first member size.
|
int |
getLength()
Returns the length of the parameter in memory.
|
int |
getMaxLength() |
java.lang.String |
getValue() |
int |
hashCode() |
boolean |
isUnicode() |
void |
pop(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Default implementation that does nothing because most primitive types do
nothing on pop.
|
void |
push(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes a parameter to a function stacks.
|
void |
read(byte[] arr,
int offset)
Reads the parameter value from a byte array.
|
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Reads this parameter from a specified data source.
|
protected void |
setDataBuffer(DataBuffer newBuffer,
int newOffset,
boolean shouldRead)
Sets the data buffer this parameter should use to store data and an
offset in bytes within that buffer.
|
void |
setValue(java.lang.String value)
Sets the value for the parameter.
|
java.lang.String |
toString() |
void |
write(byte[] arr,
int offset)
Writes the parameter value to a byte array.
|
void |
write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes this parameter to a specified data source.
|
dataBufferAssigned, indent, read, toByteArraypublic Str()
public Str(java.lang.String s)
public Str(java.lang.String s,
boolean unicode)
public Str(int maxLen)
public Str(int maxLen,
boolean unicode)
public Str(java.lang.String s,
int maxLen)
public Str(java.lang.String s,
int maxLen,
boolean unicode)
public Str(Str s)
s - a string value to copy from.public boolean isUnicode()
true if the contained string data is in Unicode;
otherwise false.public int getLength()
Parametersizeof() operator.protected int getAlignedLength()
ParametergetAlignedLength in class Parameterprotected Parameter asReturnValue()
ParameterasReturnValue in class Parameterthisprotected int getDataBufferOffset()
ParametergetDataBufferOffset in class Parameterprotected DataBuffer getDataBuffer()
ParametergetDataBuffer in class Parameterprotected void setDataBuffer(DataBuffer newBuffer, int newOffset, boolean shouldRead)
ParametersetDataBuffer in class Parameterpublic void write(byte[] arr,
int offset)
Parameterpublic void read(byte[] arr,
int offset)
Parameterprotected void acceptIOPerformer(IOPerformer performer, DataBuffer buffer, int initialOffset, boolean isReadOperation, boolean invokedByCallback)
Parameterperformer is responsible for reading and writing the
parameter. Users implementing a complex parameter from scratch (i.e. not
by extending a pre-existing class such as Structure or
Pointer) may wish to override this method to make a
performer visit object internal parts.acceptIOPerformer in class Parameterperformer - a visitor responsible for I/Oing the parameter.buffer - data buffer for I/O operation.initialOffset - I/O operation offset of this parameter in the
buffer.public int getAlignmentRequirement()
getAlignmentRequirement in class Parameterpublic void push(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameterpush in class ParameterMemoryAccessViolationExceptionpublic void pop(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameterpop in class ParameterMemoryAccessViolationExceptionpublic void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameterwrite in class ParameterMemoryAccessViolationExceptionpublic void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameterread in class ParameterMemoryAccessViolationExceptionpublic boolean equals(java.lang.Object obj)
ParameterParameter 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.public int getMaxLength()
public void setValue(java.lang.String value)
StringParametersetValue in interface StringParametervalue - the value to set.public java.lang.String getValue()
getValue in interface StringParameterpublic java.lang.String getDebugInfo()
ParametergetDebugInfo in class Parameterpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getFirstMemberSize()
AlignmentAwareParametergetFirstMemberSize in interface AlignmentAwareParameter