Martchus
e93be04e35
Implement generator for binary (de)serialization
...
Still need to refactor common code with the JSON generator.
2018-06-23 17:25:30 +02:00
Martchus
9dc7bd371c
Apply clang-format
2018-06-23 14:35:53 +02:00
Martchus
8628427e6d
Fix usage of enable_if with GCC 8
...
Seems like the trick with the three dots isn't working
with GCC 8 anymore. So let's make it a default template
parameter then.
Not sure whether GCC 8 is here correct and whether this
workaround causes further trouble.
2018-05-07 23:48:37 +02:00
Martchus
36463cd6dc
Apply clang-format from LLVM 6
2018-04-04 20:31:49 +02:00
Martchus
7db20f5ad5
List all required LLVM/Clang libraries explicitely
...
Those libraries are direct dependencies and must be listed
explicitely when linking dynamically because transitive
dependencies of clangTooling are not pulled automatically
by CMake in this case.
This is required to use LLVM 6 which has switched to dynamic
libraries (at least under Arch Linux).
2018-03-14 18:33:15 +01:00
Martchus
f0870d3a54
Test with size_t (defined in Clang's builtin headers)
2018-02-03 16:14:20 +01:00
Martchus
2098ff702e
fixup! Do not turn errors into warnings by default
2018-02-03 16:10:01 +01:00
Martchus
d1fe76f322
Use mutable instead of const_cast
2018-02-03 16:09:31 +01:00
Martchus
8587d62583
Do not turn errors into warnings by default
...
Not required anymore since the resource dir is specified
correctly.
2018-02-03 15:47:25 +01:00
Martchus
21e7f83995
Improve documentation
2018-02-03 15:45:15 +01:00
Martchus
54d4a15d4f
Set Clang's resource dir and platform triple correctly
...
* The option `-resource-dir` must be specified to
point to Clang's resource directory containing built-in
header files. Then the massive warnings are gone.
* Setting the platform triple seems to be the right way
for cross-compilation. Note that the stdlib.h still needs
to be worked around.
2018-02-03 15:44:10 +01:00
Martchus
4ae20cf38b
Clean the CLI flags passed to clang by default
2018-02-03 15:37:30 +01:00
Martchus
8eb9e9ec27
Do not adjust the config in AST consumer
...
* Adjusting the config at this point seems
to be too late, at least it does not seem
have any effect
* Rather use the CLI arguments
2018-02-03 15:36:53 +01:00
Martchus
0d2f39a2b5
Use hash map to find specified code generator
...
So adding further generators will not result in having
a lot of "else if (!strcmp(..." conditions.
This also allows to improve the error message.
2018-02-02 18:21:04 +01:00
Martchus
c2e15f10fb
Fix unused variable
2018-01-20 20:43:29 +01:00
Martchus
baf7eec38e
Invoke add_reflection_generator_invocation only if building tests
2018-01-20 19:46:17 +01:00
Martchus
beb4d1d672
Prevent ambiguity of own arguments and clang options consistently
2018-01-20 19:32:46 +01:00
Martchus
c36279665d
Fix cross-compilation with mingw-w64
2018-01-20 18:10:58 +01:00
Martchus
2fa1e923f9
Skip deserializing const member variables
2017-12-31 00:48:51 +01:00
Martchus
c5968f1663
Test whether code generation is skipped for included structs
2017-12-31 00:37:30 +01:00
Martchus
51e55f1673
Fix 'isOnlyIncluded' check for 3rdparty adaption
...
* Ensure the adaption is done in our source file
* Allow the 3rdparty class/struct to be in any file
2017-12-26 16:29:51 +01:00
Martchus
5f799cc65d
Prevent code generator for records which are only included
2017-12-24 02:02:40 +01:00
Martchus
bae7cf3414
Prevent generating pull method for non-default constructable classes
2017-12-24 01:07:52 +01:00
Martchus
8016a42394
Fix adding adaption records in namespaces
2017-12-22 20:31:35 +01:00
Martchus
7b6fe57aac
Prevent segfault when no args specified
2017-11-23 15:18:44 +01:00
Martchus
69d4fa193f
Apply clang-format
2017-11-18 00:27:25 +01:00
Martchus
f5a240649f
Separate RapidJSON specific parts
...
So when extending this for further applications of
reflection, the JSON-specific parts can be made optional.
2017-11-17 22:04:01 +01:00
Martchus
8c3dd5535d
Pass the include dir for c++utilities and RapidJSON to tests
...
So test cases do not fail if the header files for those
dependencies are installed in a custom location.
2017-11-17 22:01:18 +01:00
Martchus
227d3f3942
Allow passing target config to generator invocation
...
So the code generator 'sees' the source code in the same
way as the compiler does.
2017-11-17 21:42:49 +01:00
Martchus
19cab9c791
Bundle c++utilities correctly
...
* Use the c++utilities source directory for includes rather
than the locations where headers are goint to be installed
* Call find_package for c++utilities only once
2017-11-17 21:21:34 +01:00
Martchus
d5144d8e75
Restore GCC compatibility
2017-11-16 01:56:04 +01:00
Martchus
19590d30a4
Explicitely ignore static members (for now)
2017-11-13 16:41:47 +01:00
Martchus
c71a9baa54
Test std::unique_ptr in generated code
2017-11-13 16:18:32 +01:00
Martchus
e9324f0ec3
Fix incomplete use of AdaptedJsonSerializable and handling tuple
2017-11-12 00:44:47 +01:00
Martchus
4655387c4d
Clean code for JSON generator
2017-11-11 23:29:17 +01:00
Martchus
9fb26e69e9
Remove leftovers from debugging
2017-11-11 22:54:00 +01:00
Martchus
ee0ca561c0
Allow exporting generated functions and don't inline by default
2017-11-11 22:53:40 +01:00
Martchus
9f0f208f28
Trun only errors into warnings which are actually required
2017-11-11 00:26:23 +01:00
Martchus
0d74d915f8
Allow optionally (de)serializing private members
2017-11-09 01:11:00 +01:00
Martchus
e29dcce40f
Only consider public members
...
Otherwise the compiler would complain about accessibility
anyways.
2017-11-09 00:07:40 +01:00
Martchus
062f8c0d27
Allow enabling (de)serialization for 3rd party structs
2017-11-06 23:27:27 +01:00
Martchus
c4b4429880
Test --json-classes argument
2017-11-06 20:04:42 +01:00
Martchus
e12e33a28f
Remove obsolete comment
2017-11-06 19:11:02 +01:00
Martchus
a7feb57f22
Allow specifying additional classes for JSON serialization
2017-11-06 15:31:21 +01:00
Martchus
95719ac8a4
Test mixing custom (de)serialization with generated code
2017-11-04 15:17:06 +01:00
Martchus
8b61fcc29a
Make location of code generator customizable
2017-11-03 22:41:51 +01:00
Martchus
daf1a8602c
Rename Reflector -> JsonReflector
...
So helper methods for other applications of reflections
would go into a separate namespace to prevent conflicts.
2017-11-02 23:35:56 +01:00
Martchus
fdadb17c04
Call tests for JSON generator JsonGeneratorTests
2017-11-02 23:09:39 +01:00
Martchus
104e362762
Imporve documentation and build script
2017-10-28 18:24:12 +02:00
Martchus
a768408493
Refactor JsonSerializationCodeGenerator
...
* JSONSerializationCodeGenerator -> JsonSerializationCodeGenerator
* Move to separate file
2017-10-28 16:31:07 +02:00