• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Code generated by the FlatBuffers compiler. DO NOT EDIT.
2
3package Example
4
5import (
6	flatbuffers "github.com/google/flatbuffers/go"
7)
8
9type TestSimpleTableWithEnum struct {
10	_tab flatbuffers.Table
11}
12
13func GetRootAsTestSimpleTableWithEnum(buf []byte, offset flatbuffers.UOffsetT) *TestSimpleTableWithEnum {
14	n := flatbuffers.GetUOffsetT(buf[offset:])
15	x := &TestSimpleTableWithEnum{}
16	x.Init(buf, n+offset)
17	return x
18}
19
20func (rcv *TestSimpleTableWithEnum) Init(buf []byte, i flatbuffers.UOffsetT) {
21	rcv._tab.Bytes = buf
22	rcv._tab.Pos = i
23}
24
25func (rcv *TestSimpleTableWithEnum) Table() flatbuffers.Table {
26	return rcv._tab
27}
28
29func (rcv *TestSimpleTableWithEnum) Color() Color {
30	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
31	if o != 0 {
32		return rcv._tab.GetInt8(o + rcv._tab.Pos)
33	}
34	return 2
35}
36
37func (rcv *TestSimpleTableWithEnum) MutateColor(n Color) bool {
38	return rcv._tab.MutateInt8Slot(4, n)
39}
40
41func TestSimpleTableWithEnumStart(builder *flatbuffers.Builder) {
42	builder.StartObject(1)
43}
44func TestSimpleTableWithEnumAddColor(builder *flatbuffers.Builder, color int8) {
45	builder.PrependInt8Slot(0, color, 2)
46}
47func TestSimpleTableWithEnumEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
48	return builder.EndObject()
49}
50