All Packages Class Hierarchy This Package Previous Next Index
Class org.ifarchive.glk.Prototype
java.lang.Object
|
+----org.ifarchive.glk.Prototype
- public class Prototype
- extends Object
Code to deal with parsing a Glk prototype string.
The Prototype class represents one entry; you can use
Prototype.parseString() to parse a string to an array of Prototypes.
- See Also:
- parseString
-
major
- The prototype's major type.
-
minor
- The prototype's minor type.
-
MOD_ARRAY
- This is an array parameter.
-
MOD_NOTNULL
- This is a reference parameter which can't be null.
-
MOD_REF_IN
- This is a reference parameter being passed in.
-
MOD_REF_OUT
- This is a reference parameter being passed out.
-
MOD_RETAINED
- This array may be retained by Glk.
-
MOD_STRUCT
- This is a structure parameter.
-
modifiers
- One or more of the modifiers MOD_* corresponding to modifier
characters in the prototype string.
-
structure
- Prototypes for each field in the structure.
-
isArray()
- Is this prototype for an array?
-
isNotNull()
- Is this reference non-null?
-
isRef()
- Is this a reference argument?
-
parseString(String)
- Parse a Glk argument string.
-
toString()
- Convert to a printable string.
major
public char major
- The prototype's major type. One of:
- I : Integer
- C : Character
- S : C-style string
- F : Float (not currently supported)
- Q : Opaque object
- [ : Structure
minor
public char minor
- The prototype's minor type.
- For an integer: u for unsigned, s for signed.
- For a character: u for unsigned, s for signed, n for native.
- For an opaque object: Glk class + 'a'.
- For others: zero
modifiers
public int modifiers
- One or more of the modifiers MOD_* corresponding to modifier
characters in the prototype string.
MOD_REF_IN
public static final int MOD_REF_IN
- This is a reference parameter being passed in.
MOD_REF_OUT
public static final int MOD_REF_OUT
- This is a reference parameter being passed out.
MOD_NOTNULL
public static final int MOD_NOTNULL
- This is a reference parameter which can't be null.
MOD_STRUCT
public static final int MOD_STRUCT
- This is a structure parameter.
MOD_ARRAY
public static final int MOD_ARRAY
- This is an array parameter.
MOD_RETAINED
public static final int MOD_RETAINED
- This array may be retained by Glk. The Java binding ignores this
and assumes all arrays may be retained.
structure
public Prototype structure[]
- Prototypes for each field in the structure.
Null if this prototype is not for a structure.
isRef
public boolean isRef()
- Is this a reference argument?
- Returns:
- true if this is a pass-in or pass-out reference.
isNotNull
public boolean isNotNull()
- Is this reference non-null?
- Returns:
- true if this reference can't be null.
isArray
public boolean isArray()
- Is this prototype for an array?
- Returns:
- true if this prototype is for an array parameter.
toString
public String toString()
- Convert to a printable string.
- Returns:
- a printed representation of this object.
- Overrides:
- toString in class Object
parseString
public static Prototype[] parseString(String proto)
- Parse a Glk argument string.
Converts the encoded string into an array of Prototype objects.
- Parameters:
- proto - The string to parse, which must be a complete Glk
argument string or structure definition string.
- Returns:
- an array of Prototype objects, one for each argument.
All Packages Class Hierarchy This Package Previous Next Index