Coder Social home page Coder Social logo

objectivebson's Introduction

ObjectiveBSON

A small library that provides BSON serialization methods for Mac or iOS applications.

Usage

Copy BSONSerialization.h and BSONSerialization.m to your project.

Calling [NSData BSONValue] on an NSData object containing BSON data returns an NSDictionary with the deserialized BSON data.

Calling [NSDictionary BSONRepresentation] returns an NSData with the serialized BSON data.

Alternatively, [NSDictionary dictionaryFromBSONBytes:(char*)] may be used if you only have access to a char[] containing the BSON data.

objectivebson's People

Contributors

jeremyot avatar linusu avatar

Stargazers

Linus Schaub (he/him) avatar  avatar West avatar  avatar Anoop Mohandas avatar Moritz Wundke avatar Rafael Bugajewski avatar Dan Stenmark avatar Stephen Fortune avatar Michael Hu avatar Nicky Weber avatar aligo avatar LeoLuo avatar  avatar Christopher Atkins avatar Marco Köppel avatar PeiSong avatar Olivier Pascal avatar Bjarke Walling avatar Felipe avatar Konrad Bloor avatar  avatar Pham Cong Dinh avatar Raphael Bartolome avatar

Watchers

Alek Slater avatar  avatar James Cloos avatar  avatar Kim. Dae-Hyun avatar Dan Stenmark avatar  avatar

objectivebson's Issues

No license

Would like to trial this in an iOS project. Can you provide license details ?

Odd behavior with blank strings

I am parsing a BSON message to an NSDictionary. The BSON has an array like this:

{
Data = "some data"; // all strings are String (not CString)
Name = "my name";
Things = ( "thing1", "thing2" ); // an array of Strings
},{
Data = "more data";
Name = "another name";
Things = ( "thing3", "thing4" );
}

This works fine converting the BSON to NSDictionary. But when Name is an empty string (not nil—I know that breaks NSDictionary), the "Things" array that comes after it in the BSON structure doesn't get added to the dictionary:

{
Data = "more data";
Name = "";
}

Though the array IS in the BSON. Just changing the Name field to be a space (if it would otherwise be empty) makes the Things array show up again in the output NSDictionary.

Also, if I change the order of the elements so that Things comes before Name, then Things is retained even when Name is an empty string. So order counts here.

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.