Documentation Language: Swift

Method

knownCast(expression:to:pointerLevel:const:)

Return an explicitly known cast to convert the given expression to the target type

func knownCast(expression: String, to target: GIRType, pointerLevel: Int = 0, const: Bool = false) -> String?

Parameters

expression

The expression to cast

target

The target type to cast to

pointerLevel

The number of indirection levels (pointers)

const

An indicator whether the cast is to a const value

Return Value

The cast expression string, or nil if there is no way to cast to target