Files
flatbuffers/tests/namespace_test/namespace_test1_generated.lobster
William Bain efcbdc7698 [Rust] Ensure unions are referenced with the correct path (#6422)
* Add codegen test for namespaced unions

* [Rust] Handle cross-namespace union use

* [Rust] Test namespace handling

* [Rust] Drop trailing whitespace in codegen

* [Rust] Set flags in generate_code.bat to match .sh

* [C#] Add additional namespace test file
2021-01-25 09:33:47 -08:00

48 lines
1.1 KiB
Plaintext

// automatically generated by the FlatBuffers compiler, do not modify
import flatbuffers
namespace NamespaceA_NamespaceB
enum UnionInNestedNS:
UnionInNestedNS_NONE = 0
UnionInNestedNS_TableInNestedNS = 1
enum EnumInNestedNS:
EnumInNestedNS_A = 0
EnumInNestedNS_B = 1
EnumInNestedNS_C = 2
class TableInNestedNS
class StructInNestedNS
class TableInNestedNS : flatbuffers_handle
def foo():
return buf_.flatbuffers_field_int32(pos_, 4, 0)
def GetRootAsTableInNestedNS(buf:string): return TableInNestedNS { buf, buf.flatbuffers_indirect(0) }
struct TableInNestedNSBuilder:
b_:flatbuffers_builder
def start():
b_.StartObject(1)
return this
def add_foo(foo:int):
b_.PrependInt32Slot(0, foo, 0)
return this
def end():
return b_.EndObject()
class StructInNestedNS : flatbuffers_handle
def a():
return buf_.read_int32_le(pos_ + 0)
def b():
return buf_.read_int32_le(pos_ + 4)
def CreateStructInNestedNS(b_:flatbuffers_builder, a:int, b:int):
b_.Prep(4, 8)
b_.PrependInt32(b)
b_.PrependInt32(a)
return b_.Offset()