reader

package
v0.0.0-...-a60ced3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadParams = errors.New("error bad params")
)

Functions

func CheckMagicToken

func CheckMagicToken(magic []byte, offset int, size int) error

Types

type BaseReader

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

func NewBaseReader

func NewBaseReader(data []byte) *BaseReader

func (*BaseReader) ConvertToUTF8

func (r *BaseReader) ConvertToUTF8() (err error)

Convert to UTF8 data

type LineReader

type LineReader interface {
	NextLine()
	GetLine() string
	GetLineNum() int
	NextLineVector3(verticesKey string) (vertices []*common.AiVector3D, err error)
	ReadLineAiVector3d() (res *common.AiVector3D, err error)
	HasPrefix(prefix string) bool
	NextKeyString(key string, index int) (res []string, err error)
	NextOneKeyInt(key string) (res int, err error)
	NextOneKeyFloat32(key string) (res float32, err error)
	NextKeyAiColor3d(key string) (res *common.AiColor3D, err error)
	NextKeyAiMatrix3x3(key string) (res *common.AiMatrix3x3, err error)
	EOF() bool

	MustOneKeyString(key string) (string, error)
	MustOneKeyInt(key string, options ...bool) (int, error)
	NextKeyAiVector2d(key string) (res *common.AiVector2D, err error)
	MustOneKeyFloat32(key string) (float32, error)
	NextKeyAiVector3d(key string) (res *common.AiVector3D, err error)
	NextOneKeyString(key string) (res string, err error)
}

func NewFileLineReader

func NewFileLineReader(data []byte) (res LineReader, err error)

type StreamReader

type StreamReader interface {
	ChangeBytesOrder(isLittle bool)
	GetInt64() (v int64, err error)
	GetInt32() (v int32, err error)
	GetInt16() (v int16, err error)
	GetInt8() (v int8, err error)
	GetNBytes(n int) (res []byte, err error)
	GetString(n int) (string, error)
	ResetGzipReader() error
	GetUInt64() (v uint64, err error)
	GetUInt32() (v uint32, err error)
	GetUInt16() (v uint16, err error)
	GetUInt8() (v uint8, err error)

	GetFloat32() (v float32, err error)
	GetFloat64() (v float64, err error)

	Peek(n int) ([]byte, error)
	Discard(n int) error
	SetCurPos(pos int)
	GetCurPos() int
	GetRemainingSizeToLimit() int
	ResetData()
}

func NewFileStreamReader

func NewFileStreamReader(data []byte) (res StreamReader, err error)

Jump to

Keyboard shortcuts

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