CType

public class CType : Datatype

a type with an underlying C type entry

  • String representation of the CType thing

    Declaration

    Swift

    public override var kind: String { get }
  • underlying C type

    Declaration

    Swift

    public let ctype: String
  • list of contained types

    Declaration

    Swift

    public let containedTypes: [CType]
  • true if this is an optional

    Declaration

    Swift

    public let nullable: Bool
  • reference scope

    Declaration

    Swift

    public let scope: String?
  • Designated initialiser

    Declaration

    Swift

    public init(name: String, type: String, ctype: String, comment: String, introspectable: Bool = false, deprecated: String? = nil, isNullable: Bool = false, contains: [CType] = [], scope: String? = nil)

    Parameters

    name

    The name of the Datatype to initialise

    type

    C typedef name of the data type

    ctype

    underlying C type

    comment

    Documentation text for the data type

    introspectable

    Set to true if introspectable

    deprecated

    Documentation on deprecation status if non-nil

    isNullable

    Set to true if this is a nullable type

    contains

    Array of C types contained within this type

    scope

    The scope this type belongs in

  • XML Element initialser

    Declaration

    Swift

    public init(node: XMLElement, atIndex i: Int, nameAttr: String = "name", typeAttr: String = "type", cTypeAttr: String? = nil, nullableAttr: String = "nullable", scopeAttr: String = "scope")

    Parameters

    node

    XMLElement to construct this C type from

    i

    Index within the siblings of the node

    nameAttr

    Key for the attribute to extract the name property from

    typeAttr

    Key for the attribute to extract the type property from

    cTypeAttr

    Key for the attribute to extract the C type property from

    nullableAttr

    Key for the attribute to extract the nullability status from

    scopeAttr

    Key for the attribute to extract the scope string from

  • Factory method to construct a C Type from XML with types taken from children

    Declaration

    Swift

    public init(fromChildrenOf node: XMLElement, atIndex i: Int, nameAttr: String = "name", typeAttr: String = "type", nullableAttr: String = "nullable", scopeAttr: String = "scope")

    Parameters

    node

    XMLElement whose descendants to construct this C type from

    i

    Index within the siblings of the node

    nameAttr

    Key for the attribute to extract the name property from

    typeAttr

    Key for the attribute to extract the type property from

    nullableAttr

    Key for the attribute to extract the nullability status from

    scopeAttr

    Key for the attribute to extract the scope string from

  • return whether the give C type is void

    Declaration

    Swift

    override public var isVoid: Bool { get }
  • return whether the type is an array

    Declaration

    Swift

    public var isArray: Bool { get }