I’d like to merge both these into a json file, since they’re related to user preferences. Any objection ?
I’m not sure about this one.
The thing is that sysopts file is not only read but also written upon changing settings. We have only JSON reader, not JSON generator. Generating the file can be obviously implemented but I’m afraid it’ll lead to having non-trivial duplicated code for reading and saving settings what can be inconvenient, especially as the number of options grow (as compared to current “list all fields” binary serialization method).
I’d first consider changing data structure of the whole settings thing to something we can easy read from / save to JSON (some kind of property tree).
[size=75]Ah, if only C++ had some reflection mechanism… It’s a shame that compiler knows names and types of all fields in a class but we can’t use this in any way. [/size]
The current json implementation can save files.
I was thinking that these options should be flat (ie. no tree involved).
Right, my bad. Feel free to merge the files then.
@tow’s little text
we can, c++ support that, but this is disabled by default in compilers, as code generated with that stuff is much fatter
it can even check the type of an object pointed by polimorphic pointer
the problem is we can’t iterate through all fields in class, so much of that is needed to be done by hand