gen

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CheckErr1 = func(p *Generator) func(...interface{}) {
		return func(args ...interface{}) {
			p.Block(append(append([]interface{}{"if", "err", ":="}, args...), ";", "err != nil", func() {
				p.P("return", "err")
			}))
		}
	}

	CheckErr2 = func(p *Generator) func(...interface{}) {
		return func(args ...interface{}) {
			p.P(args...)
		}
	}
)
View Source
var (
	GoName           = go_names.GoName
	GoNameNoReserved = go_names.GoNameNoReserved
	GoMergeNames     = go_names.GoMergeNames
	GoSnakeCase      = go_names.GoSnakeCase
	LexName          = go_names.GoLexName
	Escape           = go_names.Escape
	RPCName          = go_names.Unescape
	Title            = go_names.Title
)
View Source
var (
	AnyParam = 0
	InParam  = 1
	OutParam = 2
)
View Source
var (
	// UTF16 String.
	UTF16LenFunc = "ndr.UTF16Len"
	// Char String.
	ByteLenFunc = "ndr.CharLen"
	// UTF16 Null-Terminated String.
	UTF16NLenFunc = "ndr.UTF16NLen"
	// Char Null-Terminated String.
	ByteNLenFunc = "ndr.CharNLen"
	// MultiSzLen
	MultiSzLenFunc = "ndr.MultiSzLen"
)
View Source
var (
	DefaultImports = []Import{
		{
			Name:  "context",
			Guard: "context.Background",
		},
		{
			Name:  "fmt",
			Guard: "fmt.Errorf",
		},
		{
			Name:  "unicode/utf16",
			Guard: "utf16.Encode",
		},
		{
			Name:  "strings",
			Guard: "strings.TrimPrefix",
		},
		{
			Name:  "ndr",
			Guard: "ndr.ZeroString",
			Path:  "github.com/oiweiwei/go-msrpc/ndr",
		},
		{
			Name:  "uuid",
			Guard: "(*uuid.UUID)(nil)",
			Path:  "github.com/oiweiwei/go-msrpc/midl/uuid",
		},
		{
			Name:  "dcerpc",
			Guard: "(*dcerpc.SyntaxID)(nil)",
			Path:  "github.com/oiweiwei/go-msrpc/dcerpc",
		},
		{
			Name:  "errors",
			Guard: "(*errors.Error)(nil)",
			Path:  "github.com/oiweiwei/go-msrpc/dcerpc/errors",
		},
	}
)
View Source
var (
	Obj = "o"
)
View Source
var (
	ZeroLen = "%ZERO%"
)

Functions

func Field

func Field(ctx context.Context) *midl.Field

func FieldName

func FieldName(i int, n string) string

func File

func File(ctx context.Context) *midl.File

func GoFieldName

func GoFieldName(field *midl.Field) string

func GoPackage

func GoPackage(ctx context.Context, n string) (string, *midl.Version, bool)

func GoPrimitiveTypeName

func GoPrimitiveTypeName(t midl.Kind) string

func Interface

func Interface(ctx context.Context) *midl.Interface

func IsOp

func IsOp(ctx context.Context) bool

func IsReserved

func IsReserved(ctx context.Context) bool

func LookupName

func LookupName(ctx context.Context, scopes *Scopes) string

func MSUnion

func MSUnion(ctx context.Context) bool

func ParamName

func ParamName(dir int) string

func PointerDefault

func PointerDefault(ctx context.Context) midl.PointerType

func UUIDToGUID

func UUIDToGUID(u *uuid.UUID) string

func WithField

func WithField(ctx context.Context, field *midl.Field) context.Context

func WithFile

func WithFile(ctx context.Context, f *midl.File) context.Context

func WithInterface

func WithInterface(ctx context.Context, iff *midl.Interface) context.Context

func WithOp

func WithOp(ctx context.Context) context.Context

func WithReserved

func WithReserved(ctx context.Context) context.Context

func WithVarName

func WithVarName(ctx context.Context, n string) context.Context

Types

type FileBuffer

type FileBuffer struct {
	Out         *bytes.Buffer
	Path        string
	PackageName string
	Imports     []Import
	FileName    string
	IsRoot      bool
}

func NewFileBuffer

func NewFileBuffer(path string, pkg string, n ...string) *FileBuffer

func (*FileBuffer) Reset

func (f *FileBuffer) Reset() []byte

type Generator

