package flatbuffers
type Table struct {
Bytes []byte
Pos UOffsetT
}
func (t *Table ) Offset (vtableOffset VOffsetT ) VOffsetT {
vtable := UOffsetT (SOffsetT (t .Pos ) - t .GetSOffsetT (t .Pos ))
if vtableOffset < t .GetVOffsetT (vtable ) {
return t .GetVOffsetT (vtable + UOffsetT (vtableOffset ))
}
return 0
}
func (t *Table ) Indirect (off UOffsetT ) UOffsetT {
return off + GetUOffsetT (t .Bytes [off :])
}
func (t *Table ) String (off UOffsetT ) string {
b := t .ByteVector (off )
return byteSliceToString (b )
}
func (t *Table ) ByteVector (off UOffsetT ) []byte {
off += GetUOffsetT (t .Bytes [off :])
start := off + UOffsetT (SizeUOffsetT )
length := GetUOffsetT (t .Bytes [off :])
return t .Bytes [start : start +length ]
}
func (t *Table ) VectorLen (off UOffsetT ) int {
off += t .Pos
off += GetUOffsetT (t .Bytes [off :])
return int (GetUOffsetT (t .Bytes [off :]))
}
func (t *Table ) Vector (off UOffsetT ) UOffsetT {
off += t .Pos
x := off + GetUOffsetT (t .Bytes [off :])
x += UOffsetT (SizeUOffsetT )
return x
}
func (t *Table ) Union (t2 *Table , off UOffsetT ) {
off += t .Pos
t2 .Pos = off + t .GetUOffsetT (off )
t2 .Bytes = t .Bytes
}
func (t *Table ) GetBool (off UOffsetT ) bool {
return GetBool (t .Bytes [off :])
}
func (t *Table ) GetByte (off UOffsetT ) byte {
return GetByte (t .Bytes [off :])
}
func (t *Table ) GetUint8 (off UOffsetT ) uint8 {
return GetUint8 (t .Bytes [off :])
}
func (t *Table ) GetUint16 (off UOffsetT ) uint16 {
return GetUint16 (t .Bytes [off :])
}
func (t *Table ) GetUint32 (off UOffsetT ) uint32 {
return GetUint32 (t .Bytes [off :])
}
func (t *Table ) GetUint64 (off UOffsetT ) uint64 {
return GetUint64 (t .Bytes [off :])
}
func (t *Table ) GetInt8 (off UOffsetT ) int8 {
return GetInt8 (t .Bytes [off :])
}
func (t *Table ) GetInt16 (off UOffsetT ) int16 {
return GetInt16 (t .Bytes [off :])
}
func (t *Table ) GetInt32 (off UOffsetT ) int32 {
return GetInt32 (t .Bytes [off :])
}
func (t *Table ) GetInt64 (off UOffsetT ) int64 {
return GetInt64 (t .Bytes [off :])
}
func (t *Table ) GetFloat32 (off UOffsetT ) float32 {
return GetFloat32 (t .Bytes [off :])
}
func (t *Table ) GetFloat64 (off UOffsetT ) float64 {
return GetFloat64 (t .Bytes [off :])
}
func (t *Table ) GetUOffsetT (off UOffsetT ) UOffsetT {
return GetUOffsetT (t .Bytes [off :])
}
func (t *Table ) GetVOffsetT (off UOffsetT ) VOffsetT {
return GetVOffsetT (t .Bytes [off :])
}
func (t *Table ) GetSOffsetT (off UOffsetT ) SOffsetT {
return GetSOffsetT (t .Bytes [off :])
}
func (t *Table ) GetBoolSlot (slot VOffsetT , d bool ) bool {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetBool (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetByteSlot (slot VOffsetT , d byte ) byte {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetByte (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetInt8Slot (slot VOffsetT , d int8 ) int8 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetInt8 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetUint8Slot (slot VOffsetT , d uint8 ) uint8 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetUint8 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetInt16Slot (slot VOffsetT , d int16 ) int16 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetInt16 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetUint16Slot (slot VOffsetT , d uint16 ) uint16 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetUint16 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetInt32Slot (slot VOffsetT , d int32 ) int32 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetInt32 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetUint32Slot (slot VOffsetT , d uint32 ) uint32 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetUint32 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetInt64Slot (slot VOffsetT , d int64 ) int64 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetInt64 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetUint64Slot (slot VOffsetT , d uint64 ) uint64 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetUint64 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetFloat32Slot (slot VOffsetT , d float32 ) float32 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetFloat32 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetFloat64Slot (slot VOffsetT , d float64 ) float64 {
off := t .Offset (slot )
if off == 0 {
return d
}
return t .GetFloat64 (t .Pos + UOffsetT (off ))
}
func (t *Table ) GetVOffsetTSlot (slot VOffsetT , d VOffsetT ) VOffsetT {
off := t .Offset (slot )
if off == 0 {
return d
}
return VOffsetT (off )
}
func (t *Table ) MutateBool (off UOffsetT , n bool ) bool {
WriteBool (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateByte (off UOffsetT , n byte ) bool {
WriteByte (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateUint8 (off UOffsetT , n uint8 ) bool {
WriteUint8 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateUint16 (off UOffsetT , n uint16 ) bool {
WriteUint16 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateUint32 (off UOffsetT , n uint32 ) bool {
WriteUint32 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateUint64 (off UOffsetT , n uint64 ) bool {
WriteUint64 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateInt8 (off UOffsetT , n int8 ) bool {
WriteInt8 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateInt16 (off UOffsetT , n int16 ) bool {
WriteInt16 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateInt32 (off UOffsetT , n int32 ) bool {
WriteInt32 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateInt64 (off UOffsetT , n int64 ) bool {
WriteInt64 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateFloat32 (off UOffsetT , n float32 ) bool {
WriteFloat32 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateFloat64 (off UOffsetT , n float64 ) bool {
WriteFloat64 (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateUOffsetT (off UOffsetT , n UOffsetT ) bool {
WriteUOffsetT (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateVOffsetT (off UOffsetT , n VOffsetT ) bool {
WriteVOffsetT (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateSOffsetT (off UOffsetT , n SOffsetT ) bool {
WriteSOffsetT (t .Bytes [off :], n )
return true
}
func (t *Table ) MutateBoolSlot (slot VOffsetT , n bool ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateBool (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateByteSlot (slot VOffsetT , n byte ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateByte (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateInt8Slot (slot VOffsetT , n int8 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateInt8 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateUint8Slot (slot VOffsetT , n uint8 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateUint8 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateInt16Slot (slot VOffsetT , n int16 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateInt16 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateUint16Slot (slot VOffsetT , n uint16 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateUint16 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateInt32Slot (slot VOffsetT , n int32 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateInt32 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateUint32Slot (slot VOffsetT , n uint32 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateUint32 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateInt64Slot (slot VOffsetT , n int64 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateInt64 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateUint64Slot (slot VOffsetT , n uint64 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateUint64 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateFloat32Slot (slot VOffsetT , n float32 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateFloat32 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
func (t *Table ) MutateFloat64Slot (slot VOffsetT , n float64 ) bool {
if off := t .Offset (slot ); off != 0 {
t .MutateFloat64 (t .Pos +UOffsetT (off ), n )
return true
}
return false
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .