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.


Constructor Index

 o charP(byte[])
The constructor that wraps a char type around a raw address.
 o charP(byte[], CharConverter)
The constructor that wraps a char type around a raw address.
 o charP(String, Segment)
Copies the Java string str into a newly allocated C++ char array.
 o charP(String, Segment, CharConverter)
Encodes the Java string str into a newly allocated C++ char array using the CharConverter provided.

Method Index

 o getCharConverter()
Get the CharConverter instance for this object.
 o getDefaultConverter()
Return the default CharConverter for charP <-> String conversions.
 o getEUCJISConverter()
Return the CharConverter for EUCJIS <-> Unicode conversions.
 o getSJISConverter()
Return the CharConverter for SJIS <-> Unicode conversions.
 o 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.
 o 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.
 o getUTF8Converter()
Return the CharConverter for UTF8 <-> Unicode conversions.
 o setCharConverter(CharConverter)
Set the CharConverter instance for this object.
 o setDefaultConverter(CharConverter)
Sets the default CharConverter for charP <-> String conversions.
 o toEUCJISString()
For a char* string in EUCJIS format, copies all characters up to the first null character into a new Java String.
 o toEUCJISString(byte[])
For a char* string in EUCJIS format, copies all characters up to the first null character into a new Java String.
 o toEUCString()
For a char* string in EUCJIS format, copies all characters up to the first null character into a new Java String. Deprecated.
 o toSJISString()
For a char* string in SJIS format, copies all characters up to the first null character into a new Java String.
 o toSJISString(byte[])
For a char* string in SJIS format, copies all characters up to the first null character into a new Java String.
 o toString()
Copies all characters up to the first null character into a new Java String.
 o toString(byte[])
Copies all characters in the input string up to the first null character into a new Java String.

Constructors

 o 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.

 o 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.

 o charP
  public charP(byte linearObjectReference[])
The constructor that wraps a char type around a raw address.

Parameters:
linearObjectReference - Linear object reference for the pointer.
 o 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.

Methods

 o toString
  public String toString()
Copies all characters up to the first null character into a new Java String.

Overrides:
toString in class Object
 o 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.
 o 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.

 o 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.

 o 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.
 o 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.

 o 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.
 o getCharConverter
  public CharConverter getCharConverter()
Get the CharConverter instance for this object.

Returns:
The CharConverter, which may be null.
 o 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.
 o 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.

 o 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.
 o getEUCJISConverter
  public static CharConverter getEUCJISConverter()
Return the CharConverter for EUCJIS <-> Unicode conversions.

 o getSJISConverter
  public static CharConverter getSJISConverter()
Return the CharConverter for SJIS <-> Unicode conversions.

 o getUTF8Converter
  public static CharConverter getUTF8Converter()
Return the CharConverter for UTF8 <-> Unicode conversions.

 o getDefaultConverter
  public static CharConverter getDefaultConverter()
Return the default CharConverter for charP <-> String conversions. If null, 8 bit ASCII is assumed.

 o 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.