Commit Graph

480 Commits

Author SHA1 Message Date
Jeremie St-Amand ad3ebb110b Follow Google code standards 2015-06-14 13:04:04 -04:00
Jeremie St-Amand 929105432c Namespace now optional for general generator
If you have a schema with no namespace, the resulting C#/Java won't have
an erroneous empty namespace keyword.
2015-06-14 12:56:48 -04:00
Amol Deshpande 40fffc8fff fix code formatting and bug with losing enums when using --gen-onefile 2015-06-13 08:55:24 -07:00
Amol Deshpande 2f76141813 option to generate one file for C# 2015-06-06 19:35:12 -07:00
Wouter van Oortmerssen 932b22f043 Added clang & OS X to .travis 2015-05-27 18:32:49 -07:00
Wouter van Oortmerssen ecf5a6a580 Added --defaults-json to output fields at default value.
Normal behavior is to not output fields that happen to have
the default value, since those will be reproduced anyway
when turned into a FlatBuffer binary. This however can be problematic
when using JSON to interop with other system since they might not
know this default value. This flatc option (and also flag
to GenerateText) will force those fields to be output anyway.

Tested: on Linux.
2015-05-27 16:42:15 -07:00
Wouter van Oortmerssen 788acb08d4 Added GitHub link to start of documentation page. 2015-05-27 15:21:10 -07:00
Wouter van Oortmerssen ddb1d5ffe4 Added a #define for running tests without file access.
Change-Id: Ib2b7aa8a5641cf73fa0d6f2000db7fdd1aabab66
Tested: on Linux.
2015-05-27 14:00:08 -07:00
Wouter van Oortmerssen 7ba29dbe41 Small readability improvements to recent commits.
Change-Id: I290c33c475f7b019ab0d3c571245d27351d22fa1
Tested: on Linux.
2015-05-20 16:21:22 -07:00
Wouter van Oortmerssen 3b070310f0 Fixed -Wunused-result warning.
Change-Id: Iea5fab66047ac0a5057a743dbb1fdb27c063188c
Tested: on Linux.
2015-05-20 16:21:22 -07:00
Wouter van Oortmerssen fbe085601b Java: Allow access to the underlying ByteBuffer from a table.
Change-Id: Id268e35de207c25c809a09071b81eea873c9123e
Tested: on Linux.
2015-05-20 16:21:22 -07:00
gwvo 36f9b1ec91 Merge pull request #207 from zachreizner/header
Add include for cstdlib for std::bsearch definition
2015-05-20 15:01:53 -07:00
Zach Reizner 7bcd99451f Add include for cstdlib for std::bsearch definition 2015-05-20 14:54:20 -07:00
Robert 2535a3aa3a Merge pull request #206 from rw/go-faster-string-writing
Go: CreateString now needs zero allocs.
2015-05-20 14:37:53 -07:00
rw 0894c25f2c Improve comment for unicode check. 2015-05-20 14:19:49 -07:00
rw 7810fb9ce4 use escape codes here for non-unicode editors 2015-05-20 13:42:51 -07:00
rw c127cf78c2 Go: CreateString now needs zero allocs.
Big speed boost for the typical use case of building with strings.
2015-05-20 12:00:44 -07:00
gwvo 6fffa2a14d Merge pull request #198 from zulli73/master
Fixed endianness Vector's begin() and end()
2015-05-20 09:30:10 -07:00
gwvo 2b02d330fd Merge pull request #205 from zachreizner/fb_bsearch
Use std::bsearch in LookupByKey for binary search
2015-05-18 17:36:51 -07:00
Zach Reizner c8f1682e07 Use std::bsearch in LookupByKey for binary search 2015-05-18 17:29:51 -07:00
gwvo f64e040896 Merge pull request #201 from rw/python-docs-and-packaging
Update Python docs and package description
2015-05-18 09:33:30 -07:00
rw 339376ba67 Regenerate Doxygen docs to add Python usage page. 2015-05-15 12:23:10 -07:00
rw 7a1b77322b Update Python package description: license, descriptions. 2015-05-15 12:20:20 -07:00
Wouter van Oortmerssen 60b6ca5850 fixed xcode build files 2015-05-13 17:45:20 -07:00
Wouter van Oortmerssen b8681d8031 fixed the windows build files 2015-05-13 17:26:20 -07:00
Robert f8139b05cb Merge pull request #112 from rw/python23-read-write-gen-port
Port FlatBuffers to Python.
2015-05-13 11:20:09 -07:00
rw 776c4eb965 use EnsureDirExists from util.h instead of mkdir 2015-05-13 10:54:02 -07:00
rw 2746aabcf1 fix string catenation 2015-05-13 10:50:47 -07:00
Raphael Zulliger 04a06781f5 Fixed endianness Vector's begin() and end() 2015-05-13 16:25:56 +02:00
rw 48dfc69ee6 Port FlatBuffers to Python.
Implement code generation and self-contained runtime library for Python.

The test suite verifies:
  - Correctness of generated Python code by comparing output to that of
    the other language ports.
  - The exact bytes in the Builder buffer during many scenarios.
  - Vtable deduplication correctness.
  - Edge cases for table construction, via a fuzzer derived from the Go
    implementation.
  - All code is simultaneously valid in Python 2.6, 2.7, and 3.4.