type Generator struct {
	Trace       bool
	MultiFile   bool
	Format      bool
	ImportsPath string
	Dir         string
	Doc         *doc.Doc
	Cache       string
	Opts        GeneratorOptions
	CheckErr    func(...interface{})
	Files       []*FileBuffer
	// contains filtered or unexported fields
}

func (*Generator) AddImport

func (p *Generator) AddImport(imp Import)

func (*Generator) Amp

func (p *Generator) Amp(v interface{}) string

func (*Generator) B

func (p *Generator) B(pre interface{}, s ...interface{}) string

func (*Generator) BPtr

func (p *Generator) BPtr(ptr interface{}) string

func (*Generator) Block

func (p *Generator) Block(args ...interface{})

func (*Generator) BufVar

func (p *Generator) BufVar(name string) string

func (*Generator) ByteLen

func (p *Generator) ByteLen(ctx context.Context, n string, isNullTerminated bool) string

ByteLen function returns the byte length-count function call on variable `n`.

func (*Generator) CB

func (p *Generator) CB(f func())

func (*Generator) DataLen

func (p *Generator) DataLen(ctx context.Context, field *midl.Field, scopes *Scopes, n string, defaultTypeSize ...string) string

DataLen function returns the proper length-count function call on variable `n`.

func (*Generator) EO

func (p *Generator) EO(n string) string

EO function generates the O with namer.

func (*Generator) Else

func (p *Generator) Else(args ...interface{}) []interface{}

func (*Generator) ElseIf

func (p *Generator) ElseIf(args ...interface{}) []interface{}

func (*Generator) EmbeddedTypeName

func (p *Generator) EmbeddedTypeName(ctx context.Context, attrs *midl.TypeAttr, field *midl.Field) string

func (*Generator) Gen

func (p *Generator) Gen(ctx context.Context, fn string) error

func (*Generator) GenClient

func (p *Generator) GenClient(ctx context.Context, iff *midl.Interface)

func (*Generator) GenClientInterface

func (p *Generator) GenClientInterface(ctx context.Context, iff *midl.Interface)

func (*Generator) GenComment

func (p *Generator) GenComment(ctx context.Context, docs []string)

func (*Generator) GenConst

func (p *Generator) GenConst(ctx context.Context, c *midl.Const)

func (*Generator) GenDoAlignmentMarshalNDR

func (p *Generator) GenDoAlignmentMarshalNDR(ctx context.Context, alignment int)

func (*Generator) GenDoAlignmentUnmarshalNDR

func (p *Generator) GenDoAlignmentUnmarshalNDR(ctx context.Context, alignment int)

func (*Generator) GenImportGuards

func (p *Generator) GenImportGuards(ctx context.Context)

func (*Generator) GenImports

func (p *Generator) GenImports(ctx context.Context)

func (*Generator) GenInterfaceID

func (p *Generator) GenInterfaceID(ctx context.Context, iff *midl.Interface)

func (*Generator) GenOpName

func (p *Generator) GenOpName(ctx context.Context, op *midl.Operation, dir int)

func (*Generator) GenOpNum

func (p *Generator) GenOpNum(ctx context.Context, op *midl.Operation, dir int)

func (*Generator) GenOperation

func (p *Generator) GenOperation(ctx context.Context, op *midl.Operation)

func (*Generator) GenOperationFromOp

func (p *Generator) GenOperationFromOp(ctx context.Context, op *midl.Operation, dir int)

func (*Generator) GenOperationMarshalNDR

func (p *Generator) GenOperationMarshalNDR(ctx context.Context, op *midl.Operation, dir int)

func (*Generator) GenOperationStruct

func (p *Generator) GenOperationStruct(ctx context.Context, op *midl.Operation, dir int)

func (*Generator) GenOperationToOp

func (p *Generator) GenOperationToOp(ctx context.Context, op *midl.Operation, dir int)

func (*Generator) GenOperationUnmarshalNDR

func (p *Generator) GenOperationUnmarshalNDR(ctx context.Context, op *midl.Operation, dir int)

func (*Generator) GenPackage

func (p *Generator) GenPackage(ctx context.Context, f *midl.File)

func (*Generator) GenPackageImportGuard

func (p *Generator) GenPackageImportGuard(ctx context.Context)

func (*Generator) GenParamComment

func (p *Generator) GenParamComment(ctx context.Context, param *midl.Param) string

func (*Generator) GenPointerType

func (p *Generator) GenPointerType(ctx context.Context, scopes *Scopes) midl.PointerType

