Constant

public class Constant : CType

an entry for a constant

  • String representation of Constants

    Declaration

    Swift

    public override var kind: String { get }
  • raw value

    Declaration

    Swift

    public let value: Int
  • Designated initialiser

    Declaration

    Swift

    public init(name: String, type: String, ctype: String, value: Int, comment: String, introspectable: Bool = false, deprecated: String? = nil)

    Parameters

    name

    The name of the Constant to initialise

    type

    C typedef name of the constant

    ctype

    underlying C type

    value

    the value of the constant

    comment

    Documentation text for the constant

    introspectable

    Set to true if introspectable

    deprecated

    Documentation on deprecation status if non-nil

  • Initialiser to construct a constant from XML

    Declaration

    Swift

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

    Parameters

    node

    XMLElement to construct this constant 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