Commit Graph

48 Commits

Author SHA1 Message Date
mustiikhalil a5175c513a
Implements verifier and code gen for swift (#6373)
Updates test cases on linux

Adhere to new protocol naming

Adds fuzzing

Adds documentation

Adds support for string unions

Updated fuzzer generated code
2021-05-14 20:59:28 +03:00
Wouter van Oortmerssen a9a295fecf More missing version changes 2021-05-10 11:45:16 -07:00
Wouter van Oortmerssen 42ca1b9140 Swift/Kotlin generated code version updates
Change-Id: I035163cb5edd087a190bb518e686c79887241383
2021-05-10 11:30:26 -07:00
mustiikhalil 4ccc52c7a0
[swift] Implements union strings (#6589) 2021-04-24 14:47:24 +03:00
Casper 261cf3b204
Default-empty vectors of enums (#6505)
* disable clippy

* Vector of enum default

* swift and tests

* git clang format

* Rewrite enum parser checks

* Remove Voids from more_defaults

* vector enum swift

* remove vector accessor from swift

* clang format

Co-authored-by: Casper Neo <cneo@google.com>
2021-04-06 07:23:45 -04:00
Casper 4133a39df8
Rust structz (#6539)
* Rust structz

* struct of structs test

* swift tmp variables

Co-authored-by: Casper Neo <cneo@google.com>
2021-03-29 19:56:45 -04:00
mustiikhalil fc4fffea41
Bump grpc to 1.0.0 (#6507)
Adds void to keywords
2021-03-09 10:56:06 +03:00
mustiikhalil b5da526e6d
[Swift] Moves grpc example to grpc/examples (#6479)
Updates generated Code

Removes grpc generation code from tests dir

Small fix to generate.sh
2021-02-20 23:07:48 +03:00
mustiikhalil e2f5438ac1
Fixes grammer (#6477)
Updates docs
2021-02-19 12:16:38 -08:00
mustiikhalil ae603b9770
[Swift] adds support for default vectors and strings (#6461)
Small fix

Adhere to the new protocol names
2021-02-19 12:47:28 +03:00
mustiikhalil a20f606c29
[Swift] Renaming protocols (#6469)
* Renaming protocols

* Updates Generated code

* format code
2021-02-16 14:55:47 +03:00
mustiikhalil 815d3e820d
Upgrade swift grpc to alpha 24 (#6439)
Upgrade swift grpc to alpha 24
2021-02-04 02:01:18 +03:00
Vladimir Glavnyy 83ce29cc22
[C++, JSON] Fix nullptr access when reading a key with a default value. (#6375)
This commit fixes handling of default and NULL `key` fields in `Parser::ParseVector` (#5928).

The JSON generator updated. It outputs `key` fields even if the `--force-defaults` option is inactive.

Additional test cases for `key` added.
2021-01-07 11:24:59 -08:00
mustiikhalil 44cf2bde19
Updates license date to 2021 (#6378) 2021-01-02 11:46:46 +03: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
mustiikhalil 537212afee
[Swift] Adds a format file and reformats the swift project (#6250)
* Formats files & adds licence

* Revert arrays

* Keeps array indentation as is

* Adds licence to code formatter

* Updates code generators
2020-11-16 19:52:38 +03:00
Casper 46a8c7e958
Added required-nested-flatbuffer to monster_test and fixed rust (#6236)
Co-authored-by: Casper Neo <cneo@google.com>
2020-11-05 13:58:06 -08:00
Paulo Pinheiro 1606fb6375
Kotlin test optional enum (#6201)
* Add test for optional enums in Kotlin

* Rename optional_scalars2.fbs into optional_scalars.fbs

Also updated all references in the project to point to
"optional_scalars.fbs" instead of "optional_scalars2.fbs".
2020-10-22 13:36:02 -07:00
mustiikhalil 7b9e61fccf
[TS] GRPC Implementation (#6141)
* GRPC implementation for Typescript

* Fixes a couple of issues

* Finished implementing the typescript support for grpc

* Updated generated code

* Fixes CI
2020-10-07 09:56:30 -07:00
mustiikhalil 5975658ebd
Enables optional enums in swift (#6160)
[Swift] Enables optional enums
2020-10-06 19:00:14 +03:00
Vladimir Glavnyy 8c67b5b129
Add support of Optional<T> scalars to C++ code generator (#6092) 2020-09-18 12:51:17 -07:00
mustiikhalil e1be8aaadd
Bump version for latest swift version (#6121) 2020-09-17 12:28:42 -07: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
Casper c75ae24293
Optional-ness in reflection (#6097)
* Optional scalars in reflection

* fixed name collision

* Remove code duplicated by merge

Co-authored-by: Casper Neo <cneo@google.com>
2020-09-11 14:20:32 -07:00
mustiikhalil eeacc53d22
Adds proper access types for swift object api & flatbuffers & grpc (#6081)
Fixes accessor in greeter.swift

Small fix for ci
2020-08-22 22:39:09 +03:00
mustiikhalil 63cc0eec4e
Adds a serialize helper function to native table (#6059)
* Adds a serialize helper function to native table
* Updated version
2020-08-04 13:53:40 +03:00
Liu Liu a0fb30575c
[Swift] Append namespace for Swift Grpc implementation (#6049)
* [Swift] Append namespace for Swift Grpc implementation
* Separate ServiceName from ServiceQualifiedName.
2020-07-31 10:07:45 +03:00
mustiikhalil f1025b2847
[Feature] Checks for Nullable strings (#6050)
* Allows null strings in createString method c#

* Adds nullable strings to JS and swift

* Changes js checks

* Fixes typo
2020-07-27 09:57:50 -07:00
Liu Liu 5d052f4e55
[Swift] RFC: Switch Swift namespace from public enum to ordinary concat with _ (#6045)
This PR attempts to switch namespace from public enum back to ordinary
concat with _ in Swift. This kept style similar with protobuf, but
different from other popular style guide in Swift.

This is needed because previously, when we do `public enum`, we don't
really know when to declare and when to extend (extension). With namespace
implementation in this PR, there is no such ambiguity.
2020-07-27 11:06:11 +03:00
mustiikhalil d76e93f277
adds code gen for optional scalars in swift (#6038)
Adds swift test code

Replaces if statments

Adds swift to supported languages for optionals

Moved std::string to auto

Adds nullable scalars support in object api
2020-07-25 17:59:34 +03:00
mustiikhalil ff1b73128d
[Swift] Optional Scalars Preparation (#6028)
* Perpares swift to take optional scalars + adds optional string helper method + disables linters in generated code

* Small fix for generated code

* Update grpc support to alpha 17 for swift
2020-07-20 20:38:50 +03:00
mustiikhalil 37a5dee105
Code cleanup + updates test and readme (#6004)
Updates Readme + adds asserts

Fixes documentation
2020-06-30 21:37:43 +03:00
Liu Liu e810635eaa
[Swift] FlatBuffers createMonster method doesn't treat struct properly (#5992)
* [Swift] FlatBuffers createMonster method doesn't treat struct properly

This PR fixed a issue where a struct is not treated properly when use
create inside.

A example would be the pos inside Monster. The createMonster method
takes an Offset for pos. However, FlatBuffersBuilder.add(struct:)
doesn't really take Offset argument. That means we don't really add a
struct at all for Monster.

It will show up as the pos never set.

This doesn't show up in FlatBuffersMonsterWriterTests.swift because it
implements its own createMonster method, which happens do the dance
properly (i.e. first call create(struct) and then immediately call
add:).

This PR modified the `add(pos:)` interface such that it takes the
UnsafeMutableRawPointer directly, calling `create(struct:)` under the hood.

I can add unit tests once the direction of this PR approved.

* Fix object api pack method codegen.

* Add unit tests that uses Monster.createMonster method to serialize.

* Updated sample_binary.swift
2020-06-28 12:36:55 +03:00
Liu Liu f35184aef9
[Swift] Add parsing from unowned UnsafeMutableRawPointer for ByteBuffer (#5981)
* RFC: Add ExternalStorage for ByteBuffer in Swift implementation

This PR proposed one more API for ByteBuffer such that no copy is
required to parse FlatBuffers content. This API has limited use, but for
cases that you need to read part of the flatbuffers' data to decide
whether you want to parse / copy the full buffer out, it is useful.

* Use a variable rather than protocol.

* Revert grouping changes from the other PR.

* Add unit test to read from unowned UnsafePointer.

* Manifest changed.
2020-06-22 17:05:36 -07:00
mustiikhalil 7cb4762a61
[Swift] Improving reallocation time by using memcpy and moving reallocation code to storage (#5960)
Removes stride

Use capacity - current size to initialize

Fixes memory leak

Updated test code for linux
2020-06-11 08:53:32 -07:00
mustiikhalil 108e981dbe
Required is now implemented in swift (#5952) 2020-06-08 10:08:16 -07:00
mustiikhalil 666800da36
Adds bool support in structs + updates grpc support + CI upgrades (#5943) 2020-06-04 09:14:18 -07:00
mustiikhalil 870ecbc09a
[swift] Moves code to use VTablesStorage (#5888)
* Moves the code to use _vtablestorage

Rebuilt the test to confirm to the new API

Adds documentation + generates code for grpc

Reverts indentation

v0.4.0

Updated swift/readme.md

Updates VtableStorage to ensure space instead of reallocating each time

Fixes str count not being correct

* Fixes issue with boolean constant not being set + removes unused function
2020-05-07 12:28:42 -07:00
mustiikhalil cb4d0f72e3
[Swift] Object API support (#5826)
* Adds Object-api support to swift

* Fixed indentation issues

* Removed indentation within namespaces
2020-04-13 09:28:56 -07:00
mustiikhalil a83caf5910
Improves performance for the swift library by using structs + a storage class (#5835) 2020-04-02 12:55:30 -07:00
Wouter van Oortmerssen 6df40a2471 pre-tag version bump for 1.12
Change-Id: I84a9365e9d8a1afe333b1df85058401ffe0a6b7c
2020-03-12 15:33:39 -07:00
mustiikhalil 34305c4ce4
[Swift] Adds GRPC to Swift (#5758)
* Adds the basic structure for required to add grpc support

Added the message implementation

Updated the code to confirm to the protocol flatbuffersobject

Adds an example for Swift flatbuffers GRPC

Started implementing the swift GRPC code Gen

Generator generates protocols now

Fixing ci issues

Migrated the logic to use grpc_generator::File instead of string

Refactored swift project

Implemented GRPC in swift

Finished implementing GRPC in swift

Fixes issues

Adds contiguousBytes initializer to swift

Adds documentation + fixes buffer nameing in tables + structs

Adds documentation + fixes buffer nameing in tables + structs

Updated tests

* Updated version
2020-02-24 09:27:41 -08:00
mustiikhalil c580fa284c Adds min and max, comments, and all of swift's keywords + fix docs (#5737) 2020-01-27 10:05:41 -08:00
mustiikhalil 316d7c2089 Creates a flatbuffers validation function + small fix (#5725) 2020-01-24 14:55:57 -08:00
vkill 7cdfc8475e [Swift] Fix padding function overflow when bufSize is 0 (#5721)
* [Swift] Fix padding function overflow when bufSize is 0

[Swift] Generate linuxmain

* [Swift] Using the overflow addition operator to resolve integer overflow
2020-01-24 09:45:19 -08:00
vkill c4b2b0a25d [Swift] Support create long string (#5709)
* [Swift] Support create long string

* [Swift] Move the test case to correct dir
2020-01-16 12:08:59 -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