dat

package
v0.0.0-...-78985d9 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TypeUint8       FieldType = "u8"
	TypeUint16                = "u16"
	TypeUint32                = "u32"
	TypeUint64                = "u64"
	TypeInt32                 = "i32"
	TypeInt64                 = "i64"
	TypeFloat32               = "f32"
	TypeFloat64               = "f64"
	TypeBool                  = "bool"
	TypeString                = "string"
	TypeShortID               = "shortid"
	TypeLongID                = "longid"
	TypeListUint8             = "u8[]"
	TypeListUint16            = "u16[]"
	TypeListUint32            = "u32[]"
	TypeListUint64            = "u64[]"
	TypeListInt32             = "i32[]"
	TypeListInt64             = "i64[]"
	TypeListFloat32           = "f32[]"
	TypeListFloat64           = "f64[]"
	TypeListBool              = "bool[]"
	TypeListString            = "string[]"
	TypeListShortID           = "shortid[]"
	TypeListLongID            = "longid[]"
	TypeListVoid              = "void[]"
)
View Source
const (
	Dat32 parserWidth = iota
	Dat64
	Datl32
	Datl64
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataField

type DataField struct {
	Name   string
	Type   FieldType
	Offset int
}

type DataFormat

type DataFormat struct {
	Name   string
	Fields []DataField
	// contains filtered or unexported fields
}

func (*DataFormat) Size

func (df *DataFormat) Size() int

func (DataFormat) Type

func (df DataFormat) Type() reflect.Type

type DataParser

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

func InitParser

func InitParser(version string) *DataParser

func (*DataParser) Parse

func (p *DataParser) Parse(r io.Reader, filename string) ([]any, error)

func (*DataParser) SetDebug

func (dp *DataParser) SetDebug(level int)

func (*DataParser) SetFormatDir

func (dp *DataParser) SetFormatDir(path string)

func (*DataParser) SetStrict

func (dp *DataParser) SetStrict(level int)

type FieldType

type FieldType string

func (FieldType) Size

func (ft FieldType) Size(w parserWidth) int

func (FieldType) Valid

func (ft FieldType) Valid() bool

type JsonEnum

type JsonEnum struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type JsonField

type JsonField struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description,omitempty"`
	Since       string `json:"since,omitempty"`
	Until       string `json:"until,omitempty"`
	Unique      bool   `json:"unique,omitempty"`
	Ref         string `json:"ref,omitempty"`
	RefField    string `json:"ref-field,omitempty"`
	Path        string `json:"path,omitempty"`
}

type JsonFormat

type JsonFormat struct {
	File        string      `json:"file"`
	Fields      []JsonField `json:"fields"`
	Enum        []JsonEnum  `json:"enum,omitempty"`
	Description string      `json:"description,omitempty"`
	Since       string      `json:"since,omitempty"`
	Until       string      `json:"until,omitempty"`
}

func (JsonFormat) BuildType

func (jfmt JsonFormat) BuildType(dp *DataParser) (DataFormat, error)

Jump to

Keyboard shortcuts

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