Skip to content
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

Add support for BSON element 11: uint64 #4380

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

slowriot
Copy link

@slowriot slowriot commented May 24, 2024

This PR adds support for decoding and encoding BSON element 11: 64bit unsigned int.

This resolves #3894.

Changes

  • Decode element 0x11 correctly as uint64_t.
  • Update existing write_bson_unsigned to encode unsigned 64bit values correctly (using 0x11 instead of signed 0x12).
  • Update existing tests to expect support for uint64_t.

Reference

Pull request checklist

  • Changes are described in the pull request, or an existing issue is referenced.
  • The test suite compiles and runs without error.
  • Code coverage is 100%. Test cases can be added by editing the test suite.
  • The source code is amalgamated; that is, after making changes to the sources in the include/nlohmann directory, run make amalgamate to create the single-header files single_include/nlohmann/json.hpp and single_include/nlohmann/json_fwd.hpp. The whole process is described here.

@coveralls
Copy link

Coverage Status

coverage: 99.984% (-0.02%) from 100.0%
when pulling 7c616a2 on slowriot:bson-element-11-uint64
into 8c391e0 on nlohmann:develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

json::to_bson does not handle unsigned 64 bit integers
2 participants