Documentation Language: Swift

Class

GIRType

Representation of a fundamental type, its relationship to other types, and casting operations

class GIRType

Topics

Operators

?
==(_:_:)

Equality check for a type. Two types are considered equal if they have the same names and C types.

Initializers

?
init(_:swiftName:typeName:ctype:superType:isAlias:conversions:)

Convenience initialiser for a top-level GIR type

?
init(aliasOf:name:in:swiftName:ctype:)

Initialise a new type as an alias of the given type reference, cloning its type conversions

?
init(aliasOf:name:in:swiftName:ctype:)

Initialise a new type as an alias of the given type reference, cloning its type conversions

?
init(name:swiftName:typeName:ctype:superType:isAlias:conversions:)

Convenience initialiser for a GIR type in the current namespace

Instance Properties

V
castName

Swift name to use for casting: removes trailing ! and ?

V
castTypeName

Type name to use for casting: removes trailing ! and ?

V
conversions

Dictionary of possible type conversion (cast) operations to target types.

V
ctype

Name of the type in C

V
dottedPrefix

Convenience property, returning the dotted prefix

V
isAlias

Indicator whether this type is an alias that doesn’t need casting

V
isGPointer

Return whether the type is a magic gpointer or related

V
name

Name of the type defined in the GIR file, without a namespace

V
namePrefixedWhereNecessary

Return the normalised, fully qualified name, if necessary

V
namespace

Namespace for this type, empty if in the global namespace

V
normalisedDottedPrefix

Convenience property, returning the normalised, dotted prefix

V
parent

The supertype (or equivalent, if alias) of this type

V
prefixedName

Return the normalised, fully qualified name

V
swiftName

Name of the type in Swift

V
swiftNamePrefixedWhereNecessary

Return the normalised, fully qualified name, if necessary

V
typeName

Name of the type

V
typeNamePrefixedWhereNecessary

Return the normalised, fully qualified name, if necessary

Instance Methods

F
cast(expression:from:pointerLevel:const:isConstSource:)

Return the default cast to convert the given expression from the source type

F
cast(expression:pointerLevel:const:isConstSource:)

Return the default cast to convert the given expression to the receiver

F
cast(expression:to:pointerLevel:const:isConstSource:)

Return the default cast to convert the given expression to the target type

F
hash(into:)

Hashes the essential components of this type by feeding them into the given hasher.

F
knownCast(expression:from:pointerLevel:const:)

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

F
knownCast(expression:to:pointerLevel:const:)

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

F
prefixedWhereNecessary(_:)

Return the given name, prefixed if necessary

Default Implementations

Relationships

Inherited By

Conforms To

See Also

Type system

C
GIRStringType

Representation of a string type, its relationship to other types, and casting operations

C
GIRRawPointerType

Representation of a raw pointer type, its relationship to other types, and casting operations

C
GIRRecordType

Representation of a record type (struct or class), its relationship to other types, and casting operations

C
GIRGenericType

Representation of a generic type (struct or class), its relationship to other types, and casting operations

C
GIROpaquePointerType

Representation of a opaque pointer type, its relationship to other types, and casting operations

C
TypeConversion

Type conversion operation. This root class is used for aliases/equal type conversions, i.e., casts are no-ops.

C
SubClassConversion

Parent/Child class conversion operation

C
OptionalSubClassConversion

Parent/Child class conversion operation with optional upcast

C
CustomConversion

Custom type conversion operation

C
NestedConversion

Nested type conversion operation

C
EnumTypeConversion

Enum type conversion operation.

C
BitfieldTypeConversion

Bit field (OptionSet) type conversion operation.

C
RawPointerConversion

Raw pointer conversion