meta/interface.go

97 lines
2.1 KiB
Go

package meta
type Reader interface {
ReadInt8(v *int8, field string) error
ReadInt16(v *int16, field string) error
ReadInt32(v *int32, field string) error
ReadInt64(v *int64, field string) error
ReadUint8(v *uint8, field string) error
ReadUint16(v *uint16, field string) error
ReadUint32(v *uint32, field string) error
ReadUint64(v *uint64, field string) error
ReadBool(v *bool, field string) error
ReadFloat32(v *float32, field string) error
ReadFloat64(v *float64, field string) error
ReadString(v *string, field string) error
ReadBytes(v *[]byte, field string) error
BeginContainer(field string) error
EndContainer() error
BeginCollection(field string) error
EndCollection() error
ContainerSize() (int, error)
IsContainerAssoc() (bool, error)
Skip() error
TryReadMask() (bool, FieldsMask, error)
}
type Writer interface {
WriteInt8(v int8, field string) error
WriteInt16(v int16, field string) error
WriteInt32(v int32, field string) error
WriteInt64(v int64, field string) error
WriteUint8(v uint8, field string) error
WriteUint16(v uint16, field string) error
WriteUint32(v uint32, field string) error
WriteUint64(v uint64, field string) error
WriteBool(v bool, field string) error
WriteFloat32(v float32, field string) error
WriteFloat64(v float64, field string) error
WriteString(v string, field string) error
WriteBytes(v []byte, field string) error
BeginCollection(length int, field string) error
EndCollection() error
BeginContainer(length int, field string) error
EndContainer() error
}
type Class interface {
ClassId() uint32
ClassName() string
}
type Readable interface {
Reset()
Read(Reader) error
ReadFields(Reader) error
}
type Writable interface {
Write(Writer) error
WriteFields(Writer) error
FieldsCount() int
}
type Struct interface {
Class
Readable
Writable
}
type StructFactory func(classId uint32) (Readable, error)
type Bitmasked interface {
FieldChanged(index uint64) bool
SetFieldChanged(index uint64)
HasChangedFields() bool
FieldsMask() FieldsMask
}
type WritableClass interface {
Class
Writable
}