fields

package
v0.0.0-...-b52216c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	TypeName    string
	MangledName string
	SuperClass  string
	Kind        string
	Records     []Record
	Offset      int64
	Descriptor  FieldDescriptor
}

func (Field) IsClass

func (f Field) IsClass() bool

func (Field) IsEnum

func (f Field) IsEnum() bool

func (Field) IsProtocol

func (f Field) IsProtocol() bool

type FieldDescriptor

type FieldDescriptor struct {
	Header
	FieldRecords []RecordT
}
type Header struct {
	MangledTypeName int32
	Superclass      int32
	Kind            Kind
	FieldRecordSize uint16
	NumFields       uint32
}

type Kind

type Kind uint16
const (
	// Swift nominal types.
	Struct Kind = iota
	Class
	Enum

	// Fixed-size multi-payload enums have a special descriptor format that
	// encodes spare bits.
	//
	// FIXME: Actually implement this. For now, a descriptor with this kind
	// just means we also have a builtin descriptor from which we get the
	// size and alignment.
	MultiPayloadEnum

	// A Swift opaque protocol. There are no fields, just a record for the
	// type itself.
	Protocol

	// A Swift class-bound protocol.
	ClassProtocol

	// An Objective-C protocol, which may be imported or defined in Swift.
	ObjCProtocol

	// An Objective-C class, which may be imported or defined in Swift.
	// In the former case, field type metadata is not emitted, and
	// must be obtained from the Objective-C runtime.
	ObjCClass
)

func (Kind) String

func (i Kind) String() string

type Record

type Record struct {
	Name            string
	Type            []byte
	MangledTypeName string
	Flags           string
}

type RecordFlags

type RecordFlags uint32
const (
	// IsIndirectCase is this an indirect enum case?
	IsIndirectCase RecordFlags = 0x1
	// IsVar is this a mutable `var` property?
	IsVar RecordFlags = 0x2
)

func (RecordFlags) String

func (i RecordFlags) String() string

type RecordT

type RecordT struct {
	Flags           RecordFlags
	MangledTypeName int32
	FieldName       int32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL