nbt

package
v0.0.0-...-16e062c Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotCompound = errors.New("first tag must be a compound tag")

Functions

This section is empty.

Types

type CompressionType

type CompressionType int
const (
	Uncompressed CompressionType = iota
	Gzip
	Zlib
)

type Parser

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

func NewParser

func NewParser(reader io.Reader) (*Parser, error)

func (*Parser) Read

func (p *Parser) Read() (tag TagCompound, outerName string, err error)

type Tag

type Tag interface {
	Type() TagId
	// contains filtered or unexported methods
}

type TagByte

type TagByte byte

func (TagByte) Type

func (t TagByte) Type() TagId

type TagByteArray

type TagByteArray []byte

func (TagByteArray) Type

func (t TagByteArray) Type() TagId

type TagCompound

type TagCompound map[string]Tag

func (TagCompound) Type

func (t TagCompound) Type() TagId

type TagDouble

type TagDouble float64

func (TagDouble) Type

func (t TagDouble) Type() TagId

type TagEnd

type TagEnd struct{}

func (TagEnd) Type

func (t TagEnd) Type() TagId

type TagFloat

type TagFloat float32

func (TagFloat) Type

func (t TagFloat) Type() TagId

type TagId

type TagId uint8
const (
	TagTypeEnd TagId = iota
	TagTypeByte
	TagTypeShort
	TagTypeInt
	TagTypeLong
	TagTypeFloat
	TagTypeDouble
	TagTypeByteArray
	TagTypeString
	TagTypeList
	TagTypeCompound
	TagTypeIntArray
	TagTypeLongArray
)

func (TagId) Read

func (id TagId) Read(parser *Parser) (tag Tag, err error)

type TagInt

type TagInt int32

func (TagInt) Type

func (t TagInt) Type() TagId

type TagIntArray

type TagIntArray []int32

func (TagIntArray) Type

func (t TagIntArray) Type() TagId

type TagList

type TagList struct {
	ElementType TagId
	Elements    []Tag
}

func (TagList) Type

func (t TagList) Type() TagId

type TagLong

type TagLong int64

func (TagLong) Type

func (t TagLong) Type() TagId

type TagLongArray

type TagLongArray []int64

func (TagLongArray) Type

func (t TagLongArray) Type() TagId

type TagShort

type TagShort int16

func (TagShort) Type

func (t TagShort) Type() TagId

type TagString

type TagString string

func (TagString) Type

func (t TagString) Type() TagId

type Writer

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

func NewWriter

func NewWriter(writer io.Writer) *Writer

func (*Writer) Write

func (w *Writer) Write(tag TagCompound, outerName string) (err error)

Jump to

Keyboard shortcuts

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