We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When you give a number that is greater than 2^32, the JSON parser converts it to a 32-bit integer. The following code illustrates:
std::string json = "{ \"test\" : 5000000000000000 }"; Parser parser; Var result; try { DefaultHandler handler; parser.setHandler(&handler); parser.parse(json); result = handler.result(); } catch(JSONException& jsone) { std::cout << jsone.message() << std::endl; assert(false); } assert(result.type() == typeid(Object::Ptr)); Object::Ptr object = result.extract<Object::Ptr>(); Var test = object->get("test"); assert(test.isInteger()); Int64 value = test; assert(value == 5000000000000000); // fails here, value gets truncated
The text was updated successfully, but these errors were encountered:
Merge pull request #33 from syvex/JSONParse64
249135b
Fix JSON Parser to handle 64-bit integers (Issue #32)
Merge pull request #32 from pocoproject/develop
142e91b
Sync 24.8.2016
No branches or pull requests
When you give a number that is greater than 2^32, the JSON parser converts it to a 32-bit integer. The following code illustrates:
The text was updated successfully, but these errors were encountered: