mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-25 06:28:39 +00:00
Made sure all namespace test files get generated.
Also included them in the C++ test. Change-Id: Ib0c8470f0aacdf16616c27494abdda57a010195d Tested: on Linux.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# automatically generated, do not modify
|
||||
|
||||
# namespace: NamespaceB
|
||||
|
||||
class EnumInNestedNS(object):
|
||||
A = 0
|
||||
B = 1
|
||||
C = 2
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace NamespaceA.NamespaceB
|
||||
{
|
||||
|
||||
using System;
|
||||
using FlatBuffers;
|
||||
|
||||
public sealed class StructInNestedNS : Struct {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# automatically generated, do not modify
|
||||
|
||||
# namespace: NamespaceB
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class StructInNestedNS(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
# StructInNestedNS
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# StructInNestedNS
|
||||
def A(self): return self._tab.Get(flatbuffers.number_types.Int32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0))
|
||||
# StructInNestedNS
|
||||
def B(self): return self._tab.Get(flatbuffers.number_types.Int32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(4))
|
||||
|
||||
def CreateStructInNestedNS(builder, a, b):
|
||||
builder.Prep(4, 8)
|
||||
builder.PrependInt32(b)
|
||||
builder.PrependInt32(a)
|
||||
return builder.Offset()
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace NamespaceA.NamespaceB
|
||||
{
|
||||
|
||||
using System;
|
||||
using FlatBuffers;
|
||||
|
||||
public sealed class TableInNestedNS : Table {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# automatically generated, do not modify
|
||||
|
||||
# namespace: NamespaceB
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class TableInNestedNS(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
# TableInNestedNS
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# TableInNestedNS
|
||||
def Foo(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def TableInNestedNSStart(builder): builder.StartObject(1)
|
||||
def TableInNestedNSAddFoo(builder, foo): builder.PrependInt32Slot(0, foo, 0)
|
||||
def TableInNestedNSEnd(builder): return builder.EndObject()
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace NamespaceA
|
||||
{
|
||||
|
||||
using System;
|
||||
using FlatBuffers;
|
||||
|
||||
public sealed class TableInFirstNS : Table {
|
||||
|
||||
47
tests/namespace_test/NamespaceA/TableInFirstNS.py
Normal file
47
tests/namespace_test/NamespaceA/TableInFirstNS.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# automatically generated, do not modify
|
||||
|
||||
# namespace: NamespaceA
|
||||
|
||||
import flatbuffers
|
||||
|
||||
class TableInFirstNS(object):
|
||||
__slots__ = ['_tab']
|
||||
|
||||
# TableInFirstNS
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# TableInFirstNS
|
||||
def FooTable(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .TableInNestedNS import TableInNestedNS
|
||||
obj = TableInNestedNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# TableInFirstNS
|
||||
def FooEnum(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
# TableInFirstNS
|
||||
def FooStruct(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
x = o + self._tab.Pos
|
||||
from .StructInNestedNS import StructInNestedNS
|
||||
obj = StructInNestedNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
def TableInFirstNSStart(builder): builder.StartObject(3)
|
||||
def TableInFirstNSAddFooTable(builder, fooTable): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(fooTable), 0)
|
||||
def TableInFirstNSAddFooEnum(builder, fooEnum): builder.PrependInt8Slot(1, fooEnum, 0)
|
||||
def TableInFirstNSAddFooStruct(builder, fooStruct): builder.PrependStructSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(fooStruct), 0)
|
||||
def TableInFirstNSEnd(builder): return builder.EndObject()
|
||||
0
tests/namespace_test/NamespaceA/__init__.py
Normal file
0
tests/namespace_test/NamespaceA/__init__.py
Normal file
Reference in New Issue
Block a user