summaryrefslogtreecommitdiff
path: root/src/idl_gen_swift.cpp
AgeCommit message (Collapse)AuthorFilesLines
2021-05-10Updated main version numbers to 2.0Wouter van Oortmerssen1-1/+1
2021-04-24[swift] Implements union strings (#6589)mustiikhalil1-32/+24
2021-04-06Default-empty vectors of enums (#6505)Casper1-2/+4
* 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-03-29Rust structz (#6539)Casper1-2/+2
* Rust structz * struct of structs test * swift tmp variables Co-authored-by: Casper Neo <cneo@google.com>
2021-03-09Bump grpc to 1.0.0 (#6507)mustiikhalil1-0/+1
Adds void to keywords
2021-02-19Fixes grammer (#6477)mustiikhalil1-3/+4
Updates docs
2021-02-19[Swift] adds support for default vectors and strings (#6461)mustiikhalil1-30/+40
Small fix Adhere to the new protocol names
2021-02-17Fix a typo in Swift codegen (#6470)Liu Liu1-2/+3
* Fix a typo in Swift codegen * Fix code formatting.
2021-02-16[Swift] Renaming protocols (#6469)mustiikhalil1-5/+6
* Renaming protocols * Updates Generated code * format code
2021-01-25Refactor FieldDef to model presense as an enum rather than 2 bools. (#6420)Casper1-20/+20
* Define presence. * Migrate to IsRequired and IsOptional methods * moved stuff around * Removed optional and required bools from FieldDef * change assert to return error * Fix tests.cpp * MakeFieldPresence helper * fmt * old c++ compatibility stuff Co-authored-by: Casper Neo <cneo@google.com>
2020-12-17[Swift] Rebuild the way swift handles structs from scratch (#6326)mustiikhalil1-228/+311
* 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-11-16[Swift] Adds a format file and reformats the swift project (#6250)mustiikhalil1-2/+3
* Formats files & adds licence * Revert arrays * Keeps array indentation as is * Adds licence to code formatter * Updates code generators
2020-11-15Adds a fix for enum generation (#6263)mustiikhalil1-1/+0
2020-10-20Mass Refactoring to use `IsString` and other BASE_TYPE helpers (#6193)Casper1-15/+15
* Updated SupportsAdvancedUnionFeatures to look out for string * Mass refactoring to use BASE_TYPE helper functions. Co-authored-by: Casper Neo <cneo@google.com>
2020-10-06Enables optional enums in swift (#6160)mustiikhalil1-4/+9
[Swift] Enables optional enums
2020-09-21Add CharToLower and CharToUpper into util.s (#6126)Vladimir Glavnyy1-6/+2
This commit adds replacement of `::tolower` and `::toupper`. Added CharToLower and CharToUpper routines reduce the number of cast operators that required for correct usage of standard C/C++ `::tolower/toupper` routines.
2020-09-17[Swift] Migrates struct write APIS to write directly to the buffer (#6093)mustiikhalil1-34/+54
* Migrates struct write APIS to in place APIS * Fixes indentation in grpc swift
2020-09-11Optional-ness in reflection (#6097)Casper1-4/+6
* Optional scalars in reflection * fixed name collision * Remove code duplicated by merge Co-authored-by: Casper Neo <cneo@google.com>
2020-09-10Rename Nullable scalars to Optional scalars (#6112)Casper1-11/+11
Co-authored-by: Casper Neo <cneo@google.com>
2020-08-22Adds proper access types for swift object api & flatbuffers & grpc (#6081)mustiikhalil1-50/+75
Fixes accessor in greeter.swift Small fix for ci
2020-08-04Adds a serialize helper function to native table (#6059)mustiikhalil1-20/+26
* Adds a serialize helper function to native table * Updated version
2020-07-27[Swift] RFC: Switch Swift namespace from public enum to ordinary concat with ↵Liu Liu1-93/+48
_ (#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-25adds code gen for optional scalars in swift (#6038)mustiikhalil1-23/+37
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-20[Swift] Optional Scalars Preparation (#6028)mustiikhalil1-13/+21
* 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-06-28[Swift] FlatBuffers createMonster method doesn't treat struct properly (#5992)Liu Liu1-10/+21
* [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-08Required is now implemented in swift (#5952)mustiikhalil1-19/+41
2020-06-04Adds bool support in structs + updates grpc support + CI upgrades (#5943)mustiikhalil1-25/+54
2020-05-07[swift] Moves code to use VTablesStorage (#5888)mustiikhalil1-17/+44
* 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-04-13[Swift] Object API support (#5826)mustiikhalil1-103/+565
* Adds Object-api support to swift * Fixed indentation issues * Removed indentation within namespaces
2020-04-02Improves performance for the swift library by using structs + a storage ↵mustiikhalil1-9/+9
class (#5835)
2020-03-12pre-tag version bump for 1.12v1.12.0Wouter van Oortmerssen1-1/+1
Change-Id: I84a9365e9d8a1afe333b1df85058401ffe0a6b7c
2020-03-02Added --filename-suffix and --filename-ext to flatc (#5778)Derek Bailey1-6/+2
* Fixed refractoring issue in reflection/generate_code.sh. Also, mv deletes the original file, so I don't need to clean it up manually in that case. * Added --filename-suffix and --filename-ext to flatc * Fixed typo and added example generation of suffix and extension for C++ * Removed extra ; * Removed clang-format block from a region that didn't need it. Fixed an auto format of another clang-format block * Added docs, fixed pointer alignment, removed suffix test file
2020-02-24[Swift] Adds GRPC to Swift (#5758)mustiikhalil1-0/+17
* 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-01-27Adds min and max, comments, and all of swift's keywords + fix docs (#5737)mustiikhalil1-19/+108
2020-01-24Creates a flatbuffers validation function + small fix (#5725)mustiikhalil1-4/+9
2020-01-13Added create function for swift (#5707)mustiikhalil1-12/+49
Fixed the create functions and updated the test cases in swift Removes unneeded code Updated documentation
2020-01-09[Swift] Swift implementation 🎉🎉 (#5603)mustiikhalil1-0/+758
* 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