When no pointer attribute is associated with a pointer that is a member of a structure or union, the MIDL compiler assigns pointer attributes using the following priority rules (1 is highest):

1. Attributes explicitly applied to the pointer type 2. Attributes explicitly applied to the pointer parameter or member 3. (?) The pointer_default attribute in the IDL file that defines the type 4. The pointer_default attribute in the IDL file that imports the type 5. Unique (Microsoft RPC default mode)

func (*Generator) GenRange

func (p *Generator) GenRange(ctx context.Context, n string, i, upto int, fn func(context.Context, string))

func (*Generator) GenReadSize

func (p *Generator) GenReadSize(ctx context.Context, sz interface{})

func (*Generator) GenServerHandle

func (p *Generator) GenServerHandle(ctx context.Context, iff *midl.Interface)

func (*Generator) GenServerInterface

func (p *Generator) GenServerInterface(ctx context.Context, iff *midl.Interface)

func (*Generator) GenTag

func (p *Generator) GenTag(ctx context.Context, field *midl.Field) string

func (*Generator) GenType

func (p *Generator) GenType(ctx context.Context, t *midl.Type)

func (*Generator) GenWriteSize

func (p *Generator) GenWriteSize(ctx context.Context, sz interface{})

func (*Generator) GetImports

func (p *Generator) GetImports() []Import

func (*Generator) GoFieldTypeName

func (p *Generator) GoFieldTypeName(ctx context.Context, attr *midl.TypeAttr, field *midl.Field) string

func (*Generator) GoInterfaceTypeName

func (p *Generator) GoInterfaceTypeName(ctx context.Context, iff *midl.Interface, n string) string

func (*Generator) GoPackageName

func (p *Generator) GoPackageName(ctx context.Context, scopes *Scopes) string

func (*Generator) GoScopeTypeName

func (p *Generator) GoScopeTypeName(ctx context.Context, attr *midl.TypeAttr, field *midl.Field, scopes *Scopes, trim ...bool) string

func (*Generator) GoTypeName

func (p *Generator) GoTypeName(ctx context.Context, attrs *midl.TypeAttr, field *midl.Field, scopes *Scopes) string

func (*Generator) GoTypeZeroValue

func (p *Generator) GoTypeZeroValue(ctx context.Context, attr *midl.TypeAttr, field *midl.Field, scopes *Scopes) string

GoTypeZeroValue function returns the zero value for the given type. (nil, "", intX(0), uintX(0), false).

func (*Generator) IVar

func (p *Generator) IVar(n string, idxs ...interface{}) string

func (*Generator) If

func (p *Generator) If(args ...interface{})

func (*Generator) IsDir

func (p *Generator) IsDir(ctx context.Context, pdir midl.Direction, dir int) bool

func (*Generator) IsUnusedOp

func (p *Generator) IsUnusedOp(n string) bool

func (*Generator) Len

func (p *Generator) Len(n string) string

func (*Generator) MethodName

func (p *Generator) MethodName(ctx context.Context, op *midl.Operation) string

func (*Generator) NewParamGenerator

func (p *Generator) NewParamGenerator(ctx context.Context, typ *midl.Type) *ParamGenerator

func (*Generator) NewTypeGenerator

func (p *Generator) NewTypeGenerator(ctx context.Context, typ *midl.Type) *TypeGenerator

func (*Generator) O

func (p *Generator) O(n string) string

O function generates the "o."

func (*Generator) OpName

func (p *Generator) OpName(ctx context.Context, op *midl.Operation, dir int) string

func (*Generator) OperationParams

func (p *Generator) OperationParams(ctx context.Context, op *midl.Operation) []*midl.Param

func (*Generator) OperationReturnValue

func (p *Generator) OperationReturnValue(ctx context.Context, op *midl.Operation) *midl.Param

func (*Generator) P

func (p *Generator) P(args ...interface{})

func (*Generator) PrepareOperationPayloadHook

func (p *Generator) PrepareOperationPayloadHook(ctx context.Context, dir int)

func (*Generator) Q

func (p *Generator) Q(n string) string

func (*Generator) R

func (p *Generator) R(start, s, end string, count int) string

R function generates the repeat with start end sequence.

func (*Generator) Range

func (p *Generator) Range(args ...interface{})

func (*Generator) Reset

func (p *Generator) Reset(ctx context.Context, source interface{}, n ...string)

func (*Generator) ReturnValue

func (p *Generator) ReturnValue() string

func (*Generator) Structure

func (p *Generator) Structure(args ...interface{})

func (*Generator) SyntaxName

