enums not working as desired?
fire-eggs opened this issue · 3 comments
(Linux, gcc 9.4.0)
The project looks promising, I'd rather use a generator for serialization instead of code annotation and other weird hacks.
I'm using an enum as a struct field and it is not serializing / parsing as desired. The field is being ignored completely or always parsed as zero.
The desire is to get this:
{"_allkeys":[
{"_act":"NextImage","_keyval":11},
{"_act":"NextImage","_keyval":12},
{"_act":"PrevImage","_keyval":13}
]}But I'm getting this:
{"_allkeys":[
{"_keyval":11},
{"_keyval":12},
{"_keyval":13}
]}Note the act_ field, which is an enum, is missing.
I attach what I hope is a complete set of files to demo the problem.
You have to add all your header files to the inputs array, only those files will be parsed by the program. The includes array only specifies which additional includes should be present in the output file if required for whatever reason. Structure members of unrecognized types are simply ignored.
Right! Makes sense to me!
Got it - and this is where the header order issue comes into play too - I had to add "action.h" before "actionKeys.h" for it to work ...
Good, I'll keep playing!