org.bridj
Enum Pointer.StringType

java.lang.Object
  extended by java.lang.Enum<Pointer.StringType>
      extended by org.bridj.Pointer.StringType
All Implemented Interfaces:
Serializable, Comparable<Pointer.StringType>
Enclosing class:
Pointer<T>

public static enum Pointer.StringType
extends Enum<Pointer.StringType>

Type of a native character string.
In the native world, there are several ways to represent a string.
See Pointer.getStringAtOffset(long, StringType, Charset) and Pointer.setStringAtOffset(long, String, StringType, Charset)


Enum Constant Summary
BSTR
          Microsoft's BSTR strings, used in COM, OLE, MS.NET Interop and MS.NET Automation functions.
C
          C strings (a.k.a "NULL-terminated strings") have no size limit and are the most used strings in the C world.
PascalAnsi
          Pascal ANSI strings are ref-counted single-byte strings that look like C strings but are prepended with a ref count and length (both 32 bits ints).
PascalShort
          Pascal strings can be up to 255 characters long.
PascalWide
          Wide Pascal strings are ref-counted unicode strings that look like WideC strings but are prepended with a ref count and length (both 32 bits ints).
STL
          STL strings have compiler- and STL library-specific implementations and memory layouts.
WideC
          Wide C strings are stored as C strings (see C) except they are composed of shorts instead of bytes (and are ended by one zero short value = two zero byte values).
WideSTL
          STL wide strings have compiler- and STL library-specific implementations and memory layouts.
 
Method Summary
static Pointer.StringType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Pointer.StringType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

C

public static final Pointer.StringType C
C strings (a.k.a "NULL-terminated strings") have no size limit and are the most used strings in the C world. They are stored with the bytes of the string (using either a single-byte encoding such as ASCII, ISO-8859 or windows-1252 or a C-string compatible multi-byte encoding, such as UTF-8), followed with a zero byte that indicates the end of the string.
Corresponding C types : char* , const char* , LPCSTR
Corresponding Pascal type : PChar
See Pointer.pointerToCString(String), Pointer.getCString() and Pointer.setCString(String)


WideC

public static final Pointer.StringType WideC
Wide C strings are stored as C strings (see C) except they are composed of shorts instead of bytes (and are ended by one zero short value = two zero byte values). This allows the use of two-bytes encodings, which is why this kind of strings is often found in modern Unicode-aware system APIs.
Corresponding C types : wchar_t* , const wchar_t* , LPCWSTR
See Pointer.pointerToWideCString(String), Pointer.getWideCString() and Pointer.setWideCString(String)


PascalShort

public static final Pointer.StringType PascalShort
Pascal strings can be up to 255 characters long.
They are stored with a first byte that indicates the length of the string, followed by the ascii or extended ascii chars of the string (no support for multibyte encoding).
They are often used in very old Mac OS programs and / or Pascal programs.
Usual corresponding C types : unsigned char* and const unsigned char*
Corresponding Pascal type : ShortString (see @see http://www.codexterity.com/delphistrings.htm)
See Pointer.pointerToString(String, StringType, Charset), Pointer.getString(StringType), Pointer.setString(String, StringType),


PascalWide

public static final Pointer.StringType PascalWide
Wide Pascal strings are ref-counted unicode strings that look like WideC strings but are prepended with a ref count and length (both 32 bits ints).
They are the current default in Delphi (2010).
Corresponding Pascal type : WideString (see @see http://www.codexterity.com/delphistrings.htm)
See Pointer.pointerToString(String, StringType, Charset), Pointer.getString(StringType), Pointer.setString(String, StringType),


PascalAnsi

public static final Pointer.StringType PascalAnsi
Pascal ANSI strings are ref-counted single-byte strings that look like C strings but are prepended with a ref count and length (both 32 bits ints).
Corresponding Pascal type : AnsiString (see @see http://www.codexterity.com/delphistrings.htm)
See Pointer.pointerToString(String, StringType, Charset), Pointer.getString(StringType), Pointer.setString(String, StringType),


BSTR

public static final Pointer.StringType BSTR
Microsoft's BSTR strings, used in COM, OLE, MS.NET Interop and MS.NET Automation functions.
See @see http://msdn.microsoft.com/en-us/library/ms221069.aspx for more details.
See Pointer.pointerToString(String, StringType, Charset), Pointer.getString(StringType), Pointer.setString(String, StringType),


STL

public static final Pointer.StringType STL
STL strings have compiler- and STL library-specific implementations and memory layouts.
BridJ support reading and writing to / from pointers to most implementation's STL strings, though. See Pointer.pointerToString(String, StringType, Charset), Pointer.getString(StringType), Pointer.setString(String, StringType),


WideSTL

public static final Pointer.StringType WideSTL
STL wide strings have compiler- and STL library-specific implementations and memory layouts.
BridJ supports reading and writing to / from pointers to most implementation's STL strings, though. See Pointer.pointerToString(String, StringType, Charset), Pointer.getString(StringType), Pointer.setString(String, StringType),

Method Detail

values

public static Pointer.StringType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Pointer.StringType c : Pointer.StringType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Pointer.StringType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2009-2012. All Rights Reserved.