Commit Graph

132 Commits

Author SHA1 Message Date
Wouter van Oortmerssen 0ce53c96c3 Clarified note on multi-threading in the docs.
Change-Id: Ib36ec71aab02fc66d2a6d0c916ebfa4dd1d0d02f
2014-11-19 11:06:17 -08:00
Jon Simantov d6f70cdd7d Fix FlatBuffersTest build on Android by adding missing file.
Change-Id: I5333d45ac43cbba61473bd8ba5b44aedb696a25c
Tested: FlatBuffersTest now builds on Android under Windows.
2014-11-19 10:57:34 -08:00
Zbigniew Mandziejewicz 07d5965c81 Fixes #90 - flatc chokes on IDL files starting with a comment
Change-Id: I5ab692ceb6809493720c1bff69a2e3210efd4618
2014-11-07 16:21:20 -08:00
Wouter van Oortmerssen 6ca102e413 Made the memcmp address sanitizer clean.
Added extra check to ensure memcmp gets called with a size that is
guaranteed within range of the buffer. This wasn't a real problem,
but stops address sanitizer from complaining.

See:
https://github.com/google/flatbuffers/issues/88
517506b4e1 (commitcomment-8265231)

Change-Id: I7de24da2d36d973e154f92eeb3e093070886037f
Tested: on Linux
2014-11-07 15:24:22 -08:00
Wouter van Oortmerssen 8ef6ee2a3e Fixed required field checking incorrectly using unsigned offsets.
Reported by: https://github.com/google/flatbuffers/issues/99

Change-Id: Ia26da95bbac189836c257fa85f3bec1b153b6207
Tested: on Linux.
2014-11-07 14:36:49 -08:00
Luna 118abc2871 Fix a build error on 32 bit go
Change-Id: Iac5894fd8f56da7e420714558a94d63d4fea2d72
2014-10-29 10:42:10 -07:00
Wouter van Oortmerssen fbcf063401 Fixed boilerplate copyright message in LICENSE.txt
Change-Id: I85e8a6bf2fd1ce04271e8afc5083fd47502e5075
2014-10-27 17:48:29 -07:00
Wouter van Oortmerssen e97f38e53c Added support for custom allocators and uninitialized vectors.
This is helpful working with zero-copy use cases.

Bug: 15779698
Change-Id: I7097651ca9a432b5021b4e024da86398d1413ec7
Tested: on Linux and Windows.
2014-10-24 16:21:36 -07:00
Wouter van Oortmerssen 4cdf3eb19b Made CMakeLists.txt compatible with older versions of CMake.
By replacing DIRECTORY by PATH:
http://www.cmake.org/cmake/help/v3.0/command/get_filename_component.html

Change-Id: I6f5802deeda53dea443b255294235e43e7bb5389
Tested: on Linux.
2014-10-24 14:58:32 -07:00
Wouter van Oortmerssen ea592296b8 Various documentation improvements.
Change-Id: Iacea45ae0f602f49e46de472286a7a77ee20c301
2014-10-24 14:58:32 -07:00
Wouter van Oortmerssen d426890b92 Fixed big-endian issue.
Noticed a memory read that isn't big-endian safe. Was somewhat
benign in that it would have simply caused vtable duplication
when constructing a FlatBuffer on a big-endian machine.

Change-Id: I5de3a2bb3ce6912fdd845ed40668719794920cac
2014-10-22 13:35:24 -07:00
Wouter van Oortmerssen 1e4d28bf14 Fixed missing files in Xcode project.
Change-Id: I3480de9157fd6d0eeb123e77e448bd57c75c74ad
Tested: on OS X
2014-10-22 11:58:54 -07:00
Wouter van Oortmerssen 0eac15c784 Added fenced code blocks to the C++/Java/Go docs for syntax highlighting.
Change-Id: I504915c6b5367e8c05dc056463158b8420ad8c5e
Tested: on Linux.
2014-10-15 17:42:31 -07:00
Wouter van Oortmerssen d38b9af243 Added .proto parsing and convertion to .fbs.
Bug: 15777858
Change-Id: Iabef9b8c8044e593bb89510feebdee00d2f1840b
Tested: on Linux and Windows.
2014-10-15 17:42:31 -07:00
Wouter van Oortmerssen 18cf19f876 Fixed bug in convenient constructors for Java/C#
Also fixed Go unit tests not being up to date with recent schema
changes.

Change-Id: I42e619f9c5ea05f6f937c68a5c8a92462c46bce3
Tested: on Linux and Windows.
2014-09-25 15:53:56 -07:00
Gabriel Martinez 730c0cadde Output multiline doc comments over multiple lines
Tested: on Linux

Bug: 15779934
Change-Id: I6f822f1705e443d8721ea208dcb021aad3c8715c
2014-09-25 11:17:53 -07:00
rw ef03cf46e4 Fix vector of strings for Go
Mirrors Java patch 39d4b7e2bf

