* [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.
* Extend the test of MonsterExtra
- Extend C++ test of MonsterExtra
- Add conversion of fbs/json NaNs to unsigned quiet-NaN
- Update documentation (cross-platform interoperability)
* Fix declaration of infinity constants int the test
* Add FLATBUFFERS_COMPATIBILITY string
- Add a new __reset method NET/JAVA which hides internal state
* Resolve PR notes
* Use operator new() to __init of Struct and Table
* Restrict visibility of C# Table/Struct to internal level
* c++: Add command line option to add extra includes to gen files
Fixes#5351
We have an ability to pass custom types for strings, allocators, etc
but have no way to tell the generator to include the classes in gen code
* c++: remove std::strtok for std::string methods. passes msvc compile
* generate_code.sh: add --cpp-includes to the test gen script
* tests:generate.bat: update code gen scripts w/ --cpp-includes
* cpp: use command line parsing for extra includes
s/--cpp-includes/--cpp-include/g
Simplify command line parsing of includes by using a std::vector.
* cpp: idl.h: move std::vector for cpp_includes as the last member
msvc does not understand initalization list on our CI server
* cpp:msvc: CI fails on for-range loops
* cpp:codegen: fix error reporting on flatcc
* as per code review: remove unwated --cpp-include in the
tests/generate_code.{sh,bat}
- update C++ monster_test::Color to unsigned type
- update Go Color:ubyte in the go_test.go
- add workaround for unsigned enum in java test
- sync generate.bat and generate.sh
* Fix issues with uint64 enums
- hide the implementation of enums from code generators
- fix uint64 the issue in the cpp-generator
- fix#5108
- new tests
- enums with bit_flags attribute should be unsigned
* Refine objectives of EnumDef's FindByValue and ReverseLookup methods
- move EnumDef::ReverseLookup implementation to idl_parser.cpp
- fix typos
* Make the IsUInt64 method private
* Create a function GenerateGenerateTextFromTable in order to create a json from any Table
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Update the test to failed if loadfile or parser return false
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Fix snake_case name typo + space before &/*
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* use auto
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Use clang-format on the added code
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
This to support code that relied on tables being multiline,
but not vectors.
This behavior was changed in:
b1a925dfc2 (diff-c45c8fbffbc64f7ff4aa2978612b10d8)
Change-Id: I4c95471b643b2b3fab95e06b1294e19d686b492c
This was incompatible with -Wc++98-c++11-compat on some platforms,
due to local variables in the function.
Change-Id: Idef510c2cefe944eef2e0656f5a219c2158063e6
implement better custom string type constructor alternative
for Unpack() and fix bug with vector of custom string types
in Pack().
Squashed commit of the following:
commit e9519c647e
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:24:49 2019 +0100
tests: regenerate code, reverts change to CreateVectorOfStrings().
commit 117e3b0679
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:15:05 2019 +0100
idl_gen_cpp.cpp: move clang-format on/off outside of declaration, so they are kept properly aligned automatically.
commit 4791923806
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:11:40 2019 +0100
idl_gen_cpp.cpp: full clang-format run with provided Google format file, enforce 80 lines width.
commit 2f0402f9ff
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:09:32 2019 +0100
CppUsage: address requested changes.
idl_gen_cpp.cpp: fix formatting, keep CreateVectorOfStrings for normal string cases.
commit 371d4e0b79
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Fri Mar 1 16:35:29 2019 +0100
Fix compile error with a vector of non-std::strings. CreateVectorOfStrings() expects a vector of std::string types, but that's not always the case.
commit 92b90d7f0f
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Fri Mar 1 16:15:36 2019 +0100
Document requirement for custom string types to implement empty() and be constructible from std::string.
Add new option --cpp-str-flex-ctor to construct custom string types not via std::string, but (char * + length).
commit 28cb2e92d5
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Fri Mar 1 14:31:17 2019 +0100
idl_gen_cpp.cpp: clang-format run, to better separate changes in content from formatting.
Change-Id: I4887ba2f2c632b9e7a8c938659b088cd95690870
On Solaris Sparc, calling NumToString() with a char called the primary
version, not the signed char or unsigned char specializations, which
caused integer to string conversions to be missed.
For some reason, Offset<T> is being considered a scalar, which
causes EndianSwap to be passed an Offset<T>. This doesn't work,
as it does not support types with non-trivial constructors. This
change adds an overload to WriteScalar(), which works around this.
* Implement native_shared attribute for C++.
Fixes#5141. See also #5145.
* Refine comment in idl.h
* Also refine docs
* Revert "Also refine docs"
This reverts commit 09dab7b45c.
* Also refine docs again.
* grumble
This is to protect against cases where part of a project is
compiled with or without this flag, making for very fragile
and hard to find bugs, such as sizeof(Verifier) changing.
Change-Id: I01c895cdc5b44f860e4b0b9c9613bff1983e2b9d
See: https://bugs.chromium.org/p/chromium/issues/detail?id=929847
With the introduction of Windows 10 on ARM (ARM64), code that assumes
that Windows targets are always x86 or x86_64 targets needs to be
updated.
The hot function ReadUInt64 has been optimized in MSVC builds using the
compiler intrinsic __movsb. Since this does not exist on ARM64 Windows,
this change uses the pure C++ path that other platforms use instead.
* Add `const` keyword to the `operator-(const uoffset_t &)` function in
`VectorIterator`
* Support reverse iterator in Vector
Introduced a new VectorReverseIterator type. We cannot directly use
`std::reverse_iterator<VectorIterator>` because the signature of
`operator*` and `operator->` in the VectorIterator class are not
standard signatures.
Also added `rbegin()`, `rend()`, `cbegin()`, `cend()`, `crbegin()`
and `crend()` in the Vector class.
* Fix high certainty warnings from PVS-studio
- Introduced FLATBUFFERS_ATTRIBUTE macro to use [[attribute]] if modern C++ compiler used
* Update the note about __cplusplus usage in the MSVC