printer

package
v0.0.0-...-40e4400 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPrinter

func RegisterPrinter(ext string, p Printer)

Types

type Globals

type Globals struct {
	Version            string
	InputFileList      []interface{}
	ParaMode           bool
	ProtoVersion       int
	LuaEnumIntValue    bool
	LuaTabHeader       string
	GenCSSerailizeCode bool
	PackageName        string

	Printers []*PrinterContext

	CombineStructName string // 不包含路径, 用作

	*model.FileDescriptor // 类型信息.用于添加各种导出结构

	Tables []*model.Table // 数据信息.表格数据

	GlobalIndexes []TableIndex      // 类型信息.全局索引
	CombineStruct *model.Descriptor // 类型信息.Combine结构体

	BuildID string
	// contains filtered or unexported fields
}

func NewGlobals

func NewGlobals() *Globals

func (*Globals) AddContent

func (self *Globals) AddContent(tab *model.Table) bool

合并每个表带的类型

func (*Globals) AddOutputType

func (self *Globals) AddOutputType(name string, outfile string)

func (*Globals) AddTypes

func (self *Globals) AddTypes(localFD *model.FileDescriptor) bool

func (*Globals) PreExport

func (self *Globals) PreExport() bool

func (*Globals) Print

func (self *Globals) Print() bool

type Printer

type Printer interface {
	Run(g *Globals) *Stream
}

type PrinterContext

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

func (*PrinterContext) Start

func (self *PrinterContext) Start(g *Globals) bool

type Stream

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

func NewStream

func NewStream() *Stream

func (*Stream) Buffer

func (self *Stream) Buffer() *bytes.Buffer

func (*Stream) Len

func (self *Stream) Len() int

func (*Stream) Printf

func (self *Stream) Printf(format string, args ...interface{})

func (*Stream) WriteBytes

func (self *Stream) WriteBytes(v []byte)

func (*Stream) WriteFile

func (self *Stream) WriteFile(outfile string) error

func (*Stream) WriteInt32

func (self *Stream) WriteInt32(v int32)

func (*Stream) WriteNodeValue

func (self *Stream) WriteNodeValue(ft model.FieldType, value *model.Node)

func (*Stream) WriteRawBytes

func (self *Stream) WriteRawBytes(b []byte)

func (*Stream) WriteString

func (self *Stream) WriteString(v string)

type TableIndex

type TableIndex struct {
	Index *model.FieldDescriptor // 表头里的索引
	Row   *model.FieldDescriptor // 索引的数据
}

Jump to

Keyboard shortcuts

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