Change-Id: If8d0ab29f6eb508a156d468aeb0a9d5410149e53
2014-09-23 17:25:50 -07:00
Wouter van Oortmerssen 7b8053570e Enums in C++ are now strongly typed.
Accessors and constructors now take enum types rather than ints.

Bug: 16570507
Change-Id: I4b50fd64ad2e662ea2481bc0ccea784326fb31c0
Tested: on Linux and Windows.
2014-09-23 17:25:50 -07:00
Wouter van Oortmerssen 85c9c83844 Made flatc error messages look like what other compilers output.
Looks like MSVC on Windows and like gcc everywhere else.
For enhanced IDE clickability.

Bug: 17208371
Change-Id: Ie3e02658fccd3edfd464b4bacf4bc68c613a8570
Tested: on Linux and Windows.
2014-09-23 17:19:01 -07:00
Wouter van Oortmerssen 30642c5a6f Added option to flatc to generate dependent header statements.
Bug: 17322776
Change-Id: I3a4d3cb4ccd40bc3200a87653aa0ab8ecb90ce60
Tested: on Linux.
2014-09-23 14:13:35 -07:00
Wouter van Oortmerssen 517c964fe2 Support for required fields.
Change-Id: I560c7ca11b3d665eecafb528f3737b7e139ca9b0
Tested: on Linux and Windows.
2014-09-22 15:53:19 -07:00
Zbigniew Mandziejewicz 3f8700b296 Generate headers from spec, add option for installing targets
Change-Id: I16ddb06e887e618fa871e842054115909fbf235c
2014-09-22 15:53:19 -07:00
Gabriel Martinez 048638a971 Add enum name lookup method to Java/C# enums
Tested: on Linux for Java and C#

Bug: 15781151
Change-Id: I7cb97bcc01d986cac2b24aaf7cb29521ddaa2f6b
2014-09-22 15:10:48 -07:00
Wouter van Oortmerssen d6ed127cf4 Added convenient create functions for Java/C#.
Bug: 15777857
Tested: on Linux and Windows.

Change-Id: I25db724349e2c801bb0e41137540507acd57cd03
2014-09-19 13:51:33 -07:00
Wouter van Oortmerssen bdaedebef9 Added general codegen to Xcode project.
Change-Id: I5e21a08fe4b93382e5fbc3b911de5634b7aa88b9
Tested: on OS X.
2014-09-18 15:26:49 -07:00
Wouter van Oortmerssen 557c88c039 Refactored the Java and C# code generators into one.
Also made the C# implementation support unsigned types, and
made it more like the Java version.

Bug: 17359988
Change-Id: If5305c08cd5c97f35426639516ce05e53bbec36c
Tested: on Linux and Windows.
2014-09-18 12:29:31 -07:00
Wouter van Oortmerssen d01b30cdd6 Added C# generator to Xcode project.
Change-Id: I54ce51f16043664d706a79d1b31f2569f3311b70
Tested: on OS X
2014-09-16 16:40:30 -07:00
Wouter van Oortmerssen c01c77a7f2 Prepended com.google to the Java namespace.
Bug: 16507831
Change-Id: I5beee18f63f174e425dc1ab395807b578d5f9477
Tested: on Linux.
2014-09-15 17:45:15 -07:00
Wouter van Oortmerssen 0a549e3875 Added missing assert.h to util.h.
This was only causing compiler errors on certain compiler configurations.

Change-Id: I110fb8c896f74aae7ef739e9a29c636393dbbde2
Tested: on Linux and Windows.
2014-09-15 16:27:21 -07:00
Wouter van Oortmerssen e57b86bb9f The parser and flatc now allow include directories to be specified.
Bug: 17139854
Change-Id: I0eac65d054951e00a8811ad1d80ba8c37012dbf0
Tested: on Linux.
2014-09-15 16:19:27 -07:00
Wouter van Oortmerssen cb58fc6fa1 Added convenient vector from array construction for Java.
Change-Id: Ib3fd576cf9fa4b4058a9fd1bbe24a0859bc3917a
Tested: on Linux.
2014-09-15 16:19:27 -07:00
Wouter van Oortmerssen 858e9961e2 Added accessor in Java to get vectors as ByteBuffers.
Also cleaned up ByteBuffer usage in general: ByteBuffer.position
now universally indicates the start of a ByteBuffer.

Change-Id: Ic4bfb98f9df9501b8fc82de2c45db7d7311135ac
Tested: on Linux.
2014-09-15 16:19:26 -07:00
Wouter van Oortmerssen 32f2c1c3b9 Fixed test that was incompatible with 64bit offsets.
Change-Id: I35984d0ab3e849bec6cdaa364a39f66f2c37b4d0
Tested: on Linux.
2014-09-15 16:13:49 -07:00
bml13 e14bc1d9ac Removed the use of b.array() to support DirectBuffers.
Also removed Table extend Constants.

Change-Id: I1770b613c58094fa572a3b26a31f01bd5fb8fdbf
2014-09-15 16:13:49 -07:00
evolutional 9a1f7be6fd Initial commit of .NET port of FlatBuffers
Include C# codegen in flatc and .NET FlatBuffer access via the
FlatBufferBuilder class

