-
String representation of the
CType
thingDeclaration
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 optionalDeclaration
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 initialisetype
C typedef name of the data type
ctype
underlying C type
comment
Documentation text for the data type
introspectable
Set to
true
if introspectabledeprecated
Documentation on deprecation status if non-
nil
isNullable
Set to
true
if this is a nullable typecontains
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 fromi
Index within the siblings of the
node
nameAttr
Key for the attribute to extract the
name
property fromtypeAttr
Key for the attribute to extract the
type
property fromcTypeAttr
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 fromi
Index within the siblings of the
node
nameAttr
Key for the attribute to extract the
name
property fromtypeAttr
Key for the attribute to extract the
type
property fromnullableAttr
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 }