func (p *Generator) SyntaxName(ctx context.Context, iff *midl.Interface) string

func (*Generator) T

func (p *Generator) T(args ...interface{})

func (*Generator) ToVar

func (p *Generator) ToVar(s string) string

func (*Generator) UTF16Len

func (p *Generator) UTF16Len(ctx context.Context, n string, isNullTerminated bool) string

UTF16Len function returns the UTF16 length-count function call on variable `n`.

func (*Generator) Var

func (p *Generator) Var(n string, idx ...interface{}) string

Var function generates the variable name.

func (*Generator) VarName

func (p *Generator) VarName(ctx context.Context, index ...interface{}) string

func (*Generator) XXX

func (p *Generator) XXX() string

type GeneratorOptions

type GeneratorOptions struct {
	UnmarshalRequest  bool
	UnmarshalResponse bool
}

type Import

type Import struct {
	Name, Path, Guard string
}

type ParamGenerator

type ParamGenerator struct {
	*Generator
	*TypeGenerator
}

type Scopes

type Scopes struct {
	// contains filtered or unexported fields
}

Scopes structure is a scope list iterator. Within single scope pointer default attributes are applied.

func NewScopes

func NewScopes(scopes []*midl.Scope) *Scopes

NewScope function ...

func (*Scopes) Alias

func (i *Scopes) Alias() string

func (*Scopes) Alignment

func (i *Scopes) Alignment() int

func (*Scopes) Array

func (i *Scopes) Array() *midl.Array

func (*Scopes) Base

func (i *Scopes) Base() *Scopes

func (*Scopes) Dim

func (i *Scopes) Dim() midl.Dim

Dim function returns the dimenisonal information for current scoped type.

func (*Scopes) Enum

func (i *Scopes) Enum() *midl.Enum

func (*Scopes) EnumType

func (i *Scopes) EnumType() midl.Kind

func (*Scopes) GoName

func (i *Scopes) GoName() string

func (*Scopes) Is

func (i *Scopes) Is(kind midl.Kind) bool

Is function ...

func (*Scopes) IsBool

func (i *Scopes) IsBool() bool

IsBool function returns `true` if type can be rendered as a boolean.

func (*Scopes) IsConformant

func (i *Scopes) IsConformant() bool

IsConformant function returns `true` if array is conformant. That is, array is conformant if it's not fixed (and length needed to be determined in a runtime).

func (*Scopes) IsDeferrable

func (i *Scopes) IsDeferrable() bool

func (*Scopes) IsNotFixedArray

func (i *Scopes) IsNotFixedArray() bool

func (*Scopes) IsTopLevelArray

func (i *Scopes) IsTopLevelArray() bool

IsTopLevelArray function returns true if given array should have a conformance data written. It can be top-level if the data type is a pointer, or a fixed array. The top level array may contain varying information which needs to be written.

func (*Scopes) IsTopLevelPointer

func (i *Scopes) IsTopLevelPointer() bool

IsTopLevelPointer function returns `true` if current scope points to a first pointer in a possible chain of pointers.

func (*Scopes) IsV1Enum

func (i *Scopes) IsV1Enum() bool

func (*Scopes) IsVarying

func (i *Scopes) IsVarying() bool

IsVarying function checks if the given array is varying. Varying array is an array that has length_is, first_is, last_is, and for some reason it has a string property. (or it is a pointer to wchar_t, char, which is a non-null terminated string.)

func (*Scopes) Kind

func (i *Scopes) Kind() midl.Kind

func (*Scopes) Next

func (i *Scopes) Next() *Scopes

Next function advances the scope to the next type.

func (*Scopes) PointerCount

func (i *Scopes) PointerCount() int

PointerCount function returns the number of pointers following the current pointer (+ current pointer itself).

func (*Scopes) Scope

func (i *Scopes) Scope() *midl.TypeAttr

Scope function returns the attributes for the current scoped set of types.

func (*Scopes) ScopedType

func (i *Scopes) ScopedType() *midl.Type

ScopedType function return type with scope attributes.

func (*Scopes) Struct

func (i *Scopes) Struct() *midl.Struct

func (*Scopes) StructLastField

func (i *Scopes) StructLastField() *midl.Field

func (*Scopes) Type

func (i *Scopes) Type() *midl.Type

Type function returns the current type.

func (*Scopes) Union

func (i *Scopes) Union() *midl.Union

func (*Scopes) WithAlias

func (i *Scopes) WithAlias(a string) *Scopes

type TypeGenerator

