Documentation Language: Swift

Class

GIR

Representation of a GIR file

final class GIR

Topics

Classes

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.CType

a type with an underlying C type entry

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.Datatype

GIR type class

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

C
GIR.Signal

a signal is equivalent to a function

C
GIR.Thing

GIR named thing class

C
GIR.Union

a union data type record

Initializers

?
init(buffer:quiet:)

convenience constructor to read from memory

?
init(fromFile:)

convenience constructor to read a gir file

?
init(xmlDocument:quiet:)

designated constructor

Instance Properties

V
aliases

Aliases defined by this GIR file

V
bitfields

Bitfields defined by this GIR file

V
boilerPlate

code boiler plate

V
callbacks

Callbacs defined by this GIR file

V
classes

Classes defined by this GIR file

V
constants

Constants defined by this GIR file

V
enumerations

Enums defined by this GIR file

V
functions

Free functions defined by this GIR file

V
identifierPrefixes

Collection of identifier prefixes

V
interfaces

Interfaces defined by this GIR file

V
namespaces

Type-erased sequence of namespaces

V
preamble

Preample boilerplate to output before any generated code

V
prefix

Namespace prefix defined by the receiver

V
records

Records defined by this GIR file

V
symbolPrefixes

Collection of symbol prefixes

V
unions

Unions defined by this GIR file

V
xml

The parsed XML document represented by the receiver

Instance Methods

F
buildClassHierarchy()

Traverse all the classes and record their relationship in the type hierarchy

F
buildConformanceGraph()

Traverse all the records and record all the interfaces implemented

F
dumpSwift()

dump Swift code

F
recordImplementedInterfaces(for:)

Traverse all the records and record all the interfaces implemented

Type Properties

?
?
?
KnownFunctions

context of known functions

?
aliases

Common aliases used

?
bitfields

Known bitfields

?
?
callbackSuffixes

suffixes for @escaping callback heuristics

?
?
docCHostingBasePath

DocC hosting base path relative to /.

?
dottedPrefix

Current namespace prefix with a trailing “.”

?
enums

Known enums

?
?
?
excludeList

Names of excluded identifiers.

?
forceUnwrapped

types to turn into force-unwrapped optionals

?
fundamentalTypes

All fundamental types prior to GIR parsing

?
?
?
glibPointerWrapper

Name of the GLib pointer wrapper that every type conforms to.

?
?
?
implements

Interface implementation table

?
?
knownBitfields

context of known records

?
knownCIdentifiers

known types indexed by C identifier.

?
knownDataTypes

context of known types

?
knownRecords

context of known records

?
knownTypes

All known types so far

?
namedTypes

Mapping from names to known types

?
namespaceReplacements

Dotted namespace replacements

?
numericConversions

All numeric conversions

?
optionSets

Swift OptionSet equivalent to the given C enum

?
overrides

names of override initialisers

?
prefix

Current namespace prefix

?
protocols

Protocol conversion for a given record

?
recordRefs

Ref conversion for a given record

?
recordTypes

Known records

?
refRecords

Class conversion for a given ref

?
?
swiftFundamentalReplacements

Fundamental swift type replacements required for the compiler

?
swiftParameterTypeReplacements

Idiomatic swift type replacements for parameters

?
swiftReturnTypeReplacements

Idiomatic swift type replacements for return types

?
swiftSignalTypeReplacements

Idiomatic swift type replacements for signals

?
typedCollections

Names of typed collections.

?
underlyingPrimitiveSwiftTypes

Mapping of gir type names to Swift names for underlying C types

?
?
verbatimConstants

names of constants to be taken verbatim

Type Methods

C
args(children:)

return the method/function arguments for the given child nodes

C
deprecatedDocumentation(children:)

return the documentation for the given child nodes

C
docs(children:)

return the documentation for the given child nodes

C
documentation(name:children:)

return the documentation for the given child nodes

Enumerations

E
GIR.OwnershipTransfer

Ownership transfer mechanism

E
GIR.ParameterDirection

Parameter direction