Method

public class Method : Argument

data type representing a function/method

  • String representation of member Methods

    Declaration

    Swift

    public override var kind: String { get }
  • Original C function name

    Declaration

    Swift

    public let cname: String
  • Return type

    Declaration

    Swift

    public let returns: Argument
  • All associated arguments (parameters) in order

    Declaration

    Swift

    public let args: [Argument]
  • true if this method throws an error

    Declaration

    Swift

    public let throwsError: Bool
  • Designated initialiser

    Declaration

    Swift

    public init(name: String, cname: String, returns: Argument, args: [Argument] = [], comment: String = "", introspectable: Bool = false, deprecated: String? = nil, throwsAnError: Bool = false)

    Parameters

    name

    The name of the method

    cname

    C function name

    args

    Array of parameters

    comment

    Documentation text for the method

    introspectable

    Set to true if introspectable

    deprecated

    Documentation on deprecation status if non-nil

    throwsAnError

    Set to true if this method can throw an error

    Return Value

    return type

  • Initialiser to construct a method type from XML

    Declaration

    Swift

    public override init(node: XMLElement, atIndex i: Int)

    Parameters

    node

    XMLElement to construct this constant from

    i

    Index within the siblings of the node

  • indicate whether this is an unref method

    Declaration

    Swift

    public var isUnref: Bool { get }
  • indicate whether this is a ref method

    Declaration

    Swift

    public var isRef: Bool { get }
  • indicate whether this is a getter method

    Declaration

    Swift

    public var isGetter: Bool { get }
  • indicate whether this is a setter method

    Declaration

    Swift

    public var isSetter: Bool { get }
  • indicate whether this is a setter method for the given getter

    Declaration

    Swift

    public func isSetterFor(getter: String) -> Bool
  • indicate whether this is a getter method for the given setter

    Declaration

    Swift

    public func isGetterFor(setter: String) -> Bool