type TypeGenerator struct {
	*Generator
	*Scopes
	GoTypeName string
	Doc        *doc.TypeDoc
	OrigType   *midl.Type
}

func (*TypeGenerator) ArmFields

func (p *TypeGenerator) ArmFields(ctx context.Context, cases *midl.UnionCase) []*midl.Field

func (*TypeGenerator) GenArraySizeVar

func (p *TypeGenerator) GenArraySizeVar(ctx context.Context, field *midl.Field, i int, scopes *Scopes, name string, sizeExpr midl.Expr) string

func (*TypeGenerator) GenCUnion

func (p *TypeGenerator) GenCUnion(ctx context.Context)

func (*TypeGenerator) GenEnum

func (p *TypeGenerator) GenEnum(ctx context.Context)

func (*TypeGenerator) GenExpr

func (p *TypeGenerator) GenExpr(ctx context.Context, expr midl.Expr, field *midl.Field, typ string, n ...string) string

func (*TypeGenerator) GenFieldMarshalNDR

func (p *TypeGenerator) GenFieldMarshalNDR(ctx context.Context, field *midl.Field, scopes *Scopes, index ...interface{})

func (*TypeGenerator) GenFieldUnmarshalNDR

func (p *TypeGenerator) GenFieldUnmarshalNDR(ctx context.Context, field *midl.Field, scopes *Scopes, index ...interface{})

func (*TypeGenerator) GenInterface

func (p *TypeGenerator) GenInterface(ctx context.Context)

func (*TypeGenerator) GenMarshalSizeInfo

func (p *TypeGenerator) GenMarshalSizeInfo(ctx context.Context, field *midl.Field, scopes *Scopes, index ...interface{}) bool

func (*TypeGenerator) GenStruct

func (p *TypeGenerator) GenStruct(ctx context.Context)

func (*TypeGenerator) GenStructField

func (p *TypeGenerator) GenStructField(ctx context.Context, field *midl.Field)

func (*TypeGenerator) GenStructFieldComment

func (p *TypeGenerator) GenStructFieldComment(ctx context.Context, field *midl.Field, defaultPtr ...string) string

func (*TypeGenerator) GenStructMarshalNDR

func (p *TypeGenerator) GenStructMarshalNDR(ctx context.Context)

func (*TypeGenerator) GenStructMarshalNDRSizePreamble

func (p *TypeGenerator) GenStructMarshalNDRSizePreamble(ctx context.Context, field *midl.Field)

func (*TypeGenerator) GenStructNDRSizeInfo

func (p *TypeGenerator) GenStructNDRSizeInfo(ctx context.Context)

func (*TypeGenerator) GenStructPreparePayload

func (p *TypeGenerator) GenStructPreparePayload(ctx context.Context)

func (*TypeGenerator) GenStructPreparePayloadAfterHook

func (p *TypeGenerator) GenStructPreparePayloadAfterHook(ctx context.Context)

func (*TypeGenerator) GenStructPreparePayloadFields

func (p *TypeGenerator) GenStructPreparePayloadFields(ctx context.Context, fields []*midl.Field)

func (*TypeGenerator) GenStructPreparePayloadSizeExpr

func (p *TypeGenerator) GenStructPreparePayloadSizeExpr(ctx context.Context, field *midl.Field, scopes *Scopes, sz midl.Expr)

func (*TypeGenerator) GenStructUnmarshalNDR

func (p *TypeGenerator) GenStructUnmarshalNDR(ctx context.Context)

func (*TypeGenerator) GenStructUnmarshalNDRSizePreamble

func (p *TypeGenerator) GenStructUnmarshalNDRSizePreamble(ctx context.Context, field *midl.Field)

func (*TypeGenerator) GenSubType

func (p *TypeGenerator) GenSubType(ctx context.Context, field *midl.Field)

func (*TypeGenerator) GenSubTypes

func (p *TypeGenerator) GenSubTypes(ctx context.Context, fields []*midl.Field)

func (*TypeGenerator) GenUnion

func (p *TypeGenerator) GenUnion(ctx context.Context)

func (*TypeGenerator) GenUnionArm

func (p *TypeGenerator) GenUnionArm(ctx context.Context, cases *midl.UnionCase)

func (*TypeGenerator) GenUnionArmInterface

func (p *TypeGenerator) GenUnionArmInterface(ctx context.Context, cases *midl.UnionCase)

func (*TypeGenerator) GenUnionArmMarshalNDR

