forked from BigfootDev/flatbuffers
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:
@@ -1,2 +1,17 @@
|
||||
..\flatc.exe -c -j -n -g -b -p --php -s --gen-mutable --no-includes monster_test.fbs monsterdata_test.json
|
||||
..\flatc.exe -b --schema monster_test.fbs
|
||||
:: Copyright 2015 Google Inc. All rights reserved.
|
||||
::
|
||||
:: Licensed under the Apache License, Version 2.0 (the "License");
|
||||
:: you may not use this file except in compliance with the License.
|
||||
:: You may obtain a copy of the License at
|
||||
::
|
||||
:: http://www.apache.org/licenses/LICENSE-2.0
|
||||
::
|
||||
:: Unless required by applicable law or agreed to in writing, software
|
||||
:: distributed under the License is distributed on an "AS IS" BASIS,
|
||||
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
:: See the License for the specific language governing permissions and
|
||||
:: limitations under the License.
|
||||
|
||||
..\flatc.exe --cpp --java --csharp --go --binary --python --js --php --gen-mutable --no-includes monster_test.fbs monsterdata_test.json
|
||||
..\flatc.exe --cpp --java --csharp --go --binary --python --js --php --gen-mutable -o namespace_test namespace_test\namespace_test1.fbs namespace_test\namespace_test2.fbs
|
||||
..\flatc.exe --binary --schema monster_test.fbs
|
||||
|
||||
@@ -1,2 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2015 Google Inc. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
../flatc --cpp --java --csharp --go --binary --python --js --php --gen-mutable --no-includes monster_test.fbs monsterdata_test.json
|
||||
../flatc --cpp --java --csharp --go --binary --python --js --php --gen-mutable -o namespace_test namespace_test/namespace_test1.fbs namespace_test/namespace_test2.fbs
|
||||
../flatc --binary --schema monster_test.fbs
|
||||
|
||||
|
||||
@@ -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
@@ -42,11 +42,14 @@ MANUALLY_ALIGNED_STRUCT(4) StructInNestedNS FLATBUFFERS_FINAL_CLASS {
|
||||
STRUCT_END(StructInNestedNS, 8);
|
||||
|
||||
struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
int32_t foo() const { return GetField<int32_t>(4, 0); }
|
||||
bool mutate_foo(int32_t _foo) { return SetField(4, _foo); }
|
||||
enum {
|
||||
VT_FOO = 4,
|
||||
};
|
||||
int32_t foo() const { return GetField<int32_t>(VT_FOO, 0); }
|
||||
bool mutate_foo(int32_t _foo) { return SetField(VT_FOO, _foo); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int32_t>(verifier, 4 /* foo */) &&
|
||||
VerifyField<int32_t>(verifier, VT_FOO) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
@@ -54,7 +57,7 @@ struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct TableInNestedNSBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_foo(int32_t foo) { fbb_.AddElement<int32_t>(4, foo, 0); }
|
||||
void add_foo(int32_t foo) { fbb_.AddElement<int32_t>(TableInNestedNS::VT_FOO, foo, 0); }
|
||||
TableInNestedNSBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
TableInNestedNSBuilder &operator=(const TableInNestedNSBuilder &);
|
||||
flatbuffers::Offset<TableInNestedNS> Finish() {
|
||||
|
||||
143
tests/namespace_test/namespace_test1_generated.js
Normal file
143
tests/namespace_test/namespace_test1_generated.js
Normal file
@@ -0,0 +1,143 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/**
|
||||
* @const
|
||||
*/
|
||||
var NamespaceA = NamespaceA || {};
|
||||
|
||||
/**
|
||||
* @const
|
||||
*/
|
||||
NamespaceA.NamespaceB = NamespaceA.NamespaceB || {};
|
||||
|
||||
/**
|
||||
* @enum
|
||||
*/
|
||||
NamespaceA.NamespaceB.EnumInNestedNS = {
|
||||
A: 0,
|
||||
B: 1,
|
||||
C: 2
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
NamespaceA.NamespaceB.TableInNestedNS = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {NamespaceA.NamespaceB.TableInNestedNS}
|
||||
*/
|
||||
NamespaceA.NamespaceB.TableInNestedNS.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {NamespaceA.NamespaceB.TableInNestedNS=} obj
|
||||
* @returns {NamespaceA.NamespaceB.TableInNestedNS}
|
||||
*/
|
||||
NamespaceA.NamespaceB.TableInNestedNS.getRootAsTableInNestedNS = function(bb, obj) {
|
||||
return (obj || new NamespaceA.NamespaceB.TableInNestedNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
NamespaceA.NamespaceB.TableInNestedNS.prototype.foo = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
NamespaceA.NamespaceB.TableInNestedNS.startTableInNestedNS = function(builder) {
|
||||
builder.startObject(1);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} foo
|
||||
*/
|
||||
NamespaceA.NamespaceB.TableInNestedNS.addFoo = function(builder, foo) {
|
||||
builder.addFieldInt32(0, foo, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
NamespaceA.NamespaceB.TableInNestedNS.endTableInNestedNS = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
NamespaceA.NamespaceB.StructInNestedNS = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {NamespaceA.NamespaceB.StructInNestedNS}
|
||||
*/
|
||||
NamespaceA.NamespaceB.StructInNestedNS.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
NamespaceA.NamespaceB.StructInNestedNS.prototype.a = function() {
|
||||
return this.bb.readInt32(this.bb_pos);
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
NamespaceA.NamespaceB.StructInNestedNS.prototype.b = function() {
|
||||
return this.bb.readInt32(this.bb_pos + 4);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {number} a
|
||||
* @param {number} b
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
NamespaceA.NamespaceB.StructInNestedNS.createStructInNestedNS = function(builder, a, b) {
|
||||
builder.prep(4, 8);
|
||||
builder.writeInt32(b);
|
||||
builder.writeInt32(a);
|
||||
return builder.offset();
|
||||
};
|
||||
|
||||
// Exports for Node.js and RequireJS
|
||||
this.NamespaceA = NamespaceA;
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
#include "namespace_test1_generated.h"
|
||||
|
||||
namespace NamespaceA {
|
||||
namespace NamespaceB {
|
||||
struct TableInNestedNS;
|
||||
@@ -17,18 +19,23 @@ namespace NamespaceA {
|
||||
struct TableInFirstNS;
|
||||
|
||||
struct TableInFirstNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
const NamespaceA::NamespaceB::TableInNestedNS *foo_table() const { return GetPointer<const NamespaceA::NamespaceB::TableInNestedNS *>(4); }
|
||||
NamespaceA::NamespaceB::TableInNestedNS *mutable_foo_table() { return GetPointer<NamespaceA::NamespaceB::TableInNestedNS *>(4); }
|
||||
NamespaceA::NamespaceB::EnumInNestedNS foo_enum() const { return static_cast<NamespaceA::NamespaceB::EnumInNestedNS>(GetField<int8_t>(6, 0)); }
|
||||
bool mutate_foo_enum(NamespaceA::NamespaceB::EnumInNestedNS _foo_enum) { return SetField(6, static_cast<int8_t>(_foo_enum)); }
|
||||
const NamespaceA::NamespaceB::StructInNestedNS *foo_struct() const { return GetStruct<const NamespaceA::NamespaceB::StructInNestedNS *>(8); }
|
||||
NamespaceA::NamespaceB::StructInNestedNS *mutable_foo_struct() { return GetStruct<NamespaceA::NamespaceB::StructInNestedNS *>(8); }
|
||||
enum {
|
||||
VT_FOO_TABLE = 4,
|
||||
VT_FOO_ENUM = 6,
|
||||
VT_FOO_STRUCT = 8,
|
||||
};
|
||||
const NamespaceA::NamespaceB::TableInNestedNS *foo_table() const { return GetPointer<const NamespaceA::NamespaceB::TableInNestedNS *>(VT_FOO_TABLE); }
|
||||
NamespaceA::NamespaceB::TableInNestedNS *mutable_foo_table() { return GetPointer<NamespaceA::NamespaceB::TableInNestedNS *>(VT_FOO_TABLE); }
|
||||
NamespaceA::NamespaceB::EnumInNestedNS foo_enum() const { return static_cast<NamespaceA::NamespaceB::EnumInNestedNS>(GetField<int8_t>(VT_FOO_ENUM, 0)); }
|
||||
bool mutate_foo_enum(NamespaceA::NamespaceB::EnumInNestedNS _foo_enum) { return SetField(VT_FOO_ENUM, static_cast<int8_t>(_foo_enum)); }
|
||||
const NamespaceA::NamespaceB::StructInNestedNS *foo_struct() const { return GetStruct<const NamespaceA::NamespaceB::StructInNestedNS *>(VT_FOO_STRUCT); }
|
||||
NamespaceA::NamespaceB::StructInNestedNS *mutable_foo_struct() { return GetStruct<NamespaceA::NamespaceB::StructInNestedNS *>(VT_FOO_STRUCT); }
|
||||
bool Verify(flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* foo_table */) &&
|
||||
VerifyField<flatbuffers::uoffset_t>(verifier, VT_FOO_TABLE) &&
|
||||
verifier.VerifyTable(foo_table()) &&
|
||||
VerifyField<int8_t>(verifier, 6 /* foo_enum */) &&
|
||||
VerifyField<NamespaceA::NamespaceB::StructInNestedNS>(verifier, 8 /* foo_struct */) &&
|
||||
VerifyField<int8_t>(verifier, VT_FOO_ENUM) &&
|
||||
VerifyField<NamespaceA::NamespaceB::StructInNestedNS>(verifier, VT_FOO_STRUCT) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
@@ -36,9 +43,9 @@ struct TableInFirstNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
struct TableInFirstNSBuilder {
|
||||
flatbuffers::FlatBufferBuilder &fbb_;
|
||||
flatbuffers::uoffset_t start_;
|
||||
void add_foo_table(flatbuffers::Offset<NamespaceA::NamespaceB::TableInNestedNS> foo_table) { fbb_.AddOffset(4, foo_table); }
|
||||
void add_foo_enum(NamespaceA::NamespaceB::EnumInNestedNS foo_enum) { fbb_.AddElement<int8_t>(6, static_cast<int8_t>(foo_enum), 0); }
|
||||
void add_foo_struct(const NamespaceA::NamespaceB::StructInNestedNS *foo_struct) { fbb_.AddStruct(8, foo_struct); }
|
||||
void add_foo_table(flatbuffers::Offset<NamespaceA::NamespaceB::TableInNestedNS> foo_table) { fbb_.AddOffset(TableInFirstNS::VT_FOO_TABLE, foo_table); }
|
||||
void add_foo_enum(NamespaceA::NamespaceB::EnumInNestedNS foo_enum) { fbb_.AddElement<int8_t>(TableInFirstNS::VT_FOO_ENUM, static_cast<int8_t>(foo_enum), 0); }
|
||||
void add_foo_struct(const NamespaceA::NamespaceB::StructInNestedNS *foo_struct) { fbb_.AddStruct(TableInFirstNS::VT_FOO_STRUCT, foo_struct); }
|
||||
TableInFirstNSBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
|
||||
TableInFirstNSBuilder &operator=(const TableInFirstNSBuilder &);
|
||||
flatbuffers::Offset<TableInFirstNS> Finish() {
|
||||
|
||||
115
tests/namespace_test/namespace_test2_generated.js
Normal file
115
tests/namespace_test/namespace_test2_generated.js
Normal file
@@ -0,0 +1,115 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/**
|
||||
* @const
|
||||
*/
|
||||
var NamespaceA = NamespaceA || {};
|
||||
|
||||
/**
|
||||
* @const
|
||||
*/
|
||||
NamespaceA.NamespaceB = NamespaceA.NamespaceB || {};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
NamespaceA.TableInFirstNS = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {NamespaceA.TableInFirstNS}
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {NamespaceA.TableInFirstNS=} obj
|
||||
* @returns {NamespaceA.TableInFirstNS}
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.getRootAsTableInFirstNS = function(bb, obj) {
|
||||
return (obj || new NamespaceA.TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {NamespaceA.NamespaceB.TableInNestedNS=} obj
|
||||
* @returns {NamespaceA.NamespaceB.TableInNestedNS}
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.prototype.fooTable = function(obj) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 4);
|
||||
return offset ? (obj || new NamespaceA.NamespaceB.TableInNestedNS).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {NamespaceA.NamespaceB.EnumInNestedNS}
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.prototype.fooEnum = function() {
|
||||
var offset = this.bb.__offset(this.bb_pos, 6);
|
||||
return offset ? /** @type {NamespaceA.NamespaceB.EnumInNestedNS} */ (this.bb.readInt8(this.bb_pos + offset)) : NamespaceA.NamespaceB.EnumInNestedNS.A;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {NamespaceA.NamespaceB.StructInNestedNS=} obj
|
||||
* @returns {NamespaceA.NamespaceB.StructInNestedNS}
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.prototype.fooStruct = function(obj) {
|
||||
var offset = this.bb.__offset(this.bb_pos, 8);
|
||||
return offset ? (obj || new NamespaceA.NamespaceB.StructInNestedNS).__init(this.bb_pos + offset, this.bb) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.startTableInFirstNS = function(builder) {
|
||||
builder.startObject(3);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} fooTableOffset
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.addFooTable = function(builder, fooTableOffset) {
|
||||
builder.addFieldOffset(0, fooTableOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {NamespaceA.NamespaceB.EnumInNestedNS} fooEnum
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.addFooEnum = function(builder, fooEnum) {
|
||||
builder.addFieldInt8(1, fooEnum, NamespaceA.NamespaceB.EnumInNestedNS.A);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @param {flatbuffers.Offset} fooStructOffset
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.addFooStruct = function(builder, fooStructOffset) {
|
||||
builder.addFieldStruct(2, fooStructOffset, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
NamespaceA.TableInFirstNS.endTableInFirstNS = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
// Exports for Node.js and RequireJS
|
||||
this.NamespaceA = NamespaceA;
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "flatbuffers/util.h"
|
||||
|
||||
#include "monster_test_generated.h"
|
||||
#include "namespace_test/namespace_test1_generated.h"
|
||||
#include "namespace_test/namespace_test2_generated.h"
|
||||
|
||||
#include <random>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user