Commit Graph

60 Commits

Author SHA1 Message Date
mustiikhalil e2f5438ac1
Fixes grammer (#6477)
Updates docs
2021-02-19 12:16:38 -08:00
Kamil Rojewski e6b911d40c
updated JS docs to reflect current status (#6436) 2021-02-19 12:05:02 -08:00
mustiikhalil a72a208272
Update swift docs (#6460) 2021-02-14 10:09:11 +03:00
Richard A Hofer 13d9e35858
Better python generated code naming (#6336)
* Remove a lot of redundancy from the Python generated code.

Update tutorial to reflect new Python generated code.

* Add aliases for newly deprecated Python generated methods.

This should help with backwards compatibility.

* Fix incorrect names in deprecated comments.
2021-01-28 12:35:37 -08:00
mustiikhalil 4e79d129cb
[Swift] Rebuild the way swift handles structs from scratch (#6326)
* Rebuild the way swift handles structs from scratch

* Updates docs, and sample binary

* Replaces InMemory to Mutable

* Migrates docs from inmemory

* use inline for some functions

* Renamed Mutable objects

* Updates documentation
2020-12-17 14:55:32 -08:00
Richard A Hofer f8b203c9c4
Add vectorNumElements attribute to Builder for simpler vector creation. (#6328)
* Add vectorNumElements attribute to Builder for simpler vector creation.

This adds a default to EndVector which should simplify its use.

* Update tutorial to reflect new default arg in Python EndVector.

* Remove optional argument to Python EndVector.

* Add generated files.

* Unset Builder.vectorNumElems when not in use.
2020-12-14 12:00:28 -08:00
Casper 338393f854
Documentation updates for Optional Scalars (#6014) (#6270)
* Documentation updates for Optional Scalars

* Updated Support

* Reword stuff

* s/NULL/null

Co-authored-by: Casper Neo <cneo@google.com>
2020-11-24 14:05:39 -05:00
Kelvin Hu 25eba6f35f
fix typo (#6280) 2020-11-19 09:08:52 -08:00
mustiikhalil 89435303b7
[Swift] Migrates struct write APIS to write directly to the buffer (#6093)
* Migrates struct write APIS to in place APIS

* Fixes indentation in grpc swift
2020-09-17 17:10:59 +03:00
Dimitri Mitropoulos 9abb2ec2cc
TypeScript/JavaScript docs improvements (#5984)
* use correct language formatter for TypeScript examples

* fixes typo in JS/TS copied from PHP (apparently)

the variables are not named with a prefixed `$`

* fixes bizarre line breaks in markdown examples

* fixes snake case typo to fit JS/TS conventions

* makes example of Uint8Array usage explicit

* removes random extra lines between language blocks

* adds simple example for writing to file in node

* typo: flabuffers => flatbuffers

* adds (previously missing) code blocks to TypeScript code block

* adds context about where `monster_generated` comes from

to the uninitiated, a bit of help like this is welcome
2020-06-18 10:23:32 -07:00
Dimitri Mitropoulos 24ad35709d
[docs] typo: updates monsterdata.json to be valid json (#5978)
* updates monsterdata.json to be valid json

the same monster.json file was not valid json

* updates reference to monsterdata.json in docs to also be valid json
2020-06-17 22:35:24 -07:00
Carol (Nichols || Goulding) f94e6c84e0
Small tutorial improvements - documentation only (#5894)
* Use code formatting for a code snippet

* Minor grammar, spelling, and Markdown fixes
2020-05-07 12:15:11 -07:00
mugisoba 7418d85872
[C#] support Object API (#5710)
* [C#] support Object API

* fix sign-compare

* fix indent

* add new line before for loop.

* using auto whenever possible

* reduce the amout of blank lines.

* wip: support vectors of union

* done: support unions of vectors

* set C# version to 4.0
* remove null propagation operator
* remove auto property initializer
* remove expression-bodied method
* remove pattern matching

* add Example2 to NetTest.sh

* separate JavaUsage.md and CsharpUsage.md from JavaCsharpUsage.md

* add C# Object based API notes.

* support vs2010.

* remove range based for loop.

* remove System.Linq

* fix indent

* CreateSharedString to CreateString

* check shared attribute

* snake case
2020-01-30 10:18:28 -08:00
mustiikhalil a4b2884e4e Added create function for swift (#5707)
Fixed the create functions and updated the test cases in swift

Removes unneeded code

Updated documentation
2020-01-13 12:34:06 -08:00
mustiikhalil 04d80f255d [Swift] Swift implementation 🎉🎉 (#5603)
* Implemented the swift version of Flatbuffers

Implemented serailzing, reading, and mutating data from object monster

Fixes mis-aligned pointer issue

Fixes issue when shared strings are removed from table

Adds swift enum, structs code gen

Fixed namespace issues + started implementing the table gen

Added Mutate function to the code generator

Generated linux test cases

Fixed an issue with bools, and structs readers in table writer

Swift docker image added

Updated the test cases, and removed a method parameters in swift

Fixed createVector api when called with scalars

Fixed issues with scalar arrays, and fixed the code gen namespaces, added sample_binary.swift

Cleaned up project

Added enum vectors, and their readers

Refactored code

Added swift into the support document

Added documentation in docs, and fixed a small issue with Data() not being returned correctly

Fixes Lowercase issue, and prevents generating lookups for deprecated keys

* Made all the required funcs to have const + removed unneeded code + fix lowercase func

* Removed transform from lowercased and moved it to function

* Fixes an issue with iOS allocation from read

* Refactored cpp code to be more readable

* casts position into int for position

* Fix enums issue, moves scalar writer code to use memcpy

* Removed c_str from struct function

* Fixed script to generate new objects when ran on travis ci: fix

* Handles deallocating space allocated for structs

* Updated the test cases to adhere to the fileprivate lookup, no mutation for unions, and updated the names of the vector functions
2020-01-09 12:12:10 -08:00
Jason Monschke da88be05e1 Change deprecated vector Length() to size() in tutorial (#5450) 2019-07-25 11:09:40 -07:00
Paulo Pinheiro de9aa0cdee Add basic Kotlin support (#5409)
* [Kotlin] Add kotlin generate code for tests and add
kotlin test to TestAll.sh

* [Kotlin] Add Kotlin generator

This change adds support for generating Kotlin classes.

The approach of this generator is to keep it as close
as possible to the java generator for now, in order
to keep the change simple.

It uses the already implemented java runtime,
so we don't support cross-platform nor js Kotlin yet.

Kotlin tests are just a copy of the java tests.

* Add optional ident support for CodeWriter

Identation is important for some languages and
different projects have different ways of ident
code, e.g. tabs vs spaces, so we are adding optional
support on CodeWriter for identation.

* [Kotlin] Add Documentation for Kotlin

* [Kotlin] Modify generated code to use experimental Unsigned types.
2019-07-22 16:05:15 -07:00
Michael Seifert 4eb3efc221 [flatc][docs] Document rounding behavior of floats in JSON output (#5397)
* [docs] Added an example on how to convert a FlatBuffer binary to JSON
Slightly adjusted section on "Using flatc as a conversion tool".

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* [docs] Updated obsolete JSON data in example showing how to convert JSON to FlatBuffer binaries.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
2019-06-12 12:35:39 +02:00
Ashwin Ramaswami b59a1ca2f8 fix typo (#5384)
* fix typo

* fix typo
2019-06-05 19:24:29 +01:00
aardappel 43dbac5d25 Lobster: added builder API for tables 2019-05-22 19:42:13 -07:00
aardappel 53ea1ab1bd Lobster documentation fixes 2019-05-22 16:01:51 -07:00
Clément Julliard b72a75f87d Doc: use correct ref types for flatcc string creation. (#5305)
Some string definitions were typed as ns(Weapon_ref_t) while they should
be flatbuffers_string_ref_t. Note that the former was also compiling &
running correctly as both ref types boil down to the same underlying ref
type.
2019-04-24 10:34:21 -07:00
Henry Lee 3ff6cdf491 [C++]Sync the sample monster.fbs file with the tutorial (#5277)
* Fix the header file path in the tutorial doc

* Add the path field in sample/monster.fbs to match the tutorial

* Update the lobster sample file

* Update the binary sample file
2019-04-05 12:34:53 -07:00
unexge 5cdbd02404 Fix typo in Go tutorial (#5274) 2019-04-04 12:28:09 -07:00
Ashay Shirwadkar 440a70f4a3 Fixed tutorial markdown file (#5248)
Path specified in tutorial file was pointing to invalid location.
2019-03-21 15:51:51 -07:00
bspeice 3968d00568 [Rust] Don't use inner attributes for `allow` (#5212)
* Don't use inner attributes for `allow`
Messes with being able to easily include elsewhere

* Regenerate tests

* No-op to retrigger CI

* Add the rest of the `allow` attributes
2019-03-09 12:58:27 -08:00
csukuangfj 13c9c674fd [doc] fix typos in doc. (#5217) 2019-02-28 21:39:26 +01:00
csukuangfj 4f32cbf268 Fix an error in cpp code. (#5189)
Change monster_generate.h to monster_generated.h
2019-02-19 20:23:10 +01:00
Robert 3c54fd964b Port FlatBuffers to Rust (#4898)
This is a port of FlatBuffers to Rust. It provides code generation and a
runtime library derived from the C++ implementation. It utilizes the
Rust type system to provide safe and fast traversal of FlatBuffers data.

There are 188 tests, including many fuzz tests of roundtrips for various
serialization scenarios. Initial benchmarks indicate that the canonical
example payload can be written in ~700ns, and traversed in ~100ns.

Rustaceans may be interested in the Follow, Push, and SafeSliceAccess
traits. These traits lift traversals, reads, writes, and slice accesses
into the type system, providing abstraction with no runtime penalty.
2018-09-02 18:26:55 -07:00
aardappel 4898809eca FlatBuffers implementation for the Lobster programming language
Language, see: http://strlen.com/lobster/ and https://github.com/aardappel/lobster
2018-07-29 13:23:00 -07:00
Derek Bailey ba5eb3b5cf Lua (5.3) Language addition (#4804)
* starting Lua port of python implmention. Syncing commit

* Bulk of Lua module port from Python done. Not tested, only static analysis. Need to work on binary strings. Started work on flatc lua code generation

* Fixed all the basic errors to produced a binary output from the builder, don't know if it is generated correctly, but it contains data, so that must be good

* fixed binary set command that was extending the array improperly

* continued improvement

* Moved lua submodules down a directory so their names don't clash with potential other modules. Added compat module to provide Lua versioning logic

* Successful sample port from Python

* working on testing Lua code with formal tests

* continued to work on tests and fixes to code to make tests pass

* Added reading buffer test

* Changed binaryarray implmentation to use a temporary table for storing data, and then serialize it to a string when requested. This double the rate of building flatbuffers compared to the string approach.

* Didn't need encode module as it just added another layer of indirection that isn't need

* profiled reading buffers, optimizations to increase read performance of monster data to ~7 monster / millisecond

* Writing profiler improvments. Get about
~2 monsters/millisecond building rate

* removed Numpy generation from Lua (came from the Python port)

* math.pow is deprecated in Lua 5.3, so changed to ^ notation. Also added .bat script for starting Lua tests

* adding results of generate_code.bat

* simple edits for code review in PR.

* There was a buffer overflow in inserting the keywords into the unorder set for both the Lua and Python code gens. Changed insertion to use iterators.

* fixed spacing issue

* basic documenation/tutorial updates. Updated sample_binary.lua to reflect the tutorial better

* removed windows-specific build step in Lua tests
2018-07-05 15:55:57 -07:00
Polynomdivision 7dbc8f564a docs: fix flatc instructions (#4794) 2018-06-25 14:55:18 -07:00
Wouter van Oortmerssen 27ce09860a Fixed typo in Java/C# tutorial.
Change-Id: I956b27f37b11988e67d0403a596c0569eacbfc2a
2018-05-31 09:53:47 -07:00
Gautham B A 348fcb5b88 Fix typo in tutorial for Go (#4756)
Fixed a typo in serialising the inventory for Orc.
2018-05-31 09:17:34 -07:00
Dan Field 88912640d0 Add [Dart] support (#4676)
* Add [Dart] support

* fix enum vectors

* Allow for opt out of string interning

* fix comment style, make interning opt in

* remove Offset<T>, prefer int

* avoid creating unnecessary vtable objects

* start work on tests - do not generate builder if struct has 0 fields - add int64

* support reading structs properly

* correctly handle reading vectors of structs, dartfmt

* support structs, fix unnecessary prepares

* fix bool customizations

* undo unintentional removal of file

* docs updates, complete tutorial, bug fix for codegen

* more documentation

* Update docs, add to doxygen file

* update package structure, add samples script/code

* rearrange sample

* Tests

* Add readme for pub

* cleanup package for pub

* update docs for renamed file

* remove custom matcher, use `closeTo` instead

* remove unintentional file

* remove unintended file checkin

* use auto, move method, cleanup

* refactor to ObjectBuilders, add Builders

* Update tests, examples

* Add files missing from previous commit

* documentation and example updates

* Update LICENSE, make dartanalyzer happy, fix minor bugs, get rid of duplicate files, publish script

* fix sample for slightly different schema

* Update pubspec.yaml
2018-05-18 11:06:15 -07:00
David Stephan 2e3d3cbcb5 Fix typos in C++ tutorial (#4685)
CreateMonster and MonsterBuilder examples fixed for C++
2018-04-02 09:25:05 -07:00
Kamil Rojewski cc54963830 TypeScript docs (#4680)
* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data

* Not importing flatbuffers for TS test generation

* Not overwriting generated js for tests

* AppVeyor test fixes

* Generating the most strict TS code possible

* Not returning null when creating vectors

* Not returning null from struct contructors

* Vector of unions for ts/js

* Sanity check for languages

* Indentation fix + output test files

* Vectors of unions for php

* Fixes to union vector handling + tests

* Fix for strictPropertyInitialization

* Fix for new aligned operator new for gcc >= 7.1

* Not generating imports/ns prefixes with --gen-all

* TypeScript docs
2018-03-23 09:01:39 -07:00
MikkelFJ 0cf04ad9d5 Document type aliases (#4499) 2017-11-17 08:57:01 -08:00
Dan Douglas fe483fa380 fix typo (#4495)
`Equipment` is a union, not an enum.
2017-11-16 16:03:16 -08:00
Hong Wu 1336d26252 c++ Tutorial fix (#4494) 2017-11-16 10:09:48 -08:00
David Komer e2c7196ea8 tutorial docs (#4492) 2017-11-16 08:51:35 -08:00
Wouter van Oortmerssen f779962e3e Explained GetRoot<Monster> vs GetMonster.
Change-Id: Ic302096c07551b5c1aff0b261a329c46964cf337
2017-08-14 15:34:15 -07:00
Wouter van Oortmerssen 4b27c92910 Misc documentation fixes.
Change-Id: Id7be5baba7d8a11ca050e8d94d95857406690378
2017-08-10 11:25:13 -07:00
Wouter van Oortmerssen 398ae0cb6b Some code in the samples and docs still used old C# API.
Change-Id: I7914c88ad7b31baa7586771423069dc2b90d534f
Tested: on Linux.
2017-05-22 15:14:46 -07:00
Wouter van Oortmerssen 262e1d7bf9 Updated tutorial with a vector of structs example.
Since it wasn't documented and very different from a vector of
tables, this has caused a lot of confusion in the past.

Change-Id: Iab47c61b55c19abe5c4f25c86d71335a6b6321ca
2017-05-15 13:41:27 -07:00
Wouter van Oortmerssen af21b9064d Change docs to not encourage use of 1 byte buffers.
Change-Id: Ib0b1692044f35e374a0f7c0359c94319f4a25619
2016-10-24 10:29:09 -07:00
Wouter van Oortmerssen dae513e0e7 Made nesting vs inline clearer in the docs.
Also fixed structs not being created inline in the tutorial,
which would actually have bad consequences if used.

Change-Id: Idce215c61a1b24a297cee76f625052bb2722e970
2016-10-21 15:22:14 -07:00
Wouter van Oortmerssen f9025eeb52 Clarified tutorial w.r.t reading/writing buffers.
Bug: 30736848

Signed-off-by: Wouter van Oortmerssen <wvo@google.com>
2016-10-12 14:30:31 -07:00
Wouter van Oortmerssen 18d67ed83b Clarified in the docs how to get to the serialized bytes.
This was a frequent source of confusion, since in all implementations
the data doesn't start at offset 0 in the buffer.

Change-Id: I045966e65928e9acd9def84e215914ecb5510653
2016-08-10 17:53:40 -07:00
Wouter van Oortmerssen 91f5cf357c Merge branch 'master' of https://github.com/google/flatbuffers into grpc2 2016-07-20 17:41:36 -07:00