The test suite includes benchmarks for:
  - Building 'gold' data.
  - Parsing 'gold' data.
  - Deduplicating vtables.

All tests pass on this author's system for the following Python
implementations:
  - CPython 2.6.7
  - CPython 2.7.8
  - CPython 3.4.2
  - PyPy 2.5.0 (CPython 2.7.8 compatible)
2015-05-12 15:40:29 -07:00
Robert 4d213c2d06 Merge pull request #165 from rw/go-faster
Go speed improvements
2015-05-12 14:53:31 -07:00
gwvo 361bfb6764 Merge pull request #189 from pjulien/188
Issue #188
2015-05-11 14:07:40 -07:00
gwvo 3f96eead4c Merge pull request #192 from Jiboo/fix190
Added a default constructor for Java's FlatBufferBuilder.
2015-05-11 13:59:22 -07:00
Wouter van Oortmerssen 8896587faf Fixed schemas inheriting namespace from included schemas.
Change-Id: Ib561430b235eddf4bfe20f68409e1dfdb359ef2b
Tested: on Linux.
2015-05-11 10:55:22 -07:00
Jean-Baptiste "Jiboo" Lepesme 9fa3e2f387 Added a default costructor for Java's FlatBufferBuilder.
Default's size of 1024b like in cpp. Fixes #190.
2015-05-11 19:17:01 +02:00
rw e5c21ec666 invoke many fewer growth events 2015-05-09 16:32:26 -07:00
rw e11da87a24 gofmt 2015-05-09 16:10:03 -07:00
rw 3dd54424c0 remove remaining allocs during build 2015-05-09 16:07:11 -07:00
rw 5d68493df4 update CheckClash for string accesses 2015-05-09 15:37:13 -07:00
pjulien d322eec3c3 Issue #188
When accessing the array directly of a byte buffer, need to offset
by ``arrayOffset``
2015-05-09 14:08:28 -04:00
Mormegil 221193eaa2 Union accessors in C# should use generic type for the table
When accessing a union field, we should return the same object type
as was given to the method, i.e. the parameter should have a generic
type for any Table-derived type. This way, we do not need to make
superfluous casts (which also reduce type safety) like

var myUnionType = (MyUnionType)buff.GetUnionField(new MyUnionType());

when we can do just
var myUnionType = buff.GetUnionField(new MyUnionType());

Change-Id: Idac1b638e46cc50b1f2dc19f10741481202b1515
2015-05-08 16:21:54 -07:00
pjulien f7d24f60a2 set version for next dev cycle
Change-Id: I17a7896e257c0ab7e4cd1b22c928d4cee21fbf11
2015-05-08 16:21:54 -07:00
pjulien e5a1a3129d Initially discussed in #178.
Allows adding an already encoded UTF-8 string directly without
having to convert to a ``String`` first.

Change-Id: I23f9c738eec18fd35f4c14f58dbd0f6cf0970dc7
2015-05-08 16:21:54 -07:00
Wouter van Oortmerssen 39833d7cf0 Added namespaced way to refer to types in schemas.
Also made proper namespacing work for enums.

You can now say namespace.MyTable as the type when declaring
a field that refers to a type in a different namespace.

Previously, it would work just referring to MyTable, however
with the recent commit fixing namespaced types this now
is ambiguous.

Change-Id: Ieaa3f4ac1662b8c4dc1f16e1898ea3cdb02e10fd
Tested: on Linux.
2015-05-08 16:21:53 -07:00
Brett Cooley ecb27817ca Merge "Initial support for propagating namespaces from schema files to generated code" into ub-games-master 2015-05-08 19:52:54 +00:00
Jason Sanmiya f59bfdd084 Add missing newline in help text for flatc.
Tested: Help text displays correctly now.
Change-Id: Ibbdc810ae41e24321860879064bdc64f78a67cb9
2015-05-07 10:30:34 -07:00
Mormegil 0ee1b99c5d [BREAKING CHANGE] Field accessors should use property getters in C#
In C#, plain field accessors should not be nonparametric methods
but should be standard property getters.

The accessor methods with parameters were renamed to `GetXxx`
because a method cannot be named identically to a property.

Also, `ByteBuffer.Position`, `FlatBufferBuilder.Offset` and
`FlatBufferBuilder.DataBuffer` are now properties instead
of nonparametric accessor methods, for more idiomatic C# style.

This is a breaking change, all client C# code accessing these
fields needs to be changed (i.e. remove those `()` or add the
`Get` prefix).

Issue: #77
Change-Id: Iaabe9ada076e5ea2c69911cf6170fdda2df3487e
2015-05-06 11:55:07 -07:00
yinlei a50711ad13 Fix u_int8_t to uint8_t
Change-Id: I475ef9454f51f1b7ec2a7f9086d711359456677a
2015-05-06 11:29:07 -07:00
Brett Cooley 249f71a12b Initial support for propagating namespaces from schema files to generated code
Change-Id: Ifc10c54845ea7553586d1896d509314d68e9ab0f
2015-05-05 17:10:53 -07:00
Wouter van Oortmerssen 1d138fbe07 Merge "Added extra checks for reading binaries in flatc" into ub-games-master 2015-05-04 21:02:00 +00:00