Documentation Language: Swift

Class

GIR.CType

a type with an underlying C type entry

class CType

Topics

Initializers

Instance Properties

V
argumentName

return the non-prefixed argument name

V
camelQuoted

return the Swift camel case name, quoted if necessary

V
cname

Original C identifier

V
containedTypes

list of contained types

V
containsGPointer

return whether the type contains a magical gpointer or related

V
idiomaticClassRef

Explicit, idiomatic type reference (class if pointer to record)

V
idiomaticClassTypeName

explicit, idiomatic class type name (empty if same as the underlying C type)

V
idiomaticWrappedRef

explicit, idiomatic type reference (struct if pointer to record)

V
idiomaticWrappedTypeName

explicit, idiomatic type name (empty if same as the underlying C type)

V
isAnyKindOfPointer

indicates whether the receiver is any known kind of pointer

V
isArray

return whether the type is an array

V
isGPointer

return whether the type is a magical gpointer or related

V
isKnownBitfield

indicates whether the receiver is a known bit field

V
isKnownRecord

indicates whether the receiver is a known class or record

V
isKnownRecordReference

return whether the receiver is a direct reference to a known record

V
isKnownType

Indicates whether the receiver is a known type.

V
isPrivate

true if this is a private element

V
isReadable

true if this is a readable element

V
isScalarArray

indicates whether the receiver is an array of scalar values

V
isVoid

Returns true if the data type is void

V
isWritable

true if this is a writable element

V
kind

String representation of the CType thing

V
knownBitfield

Return the known bitfield the argument represents (nil if not known).

V
knownNameRecord

Return the known record for the receiver (nil if not known).

V
knownRecord

Return the known class/record of the argument (nil if not known).

V
knownRecordReference

return a directly referenced known record, nil otherwise

V
knownType

Return the known type of the argument (nil if not known).

V
nonClashingName

return a non-clashing argument name

V
prefixedArgumentName

return the, potentially prefixed argument name to use in a method declaration

V
prefixedIdiomaticClassRef

Return a prefixed version of the idiomatic class type reference

V
prefixedIdiomaticClassTypeName

explicit, idiomatic class type name (empty if same as the underlying C type)

V
prefixedIdiomaticWrappedRef

Return a prefixed version of the wrapped type reference

V
prefixedIdiomaticWrappedTypeName

explicit, idiomatic type name (empty if same as the underlying C type)

V
returnTypeName

return the swift (known) type of the receiver when used as a return value

V
scope

reference scope

V
swiftParamRef

Type reference to an idiomatic Swift type used for a Swift function parameter

V
swiftReturnRef

Type reference to an idiomatic Swift type used for a Swift function return value

V
swiftSignalRef

Type reference to an idiomatic Swift type used for a Swift signals. This property is copy of swiftReturnRef with a different domain. The domain for this property was modified to include support for unsigned ints.

V
swiftType

return the swift (known) type of the receiver as parsed from the GIR file

V
templateDecl

Return a Swift template declaration for a known record, or nil otherwise

V
tupleSize

tuple size if non-nil

Instance Methods

F
isInstanceOf(_:)

return whether the receiver is an instance of the given record (class)

F
isInstanceOfHierarchy(_:)

return whether the receiver is an instance of the given record (class) or any of its ancestors

F
maybeOptional(for:)

Check whether the return type may need to be optional, e.g. when derived from a pointer that may be nil

F
prefixed(ref:)

Return a prefixed ref for a given TypeReference.

F
returnTypeName(for:beingIdiomatic:useStruct:)

return the idiomatic/non-idiomatic return type name

Relationships

Inherits From

Inherited By

Conforms To

See Also

GIR element models

C
GIR.Thing

GIR named thing class

C
GIR.Datatype

GIR type class

C
GIR.Alias

a type alias is just a type with an underlying C type

C
GIR.Argument

data type representing a function/method argument or return type

C
GIR.Bitfield

a bitfield is defined akin to an enumeration

C
GIR.Callback

a callback is the same as a function, except that the type definition is a @convention(c) callback definition

C
GIR.Class

a class data type record

C
GIR.Constant

an entry for a constant

C
GIR.Enumeration

an enumeration entry

C
GIR.Field

a field is a Property

C
GIR.Function

a function is the same as a method

C
GIR.Interface

an inteface is similar to a class, but can be part of a more complex type graph

C
GIR.Method

data type representing a function/method

C
GIR.Property

a property is a C type

C
GIR.Record

a data type record to create a protocol/struct/class for