├── python
├── __init__.py
├── flatbuffers
│ ├── __init__.py
│ ├── encode.py
│ ├── packer.py
│ └── compat.py
└── setup.py
├── tests
├── MyGame
│ ├── __init__.py
│ ├── Example
│ │ ├── __init__.py
│ │ ├── Color.py
│ │ ├── Any.py
│ │ ├── Color.cs
│ │ ├── Color.go
│ │ ├── Any.cs
│ │ ├── Any.go
│ │ ├── Color.java
│ │ ├── Color.php
│ │ ├── Any.java
│ │ ├── Any.php
│ │ ├── Test.py
│ │ ├── Ability.py
│ │ ├── Test.java
│ │ ├── Ability.java
│ │ ├── Test.cs
│ │ ├── TestSimpleTableWithEnum.py
│ │ ├── Ability.cs
│ │ ├── Test.go
│ │ ├── Ability.go
│ │ ├── Ability.php
│ │ ├── Test.php
│ │ ├── TestSimpleTableWithEnum.go
│ │ ├── Stat.py
│ │ ├── Vec3.py
│ │ ├── TestSimpleTableWithEnum.java
│ │ ├── Vec3.java
│ │ ├── Stat.go
│ │ ├── Vec3.cs
│ │ ├── TestSimpleTableWithEnum.cs
│ │ ├── Stat.java
│ │ ├── Vec3.php
│ │ ├── Vec3.go
│ │ └── Stat.cs
│ └── Example2
│ │ ├── Monster.py
│ │ ├── Monster.go
│ │ ├── Monster.java
│ │ ├── Monster.cs
│ │ └── Monster.php
├── namespace_test
│ ├── NamespaceA
│ │ ├── __init__.py
│ │ ├── NamespaceB
│ │ │ ├── __init__.py
│ │ │ ├── EnumInNestedNS.py
│ │ │ ├── EnumInNestedNS.cs
│ │ │ ├── EnumInNestedNS.go
│ │ │ ├── EnumInNestedNS.java
│ │ │ ├── EnumInNestedNS.php
│ │ │ ├── StructInNestedNS.py
│ │ │ ├── StructInNestedNS.java
│ │ │ ├── TableInNestedNS.py
│ │ │ ├── StructInNestedNS.cs
│ │ │ ├── StructInNestedNS.go
│ │ │ ├── StructInNestedNS.php
│ │ │ ├── TableInNestedNS.go
│ │ │ ├── TableInNestedNS.java
│ │ │ ├── TableInNestedNS.cs
│ │ │ └── TableInNestedNS.php
│ │ ├── SecondTableInA.py
│ │ ├── SecondTableInA.go
│ │ ├── TableInC.py
│ │ ├── TableInC.go
│ │ ├── SecondTableInA.java
│ │ ├── SecondTableInA.cs
│ │ ├── TableInC.java
│ │ ├── TableInC.cs
│ │ ├── TableInFirstNS.py
│ │ ├── TableInFirstNS.java
│ │ ├── SecondTableInA.php
│ │ └── TableInFirstNS.go
│ ├── namespace_test1.fbs
│ ├── namespace_test2.fbs
│ └── NamespaceC
│ │ ├── TableInC.py
│ │ ├── TableInC.go
│ │ ├── TableInC.java
│ │ └── TableInC.cs
├── monster_test.bfbs
├── monsterdata_test.mon
├── monsterdata_python_wire.mon
├── prototest
│ ├── imported.proto
│ ├── test.golden
│ └── test.proto
├── FlatBuffers.Test
│ ├── Resources
│ │ └── monsterdata_test.mon
│ ├── NetTest.sh
│ ├── FlatBuffersTestMethodAttribute.cs
│ ├── FlatBuffersTestClassAttribute.cs
│ ├── Lcg.cs
│ ├── FuzzTestData.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── include_test
│ ├── include_test1.fbs
│ └── sub
│ │ └── include_test2.fbs
├── unicode_test.json
├── fuzzer
│ ├── flatbuffers_verifier_fuzzer.cc
│ ├── flatbuffers_parser_fuzzer.cc
│ ├── build_fuzzer.sh
│ ├── build_run_verifier_test.sh
│ └── build_run_parser_test.sh
├── union_vector
│ └── union_vector.fbs
├── TestAll.sh
├── JavaScriptTest.sh
├── JavaTest.bat
├── TypeScriptTest.sh
├── monsterdata_test.json
├── generate_code.bat
├── monsterdata_test.golden
├── generate_code.sh
└── JavaTest.sh
├── .gitattributes
├── docs
├── source
│ ├── CONTRIBUTING.md
│ ├── groups
│ ├── gRPC
│ │ └── CppUsage.md
│ ├── README_TO_GENERATE_DOCS.md
│ ├── GoApi.md
│ └── Grammar.md
├── images
│ ├── ftv2mnode.png
│ ├── ftv2pnode.png
│ └── fpl_logo_small.png
└── footer.html
├── biicode.conf
├── go
├── doc.go
├── struct.go
├── lib.go
├── grpc.go
└── sizes.go
├── grpc
├── samples
│ └── greeter
│ │ ├── greeter.fbs
│ │ └── Makefile
├── README.md
└── src
│ └── compiler
│ └── config.h
├── samples
├── monsterdata.json
├── monster.fbs
├── android
│ ├── jni
│ │ ├── schemas
│ │ │ └── animal.fbs
│ │ ├── Application.mk
│ │ ├── main.cpp
│ │ └── Android.mk
│ ├── res
│ │ └── values
│ │ │ └── strings.xml
│ └── AndroidManifest.xml
├── android_sample.sh
├── php_sample.sh
├── javascript_sample.sh
├── python_sample.sh
├── csharp_sample.sh
├── java_sample.sh
├── sample_text.cpp
└── go_sample.sh
├── composer.json
├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── biicode
├── README.md
├── cmake
│ └── biicode.cmake
└── support
│ └── bii-travis.sh
├── reflection
├── generate_code.sh
└── reflection.fbs
├── package.json
├── php
├── Constants.php
└── Struct.php
├── android
├── jni
│ ├── main.cpp
│ ├── Application.mk
│ ├── run_flatc.py
│ └── Android.mk
├── .project
├── res
│ └── values
│ │ └── strings.xml
└── AndroidManifest.xml
├── net
└── FlatBuffers
│ ├── FlatBufferConstants.cs
│ ├── Struct.cs
│ ├── IFlatbufferObject.cs
│ ├── Offset.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ └── FlatBuffers.csproj
├── java
└── com
│ └── google
│ └── flatbuffers
│ ├── Struct.java
│ └── Constants.java
├── .travis.yml
├── .gitignore
├── appveyor.yml
├── CONTRIBUTING.md
└── CMake
└── FindFlatBuffers.cmake
/python/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/MyGame/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/tests/MyGame/Example/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/namespace_test/NamespaceA/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/source/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ../../CONTRIBUTING.md
--------------------------------------------------------------------------------
/tests/namespace_test/NamespaceA/NamespaceB/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/monster_test.bfbs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/josephDunne/flatbuffers/HEAD/tests/monster_test.bfbs
--------------------------------------------------------------------------------
/docs/images/ftv2mnode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/josephDunne/flatbuffers/HEAD/docs/images/ftv2mnode.png
--------------------------------------------------------------------------------
/docs/images/ftv2pnode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/josephDunne/flatbuffers/HEAD/docs/images/ftv2pnode.png
--------------------------------------------------------------------------------
/tests/monsterdata_test.mon:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/josephDunne/flatbuffers/HEAD/tests/monsterdata_test.mon
--------------------------------------------------------------------------------
/biicode.conf:
--------------------------------------------------------------------------------
1 | # Biicode configuration file
2 | [paths]
3 | include
4 | [mains]
5 | !android/*
6 | [tests]
7 | tests/*
8 |
--------------------------------------------------------------------------------
/docs/images/fpl_logo_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/josephDunne/flatbuffers/HEAD/docs/images/fpl_logo_small.png
--------------------------------------------------------------------------------
/go/doc.go:
--------------------------------------------------------------------------------
1 | // Package flatbuffers provides facilities to read and write flatbuffers
2 | // objects.
3 | package flatbuffers
4 |
--------------------------------------------------------------------------------
/tests/monsterdata_python_wire.mon:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/josephDunne/flatbuffers/HEAD/tests/monsterdata_python_wire.mon
--------------------------------------------------------------------------------
/tests/prototest/imported.proto:
--------------------------------------------------------------------------------
1 | package proto.test;
2 |
3 | message ImportedMessage {
4 | optional int32 a = 26;
5 | }
6 |
--------------------------------------------------------------------------------
/tests/FlatBuffers.Test/Resources/monsterdata_test.mon:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/josephDunne/flatbuffers/HEAD/tests/FlatBuffers.Test/Resources/monsterdata_test.mon
--------------------------------------------------------------------------------
/go/struct.go:
--------------------------------------------------------------------------------
1 | package flatbuffers
2 |
3 | // Struct wraps a byte slice and provides read access to its data.
4 | //
5 | // Structs do not have a vtable.
6 | type Struct struct {
7 | Table
8 | }
9 |
--------------------------------------------------------------------------------
/tests/include_test/include_test1.fbs:
--------------------------------------------------------------------------------
1 | include "sub/include_test2.fbs";
2 | include "sub/include_test2.fbs"; // should be skipped
3 | include "include_test1.fbs"; // should be skipped
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tests/MyGame/Example/Color.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: Example
4 |
5 | class Color(object):
6 | Red = 1
7 | Green = 2
8 | Blue = 8
9 |
10 |
--------------------------------------------------------------------------------
/tests/include_test/sub/include_test2.fbs:
--------------------------------------------------------------------------------
1 | include "sub/include_test2.fbs"; // should be skipped
2 |
3 | namespace MyGame.OtherNameSpace;
4 |
5 | enum FromInclude:long { IncludeVal }
6 |
7 | struct Unused {}
8 |
9 |
10 |
--------------------------------------------------------------------------------
/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: NamespaceB
4 |
5 | class EnumInNestedNS(object):
6 | A = 0
7 | B = 1
8 | C = 2
9 |
10 |
--------------------------------------------------------------------------------
/tests/MyGame/Example/Any.py:
--------------------------------------------------------------------------------
1 | # automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | # namespace: Example
4 |
5 | class Any(object):
6 | NONE = 0
7 | Monster = 1
8 | TestSimpleTableWithEnum = 2
9 | MyGame_Example2_Monster = 3
10 |
11 |
--------------------------------------------------------------------------------
/tests/namespace_test/namespace_test1.fbs:
--------------------------------------------------------------------------------
1 | namespace NamespaceA.NamespaceB;
2 |
3 | table TableInNestedNS
4 | {
5 | foo:int;
6 | }
7 |
8 | enum EnumInNestedNS:byte
9 | {
10 | A, B, C
11 | }
12 |
13 | struct StructInNestedNS
14 | {
15 | a:int;
16 | b:int;
17 | }
--------------------------------------------------------------------------------
/tests/MyGame/Example/Color.cs:
--------------------------------------------------------------------------------
1 | //
2 | // automatically generated by the FlatBuffers compiler, do not modify
3 | //
4 |
5 | namespace MyGame.Example
6 | {
7 |
8 | public enum Color : sbyte
9 | {
10 | Red = 1,
11 | Green = 2,
12 | Blue = 8,
13 | };
14 |
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/tests/MyGame/Example/Color.go:
--------------------------------------------------------------------------------
1 | // automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | package Example
4 |
5 | const (
6 | ColorRed = 1
7 | ColorGreen = 2
8 | ColorBlue = 8
9 | )
10 |
11 | var EnumNamesColor = map[int]string{
12 | ColorRed:"Red",
13 | ColorGreen:"Green",
14 | ColorBlue:"Blue",
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.cs:
--------------------------------------------------------------------------------
1 | //
2 | // automatically generated by the FlatBuffers compiler, do not modify
3 | //
4 |
5 | namespace NamespaceA.NamespaceB
6 | {
7 |
8 | public enum EnumInNestedNS : sbyte
9 | {
10 | A = 0,
11 | B = 1,
12 | C = 2,
13 | };
14 |
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/tests/MyGame/Example/Any.cs:
--------------------------------------------------------------------------------
1 | //
2 | // automatically generated by the FlatBuffers compiler, do not modify
3 | //
4 |
5 | namespace MyGame.Example
6 | {
7 |
8 | public enum Any : byte
9 | {
10 | NONE = 0,
11 | Monster = 1,
12 | TestSimpleTableWithEnum = 2,
13 | MyGame_Example2_Monster = 3,
14 | };
15 |
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/grpc/samples/greeter/greeter.fbs:
--------------------------------------------------------------------------------
1 | table HelloReply {
2 | message:string;
3 | }
4 |
5 | table HelloRequest {
6 | name:string;
7 | }
8 |
9 | table ManyHellosRequest {
10 | name:string;
11 | num_greetings:int;
12 | }
13 |
14 | rpc_service Greeter {
15 | SayHello(HelloRequest):HelloReply;
16 | SayManyHellos(ManyHellosRequest):HelloReply (streaming: "server");
17 | }
18 |
--------------------------------------------------------------------------------
/samples/monsterdata.json:
--------------------------------------------------------------------------------
1 | {
2 | pos: {
3 | x: 1,
4 | y: 2,
5 | z: 3
6 | },
7 | hp: 300,
8 | name: "Orc",
9 | weapons:[
10 | {
11 | name: "axe",
12 | damage:100
13 | },
14 | {
15 | name: "bow",
16 | damage:90
17 | }
18 | ],
19 | equipped_type: "Weapon",
20 | equipped:
21 | {
22 | name: "bow",
23 | damage:90
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go:
--------------------------------------------------------------------------------
1 | // automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | package NamespaceB
4 |
5 | const (
6 | EnumInNestedNSA = 0
7 | EnumInNestedNSB = 1
8 | EnumInNestedNSC = 2
9 | )
10 |
11 | var EnumNamesEnumInNestedNS = map[int]string{
12 | EnumInNestedNSA:"A",
13 | EnumInNestedNSB:"B",
14 | EnumInNestedNSC:"C",
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/tests/unicode_test.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "unicode_test",
3 | "testarrayoftables": [
4 | { "name": "Цлїςσδε" },
5 | { "name": "フムアムカモケモ" },
6 | { "name": "フムヤムカモケモ" },
7 | { "name": "㊀㊁㊂㊃㊄" },
8 | { "name": "☳☶☲" },
9 | { "name": "𡇙𝌆" }
10 | ],
11 | "testarrayofstring": [
12 | "Цлїςσδε",
13 | "フムアムカモケモ",
14 | "フムヤムカモケモ",
15 | "㊀㊁㊂㊃㊄",
16 | "☳☶☲",
17 | "𡇙𝌆"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/go/lib.go:
--------------------------------------------------------------------------------
1 | package flatbuffers
2 |
3 | // FlatBuffer is the interface that represents a flatbuffer.
4 | type FlatBuffer interface {
5 | Table() Table
6 | Init(buf []byte, i UOffsetT)
7 | }
8 |
9 | // GetRootAs is a generic helper to initialize a FlatBuffer with the provided buffer bytes and its data offset.
10 | func GetRootAs(buf []byte, offset UOffsetT, fb FlatBuffer) {
11 | n := GetUOffsetT(buf[offset:])
12 | fb.Init(buf, n+offset)
13 | }
14 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "google/flatbuffers",
3 | "type": "library",
4 | "description": "FlatBuffers for PHP",
5 | "keywords": ["google", "flatbuffers", "serialization"],
6 | "homepage": "https://github.com/google/flatbuffers",
7 | "license": "Apache-2.0",
8 | "require": {
9 | "php": ">=5.4"
10 | },
11 | "require-dev": {
12 | },
13 | "autoload": {
14 | "psr-4": {
15 | "Google\\FlatBuffers\\": "php"
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/tests/FlatBuffers.Test/NetTest.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Testing C# on Linux using Mono.
4 |
5 | mcs -out:fbnettest.exe ../../net/FlatBuffers/*.cs ../MyGame/Example/*.cs FlatBuffersTestClassAttribute.cs FlatBuffersTestMethodAttribute.cs Assert.cs FlatBuffersExampleTests.cs Program.cs ByteBufferTests.cs FlatBufferBuilderTests.cs FlatBuffersFuzzTests.cs FuzzTestData.cs Lcg.cs TestTable.cs
6 | ./fbnettest.exe
7 | rm fbnettest.exe
8 | rm Resources/monsterdata_cstest.mon
9 |
10 |
--------------------------------------------------------------------------------
/tests/MyGame/Example/Any.go:
--------------------------------------------------------------------------------
1 | // automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | package Example
4 |
5 | const (
6 | AnyNONE = 0
7 | AnyMonster = 1
8 | AnyTestSimpleTableWithEnum = 2
9 | AnyMyGame_Example2_Monster = 3
10 | )
11 |
12 | var EnumNamesAny = map[int]string{
13 | AnyNONE:"NONE",
14 | AnyMonster:"Monster",
15 | AnyTestSimpleTableWithEnum:"TestSimpleTableWithEnum",
16 | AnyMyGame_Example2_Monster:"MyGame_Example2_Monster",
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/tests/MyGame/Example/Color.java:
--------------------------------------------------------------------------------
1 | // automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | package MyGame.Example;
4 |
5 | public final class Color {
6 | private Color() { }
7 | public static final byte Red = 1;
8 | public static final byte Green = 2;
9 | public static final byte Blue = 8;
10 |
11 | public static final String[] names = { "Red", "Green", "", "", "", "", "", "Blue", };
12 |
13 | public static String name(int e) { return names[e - Red]; }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.java:
--------------------------------------------------------------------------------
1 | // automatically generated by the FlatBuffers compiler, do not modify
2 |
3 | package NamespaceA.NamespaceB;
4 |
5 | public final class EnumInNestedNS {
6 | private EnumInNestedNS() { }
7 | public static final byte A = 0;
8 | public static final byte B = 1;
9 | public static final byte C = 2;
10 |
11 | public static final String[] names = { "A", "B", "C", };
12 |
13 | public static String name(int e) { return names[e]; }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/docs/footer.html:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |