swift

package
v0.0.0-...-406ca89 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SwiftTypeInt    = "Int"
	SwiftTypeInt64  = "Int64"
	SwiftTypeString = "String"
	SwiftTypeBool   = "Bool"
	SwiftTypeByte   = "Byte"
	SwiftTypeDouble = "Double"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseSwift

type BaseSwift struct {
	Filepath string
	Thrift   *parser.Thrift
	Thrifts  map[string]*parser.Thrift
}

func (*BaseSwift) AssembleCustomizedTypeName

func (this *BaseSwift) AssembleCustomizedTypeName(t *parser.Type) string

func (*BaseSwift) AssembleStructName

func (b *BaseSwift) AssembleStructName(n string) string

AssembleStructName returns object name of generated file name, assembled with namespace

func (*BaseSwift) AssignToDict

func (b *BaseSwift) AssignToDict(f *parser.Field) string

func (*BaseSwift) FilterPropertory

func (this *BaseSwift) FilterPropertory(n string) string

if the property name is the keyword of swift, rename it but encode/decode with its origin name

func (*BaseSwift) GetInnerType

func (this *BaseSwift) GetInnerType(t *parser.Type) string

func (*BaseSwift) IsBasicType

func (this *BaseSwift) IsBasicType(t string) bool

func (*BaseSwift) IsEnum

func (b *BaseSwift) IsEnum(t *parser.Type) bool

IsEnum checks whether a type is enum. it first checks in its own definition, than check from included files

func (*BaseSwift) ParamsJoinedByComma

func (this *BaseSwift) ParamsJoinedByComma(args []*parser.Field) string

func (*BaseSwift) PlainType

func (this *BaseSwift) PlainType(t *parser.Type) string

func (*BaseSwift) Typecast

func (this *BaseSwift) Typecast(t *parser.Type, flag bool) string

func (*BaseSwift) TypecastWithDefaultValue

func (this *BaseSwift) TypecastWithDefaultValue(t *parser.Type) string

func (*BaseSwift) TypecastWithoutDefaultValue

func (this *BaseSwift) TypecastWithoutDefaultValue(t *parser.Type) string

type SwiftGen

type SwiftGen struct {
	langs.BaseGen
}

func (*SwiftGen) Generate

func (g *SwiftGen) Generate(output string, parsedThrift map[string]*parser.Thrift)

Generate is the entry of the logic

Jump to

Keyboard shortcuts

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