-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current rapidjson #221
Current rapidjson #221
Conversation
I'll look at this in the near future since I have a little more time for cereal right now - looks like automated tests are failing but I would sort this out in a merge. This was on my list of things to do (see #82) so if this looks good and integrates well that'd be a great help. |
Compilation just gives one harmless Disabling |
By the way, it seems your CI build doesn't actually run your unit tests, just compiles them. Is that intended? |
They get run after compilation. -----Original Message----- By the way, it seems your CI build doesn't actually run your unit tests, just compiles them. Is that intended? |
'rapidjson/filewritestream.h' - file is absent in latest rapidjson packege. |
@m7thon I'm very sorry ( was incorrect 'paste'), I meant file 'rapidjson/genericstream.h' |
Ah yes. But you can use the old file. I updated it to match the example given in the current rapidjson documentation, and use the RAPIDJSON... namespace macros. See my first two commits. EDIT: In the newest version, use 'istreamwrapper.h' and 'ostreamwrapper.h' instead. |
EDIT Feb 17, 2016 (update to newest cereal and rapidjson):
This updates rapidjson to the current master and discards the modifications made by cereal. The differences to the previously included version of rapidjson are, as far as I can tell:
precision
for double output has a different meaning. Currently rapidjson supports "truncated" double output, e.g., a precision of 2 means: 0.1285 -> 0.12, 0.004 -> 0.0, 1.23 e-7 -> 0.0.nan
,inf
and-inf
doubles. This is a non-standard json extension that rapidjson currently does not support (but may in the future). Note that the ability to parsing-inf
seems to be a new feature for cereal.long double
,long long
, andunsigned long long
are no longer handled in rapidjson. However, it seems this is now handled by cereal anyway by writing these types as strings.The file
json.hpp
is modified only minimally to work with the current rapidjson. Importantly, the parser is given therapidjson::kParseFullPrecisionFlag
, which means that double values are parsed in full precision (AKA correctly). This ensures that the roundtrip C++ -> json -> C++ works for all doubles.