mobile: golang.org/x/mobile/internal/importers/objc Index | Files

package objc

import "golang.org/x/mobile/internal/importers/objc"

The objc package takes the result of an AST traversal by the importers package and uses the clang command to dump the type information for the referenced ObjC classes and protocols.

It is the of go/types for ObjC types and is used by the bind package to generate Go wrappers for ObjC API on iOS.

Index

Package Files

objc.go

func Import Uses

func Import(refs *importers.References) ([]*Named, error)

Import returns descriptors for a list of references to ObjC protocols and classes.

The type information is parsed from the output of clang -cc1 -ast-dump.

type Func Uses

type Func struct {
    Sig    string
    GoName string
    Params []*Param
    Ret    *Type
    Static bool
    // Method whose name start with "init"
    Constructor bool
}

Func is a ObjC method, static functions as well as instance methods.

type Named Uses

type Named struct {
    Name       string
    GoName     string
    Module     string
    Funcs      []*Func
    Methods    []*Func
    AllMethods []*Func
    Supers     []Super

    Protocol bool
    // Generated is true if the type is wrapper of a
    // generated Go struct.
    Generated bool
    // contains filtered or unexported fields
}

Named represents ObjC classes and protocols.

func (*Named) ObjcType Uses

func (t *Named) ObjcType() string

type Param Uses

type Param struct {
    Name string
    Type *Type
}

type Super Uses

type Super struct {
    Name     string
    Protocol bool
}

Super denotes a super class or protocol.

type Type Uses

type Type struct {
    Kind TypeKind
    // For Interface and Protocol types.
    Name string

    // The declared type raw from the AST.
    Decl string
    // Set if the type is a pointer to its kind. For classes
    // Indirect is true if the type is a double pointer, e.g.
    // NSObject **.
    Indirect bool
    // contains filtered or unexported fields
}

type TypeKind Uses

type TypeKind int
const (
    Unknown TypeKind = iota
    Protocol
    Class
    String
    Data
    Int
    Uint
    Short
    Ushort
    Bool
    Char
    Uchar
    Float
    Double
)

Package objc imports 8 packages (graph) and is imported by 2 packages. Updated 2017-11-19. Refresh now. Tools for package owners.