GithubHelp home page GithubHelp logo

zouxiaoliang / bson-cxx-cmake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dwight/bson-cxx

0.0 0.0 0.0 3.03 MB

C++ BSON Library

Home Page: http://www.bsonspec.org/

C++ 99.76% Python 0.24%

bson-cxx-cmake's Introduction

This is a standalone BSON ("binary JSON") library for C++. (See bsonspec.org for more information on the BSON format.)

The library is at this time a bit early stage, but if you find it useful, that's great.

Notes

  • The code herein originates as a fork from the MongoDB C++ driver. Anything that isn't simply bson was then eliminated to get a standalone bson implementation. Some things were removed just for simplicity. Other changes have been made along the way too.

  • The namespace for the module is _bson. The underscore is present as it is anticipated that one day there will be an official bson driver perhaps, and we don't want to collide with that name-wise.

  • In current form the code uses a touch of C++11. The main reason for this is simply to have absolutely no outside dependencies; for example in C++11 we have unique_ptr in the standard library, and that is used herein. The C++11 specific code is minimal it would be quite easy to make the library work with older C++ editions.

  • Endian-awareness has been added, is preliminary, needs testing.

Notes for those who have used the MongoDB C++ Driver

  • The _bson::bsonobj class here behaves differently than the driver's mongo::BSONObj. The MongoDB driver version has a build in smart pointer implementation. That was removed here; bsonobj herein is simply a "view" on a bson data buffer in memory, and bsonobj itself does no memory management of it. The notion is that this is simpler and you can easily wrap them as needed yourself.

  • To avoid confusion as to what implementation is being used, the classes herein use lowercase names, unlike the MongoDB C++ driver library. If you see things in uppercase, they should probably be downcased for consistency eventually...

License

Apache 2.0.

Building

As mentioned above, the library uses std::unique_ptr among other things. Thus, use -std=c++0x on the compiler command line. (If that doesn't work for your project, I'd recommend using the BSON implementation in the MongoDB C++ driver instead.)

For Windows, see build/example1/example1.vcxproj for an example of settings that work. (Tested on Visual Studio 2013.)

Support

See Also

The bsontools command line utilities project which uses this library. Likely useful for any BSON user regardless of language.

bson-cxx-cmake's People

Contributors

dwight avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.