Class COM.odi.jcpp.charP
java.lang.Object
|
+----COM.odi.jcpp.PeerPointer
|
+----COM.odi.jcpp.charP
- public class charP
- extends PeerPointer
This pointer class represents char* pointers. Unlike the other
pointer classes, which only hold the pointer state, this class provides methods
that facilitate conversions between Java strings and C++ strings.
-
charP(byte[])
- The constructor that wraps a char type around a raw address.
-
charP(byte[], CharConverter)
- The constructor that wraps a char type around a raw address.
-
charP(String, Segment)
- Copies the Java string str into a newly allocated
C++ char array.
-
charP(String, Segment, CharConverter)
- Encodes the Java string str into a newly allocated
C++ char array using the CharConverter provided.
-
getCharConverter()
- Get the CharConverter instance for this object.
-
getDefaultConverter()
- Return the default CharConverter for charP <-> String conversions.
-
getEUCJISConverter()
- Return the CharConverter for EUCJIS <-> Unicode conversions.
-
getSJISConverter()
- Return the CharConverter for SJIS <-> Unicode conversions.
-
getStringContents()
- For a char* string in SJIS, EUCJIS, ASCII or any null terminated
format, copies all chars up to the first null character into a new
Java byte array.
-
getStringContents(byte[])
- For a char* string in SJIS, EUCJIS, ASCII or any null terminated
format, copies all chars up to the first null character into a new
Java byte array.
-
getUTF8Converter()
- Return the CharConverter for UTF8 <-> Unicode conversions.
-
setCharConverter(CharConverter)
- Set the CharConverter instance for this object.
-
setDefaultConverter(CharConverter)
- Sets the default CharConverter for charP <-> String conversions.
-
toEUCJISString()
- For a char* string in EUCJIS format, copies all characters up
to the first null character into a new
Java String.
-
toEUCJISString(byte[])
- For a char* string in EUCJIS format, copies all characters up
to the first null character into a new
Java String.
-
toEUCString()
- For a char* string in EUCJIS format, copies all characters up
to the first null character into a new
Java String.
Deprecated.
-
toSJISString()
- For a char* string in SJIS format, copies all characters
up to the first null character into a new Java String.
-
toSJISString(byte[])
- For a char* string in SJIS format, copies all characters
up to the first null character into a new Java String.
-
toString()
- Copies all characters up to the first null character into a new
Java String.
-
toString(byte[])
- Copies all characters in the input string up to the first null
character into a new Java String.
charP
public charP(String str,
Segment s)
- Copies the Java string str into a newly allocated
C++ char array.
Only the low byte of unicode characters is used. This works only for
the ISO Latin-1 (ASCII) characters.
charP
public charP(String str,
Segment s,
CharConverter converter)
- Encodes the Java string str into a newly allocated
C++ char array using the CharConverter provided.
charP
public charP(byte linearObjectReference[])
- The constructor that wraps a char type around a raw address.
- Parameters:
- linearObjectReference - Linear object reference for the pointer.
charP
public charP(byte linearObjectReference[],
CharConverter converter)
- The constructor that wraps a char type around a raw address.
- Parameters:
- linearObjectReference - Linear object reference for the pointer.
- converter - The character converter for this instance.
toString
public String toString()
- Copies all characters up to the first null character into a new
Java String.
- Overrides:
- toString in class Object
toString
public static String toString(byte linearObjectReference[])
- Copies all characters in the input string up to the first null
character into a new Java String. The char string is
assumed to be composed of Ascii characters.
- Parameters:
- linearObjectReference - The linear object reference of a
C++ char array. This argument must be non-null.
toEUCString
public String toEUCString()
- Note: toEUCString() is deprecated.
Use toEUCJISString
- For a char* string in EUCJIS format, copies all characters up
to the first null character into a new
Java String.
toEUCJISString
public String toEUCJISString()
- For a char* string in EUCJIS format, copies all characters up
to the first null character into a new
Java String.
toEUCJISString
public static String toEUCJISString(byte linearObjectReference[])
- For a char* string in EUCJIS format, copies all characters up
to the first null character into a new
Java String.
- Parameters:
- linearObjectReference - The linear object reference of a
C++ char array. This argument must be non-null.
toSJISString
public String toSJISString()
- For a char* string in SJIS format, copies all characters
up to the first null character into a new Java String.
toSJISString
public static String toSJISString(byte linearObjectReference[])
- For a char* string in SJIS format, copies all characters
up to the first null character into a new Java String.
- Parameters:
- linearObjectReference - The linear object reference of a
C++ char array. This argument must be non-null.
getCharConverter
public CharConverter getCharConverter()
- Get the CharConverter instance for this object.
- Returns:
- The CharConverter, which may be null.
setCharConverter
public void setCharConverter(CharConverter converter)
- Set the CharConverter instance for this object.
- Parameters:
- converter - The CharConverter, which may be null,
in which case 8 bit ASCII is assumed.
getStringContents
public byte[] getStringContents()
- For a char* string in SJIS, EUCJIS, ASCII or any null terminated
format, copies all chars up to the first null character into a new
Java byte array.
getStringContents
public static byte[] getStringContents(byte linearObjectReference[])
- For a char* string in SJIS, EUCJIS, ASCII or any null terminated
format, copies all chars up to the first null character into a new
Java byte array.
- Parameters:
- linearObjectReference - The linear object reference of a
C++ char array. This argument must be non-null.
getEUCJISConverter
public static CharConverter getEUCJISConverter()
- Return the CharConverter for EUCJIS <-> Unicode conversions.
getSJISConverter
public static CharConverter getSJISConverter()
- Return the CharConverter for SJIS <-> Unicode conversions.
getUTF8Converter
public static CharConverter getUTF8Converter()
- Return the CharConverter for UTF8 <-> Unicode conversions.
getDefaultConverter
public static CharConverter getDefaultConverter()
- Return the default CharConverter for charP <-> String conversions.
If null, 8 bit ASCII is assumed.
setDefaultConverter
public static void setDefaultConverter(CharConverter cvt)
- Sets the default CharConverter for charP <-> String conversions.
If null, 8 bit ASCII is assumed.
Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.