func (p *TypeGenerator) GenUnionArmMarshalNDR(ctx context.Context, arm *midl.UnionCase, caseName string)

func (*TypeGenerator) GenUnionArmPrimitiveTypeMarshalNDR

func (p *TypeGenerator) GenUnionArmPrimitiveTypeMarshalNDR(ctx context.Context, cases *midl.UnionCase, armName string)

func (*TypeGenerator) GenUnionArmPrimitiveTypeUnmarshalNDR

func (p *TypeGenerator) GenUnionArmPrimitiveTypeUnmarshalNDR(ctx context.Context, cases *midl.UnionCase, armName string)

func (*TypeGenerator) GenUnionArmUnmarshalNDR

func (p *TypeGenerator) GenUnionArmUnmarshalNDR(ctx context.Context, arm *midl.UnionCase, caseName string)

func (*TypeGenerator) GenUnionMarshalNDR

func (p *TypeGenerator) GenUnionMarshalNDR(ctx context.Context)

func (*TypeGenerator) GenUnionUnmarshalNDR

func (p *TypeGenerator) GenUnionUnmarshalNDR(ctx context.Context)

func (*TypeGenerator) GenWriteStringBuffer

func (p *TypeGenerator) GenWriteStringBuffer(ctx context.Context, scopes *Scopes, field *midl.Field, index ...interface{}) string

GenWriteStringBuffer function ...

func (*TypeGenerator) GenZeroArrayFieldMarhalNDR

func (p *TypeGenerator) GenZeroArrayFieldMarhalNDR(ctx context.Context, field *midl.Field, scopes *Scopes, index ...interface{})

func (*TypeGenerator) GenZeroEnumFieldMarshalNDR

func (p *TypeGenerator) GenZeroEnumFieldMarshalNDR(ctx context.Context, field *midl.Field, scopes *Scopes, index ...interface{})

func (*TypeGenerator) GenZeroFieldMarshalNDR

func (p *TypeGenerator) GenZeroFieldMarshalNDR(ctx context.Context, field *midl.Field, scopes *Scopes, index ...interface{})

func (*TypeGenerator) GenZeroPointerFieldMarshalNDR

func (p *TypeGenerator) GenZeroPointerFieldMarshalNDR(ctx context.Context, field *midl.Field, scopes *Scopes, index ...interface{})

func (*TypeGenerator) GenZeroStructFieldMarshalNDR

func (p *TypeGenerator) GenZeroStructFieldMarshalNDR(ctx context.Context, field *midl.Field, scopes *Scopes, index ...interface{})

func (*TypeGenerator) GenZeroUnionFieldMarshalNDR

func (p *TypeGenerator) GenZeroUnionFieldMarshalNDR(ctx context.Context, field *midl.Field, scopes *Scopes, index ...interface{})

func (*TypeGenerator) GenerateNDRSwitchValue

func (p *TypeGenerator) GenerateNDRSwitchValue(ctx context.Context)

func (*TypeGenerator) GenerateSwitchIs

func (p *TypeGenerator) GenerateSwitchIs(ctx context.Context, field *midl.Field, scopes *Scopes, switchVar string)

func (*TypeGenerator) GenerateUnionGetValue

func (p *TypeGenerator) GenerateUnionGetValue(ctx context.Context)

func (*TypeGenerator) GetMinVarValue

func (p *TypeGenerator) GetMinVarValue(ctx context.Context, sizeExpr midl.Expr) (midl.Expr, int64, bool)

func (*TypeGenerator) GoFieldName

func (p *TypeGenerator) GoFieldName(field *midl.Field) string

func (*TypeGenerator) IsArmPointerToPrimitiveType

func (p *TypeGenerator) IsArmPointerToPrimitiveType(ctx context.Context, cases *midl.UnionCase) bool

func (*TypeGenerator) IsEmbeddedArmStruct

func (p *TypeGenerator) IsEmbeddedArmStruct(ctx context.Context, cases *midl.UnionCase) bool

func (*TypeGenerator) LookupExprField

func (p *TypeGenerator) LookupExprField(ctx context.Context, expr midl.Expr) *midl.Field

func (*TypeGenerator) Skip

func (p *TypeGenerator) Skip() bool

func (*TypeGenerator) SwitchType

func (p *TypeGenerator) SwitchType(ctx context.Context, scopes *Scopes) string

func (*TypeGenerator) UnionArmName

func (p *TypeGenerator) UnionArmName(ctx context.Context, cases *midl.UnionCase) string

Jump to

Keyboard shortcuts

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