...

Text file src/github.com/google/flatbuffers/tests/MyGame/Example/Test.nim

Documentation: github.com/google/flatbuffers/tests/MyGame/Example

     1#[ MyGame.Example.Test
     2  Automatically generated by the FlatBuffers compiler, do not modify.
     3  Or modify. I'm a message, not a cop.
     4
     5  flatc version: 23.5.26
     6
     7  Declared by  : 
     8  Rooting type : MyGame.Example.Monster ()
     9]#
    10
    11import flatbuffers
    12
    13type Test* = object of FlatObj
    14func a*(self: Test): int16 =
    15  return Get[int16](self.tab, self.tab.Pos + 0)
    16func `a=`*(self: var Test, n: int16): bool =
    17  return self.tab.Mutate(self.tab.Pos + 0, n)
    18func b*(self: Test): int8 =
    19  return Get[int8](self.tab, self.tab.Pos + 2)
    20func `b=`*(self: var Test, n: int8): bool =
    21  return self.tab.Mutate(self.tab.Pos + 2, n)
    22proc TestCreate*(self: var Builder, a: int16, b: int8): uoffset =
    23  self.Prep(2, 4)
    24  self.Pad(1)
    25  self.Prepend(b)
    26  self.Prepend(a)
    27  return self.Offset()

View as plain text