* Added empty generator for json schema (idl_gen_json_schema.cpp)
#4360
* JsonSchemaGenerator: output of tables implemented
current problems:
- typenames are not correct
- array types need to be deduced
#4360
* JsonSchemaGenerator: Corrected generation of typenames
Current problems: enum types not written correctly
#4360
* JsonSchemaGenerator: Added generation of enum types
#4360
* idl_gen_json_schema.cpp: Write required properties to schema
#4360
* idl_gen_json_schema.cpp: Export Types including namespace
#4360
* idl_gen_json_schema.cpp: Fixed Json format
#4360
* idl_gen_json_schema.cpp: Formatted according to google code style
#4360
* Checked in monster_test.bfbs with changes from master
* Added idl_gen_json_schema.cpp in CMakeLists.txt
* generate_code.bat: Added generation of json schema
* Added todo.md
* generate_code.sh: Added generation of json schema
* Addressed some review issues
- removed command line arg -S
- removed new lines
- fixed codestyle in template functions
- removed usage of stringstream
- idented json schema
#4360
* removed auto in idl_gen_json_schema.cpp
* idl_gen_json_schema.cpp: changed iterator declarations to auto
#4360
* deleted todo.md
* idl_gen_json_schema.cpp: Removed keyword "override" so that vs2010 can compile
* idl_gen_json_schema.cpp: switch statement in GenType handeles all enum-members
* idl_gen_json_schema.cpp: Removed cerr output
* idl_gen_json_schema.cpp: Avoid vector copying
* idl_gen_json_schema.cpp: Fixed identation of json schema output
* idl_gen_json_schema.cpp: Do not output empty descriptions
Changing to keep include prefixes had two side effects: the main
file being parsed wasn't filtered out anymore, and include directory
paths would be added to the path in the include statement.
Also moved the include_test*.fbs files to sub directories so we
can actually test the handling of -I etc.
tested: on Linux.
Change-Id: Ibae095cea7ab0cccbac15cfb5171719f6b5cad8c
* codegen for all basic features: WIP (probably implemented all basic feature)
* JSON parsing: NO
* Simple mutation: NO
* Reflection: NO
* Buffer verifier: NO (will be add later)
* Testing: basic: Yes
* Testing: fuzz: Yes
* Performance: Not bad
* Platform: Supported Linux, OS X, Windows (has 32bit integer limitation)
* Engine Unity: No
flatc --php monster_test.fbs
<?php
//include neccessary files.
$fbb = new Google\FlatBuffers\FlatBufferBuilder(1);
$str = $fbb->createString("monster");
\MyGame\Example\Monster::startMonster($fbb);
\MyGame\Example\Monster::addHp($fbb, 80);
\MyGame\Example\Monster::addName($fbb, $str);
$mon = \MyGame\Example\Monster::endMonster($fbb);
$fbb->finish($mon);
echo $fbb->sizedByteArray();
PHP 5.4 higher
Currently, we do not register this library to packagist as still experimental and versioning problem.
If you intended to use flatbuffers with composer. add repostiories section to composer.json like below.
"repositories": [{
"type": "vcs",
"url": "https://github.com/google/flatbuffers"
}],
and just put google/flatbuffers.
"require": {
"google/flatbuffers": "*"
}
* PHP's integer is platform dependant. we strongly recommend use 64bit machine
and don't use uint, ulong types as prevent overflow issue.
ref: http://php.net/manual/en/language.types.integer.php
* php don't support float type. floating point numbers are always parsed as double precision internally.
ref: http://php.net/manual/en/language.types.float.php
* ByteBuffer is little bit slow implemnentation due to many chr/ord function calls. Especially encoding objects.
This is expected performance as PHP5 has parsing arguments overhead. probably we'll add C-extension.
Basically, PHP implementation respects Java and C# implementation.
Note: ByteBuffer and FlatBuffersBuilder class are not intended to use other purposes.
we may change internal API foreseeable future.
PSR-2, PSR-4 standards.
Implemented simple assertion class (respect JavaScript testcase implementation) as we prefer small code base.
this also keeps CI iteration speed.
we'll choose phpunit or something when the test cases grown.