Tested: on Windows.

Change-Id: If5228a8df60a10e0751b245c6c64530264ea2d8a
2014-09-15 16:13:27 -07:00
Stewart Miles 3f85183c88 Added option to disable build of tests and samples.
Added FLATBUFFERS_BUILD_TESTS option which can be used to disable
the build of flatbuffers tests and samples.

Tested:
Verified tests and samples are no longer built on Linux when
FLATBUFFERS_BUILD_TESTS=OFF.

Change-Id: Ic23ab827849ba2c4481de9ca86adc1ab8e6b828c
2014-09-10 16:01:13 -07:00
Wouter van Oortmerssen 354aad4bc5 Made FlatBufferBuilder.java require ByteBuffers that have an array.
Readonly ByteBuffers and Direct ByteBuffers don't have a backing
array, and thus can't be used for writing FlatBuffers (though
they are fine for reading).

Change-Id: I4d7b9cc222b96161d0f8e92f34588bd3e0e38034
Tested: on Linux.
2014-09-05 13:48:02 -07:00
Wouter van Oortmerssen f57d012a21 Non-alpha-numeric characters are filtered out of include guards
Since part of it is based on the filename, which may contain
characters that are not legal identifiers.

Change-Id: I62b8fe228a434a2040fd4ce47d220fc4d3398b41
Tested: on Linux.
2014-09-05 11:27:03 -07:00
Wouter van Oortmerssen f5e343efba A generated C++ function was missing "inline".
This would cause double definition linker errors when included in
multiple compilation units.

Change-Id: Ie6fd4af018055a099343182a92a7776f2fea4725
Tested: on Linux.
2014-09-05 10:56:16 -07:00
Wouter van Oortmerssen b5edc2dea5 Fixed JSON text output not finding symbolic names for enum value 1.
Change-Id: If3a062926dd86b95fa68ed64fc7ee2de7bc0d930
Tested: on Linux
2014-09-05 10:54:52 -07:00
Wouter van Oortmerssen 09a2999c66 Implemented the file identifier functionality for Java.
Also fixed flatc not outputting these identifiers for files
compiled on the command-line.

Bug: 16983987
Change-Id: I8b714cfea3a8e144fa52133f62b2f7eda6eb044a
Tested: on Linux
2014-09-05 10:54:52 -07:00
Wouter van Oortmerssen 96592d5dbb Made Vector have a size() function, to make it more STL-alike.
Bug: 17316346
Change-Id: I52377b7fa51adccadc4e867d45666e683bc2c1ae
Tested: on Linux.
2014-09-04 17:35:24 -07:00
Wouter van Oortmerssen 84f86be700 Changed hard-coded constant in JavaTest to enum value.
Change-Id: I7d2eac7fed6c36c966670a3e58f4dae7dff25029
Tested: on Linux.
2014-09-04 17:35:24 -07:00
rw 417cb878c3 Fixed possible alignment issue in Go
Java patch with same purpose:
cdb0dca39d

Change-Id: I57d268cc0064843779eb7812a9e69326d9ab2498
Tested: on Darwin
2014-09-04 17:35:08 -07:00
Wouter van Oortmerssen 11f2538610 Made "field set more than once" check in JSON parser faster.
Change-Id: I3ecc1aa610526c270faa56cc5266f14cd81db247
Tested: on Linux.
2014-09-04 16:36:41 -07:00
Wouter van Oortmerssen ea57dfe897 Fixed missing <functional> header (VS).
Change-Id: I89d0f9b18bfe4d27be325c7f7205dee14bc7e1be
Tested: on Windows.
2014-09-03 16:39:22 -07:00
Wouter van Oortmerssen 9f506f57c0 Made sure GetRootAs..() functions are generated for all Java tables.
Previously they were only generated for the root_type, making it
impossible to use the other types in the file as the root of a buffer.

Bug: 17206174
Change-Id: Ie71bed42ac3b22dcceae6385cbd5846c37e5f1b8
Tested: on Linux
2014-09-03 15:34:40 -07:00
Wouter van Oortmerssen 57b614587c Setting a field twice in a JSON object now gives error.
Before, it would crash in FlatBufferBuilder.

Bug: 17357164
Change-Id: I6e6dbada5261745220345379eb53eb3eb113e8f8
Tested: on Linux.
2014-09-03 14:48:37 -07:00
Wouter van Oortmerssen 15dc1a86cd Fixed flatc silently accepting non-scalars as default values.
Bug: 17304016
Change-Id: I4873f8ef32fbb2657f15fc53a2c8f767e10f2d96
Tested: on Linux
2014-09-03 12:23:15 -07:00
Wouter van Oortmerssen 766d0df797 Fixed C++ codegen ignoring multiple padding scalars per field.
Bug: 17373251, 17221979
Change-Id: Ib8b77835f0acd3290f0a5e7d0f683d9fdcbf7230
Tested: on Linux
2014-09-03 11:34:47 -07:00