mobile: Index | Files

package objc

import ""

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.


Package Files


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

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

Package objc imports 8 packages (graph) and is imported by 2 packages. Updated 2020-08-01. Refresh now. Tools for package owners.