class NativeString
extends java.lang.Object
implements java.lang.CharSequence, java.lang.Comparable
const char*
or const wchar_t*
) for use when
converting a Java String into a native memory function argument.Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
WIDE_STRING |
Constructor and Description |
---|
NativeString(java.lang.String string)
Create a native string (NUL-terminated array of
char ). |
NativeString(java.lang.String string,
boolean wide)
Create a native string as a NUL-terminated array of
wchar_t
(if wide is true) or char . |
NativeString(java.lang.String string,
java.lang.String encoding)
Create a native string (NUL-terminated array of
char ),
using the requested encoding. |
NativeString(WString string)
Create a native string as a NUL-terminated array of
wchar_t . |
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index) |
int |
compareTo(java.lang.Object other) |
boolean |
equals(java.lang.Object other) |
Pointer |
getPointer() |
int |
hashCode() |
int |
length() |
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toString() |
static final java.lang.String WIDE_STRING
public NativeString(java.lang.String string)
char
).
Uses the encoding returned by Native.getDefaultStringEncoding()
.
public NativeString(java.lang.String string, boolean wide)
wchar_t
(if wide
is true) or char
.
If not wide
, the encoding is obtained from Native.getDefaultStringEncoding()
.
string
- value to write to native memorywide
- whether to store the String as wchar_t
public NativeString(WString string)
wchar_t
.public NativeString(java.lang.String string, java.lang.String encoding)
char
),
using the requested encoding.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
public Pointer getPointer()
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public int length()
length
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable