Skip to content

mattiaslevin/BSONKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#BSONKit

The BSONDecoder is an Objective-C framework for decoding binary JSON according to the BSON specification http://bsonspec.org

####Type conversion rules

BSON types are converted into Objective-C types according to the table below:

BSON typeObjective-c type
DocumentNSDictionary
Floating pointdouble
UTF-8 stringNSString
ArrayNSArray
Binary dataNSData
ObjectIdNSData
BooleanBOOL
UTC datestamplong long
Null valueNSNill
Regular expressionNSArray with two objects - regexp pattern (NSString) and options (NSString)
Javascript codeNSString
SymbolNSString
Javascript code with scopeNSArray with two objects - the Javascript code (NSString) and scope variables (NSDictionary)
32-bit integerNSInteger
Timestamplong long
64-bit integerlong long
Min keyTBD
Max keyTBD

##Interface

The interface for performing the decoding is very simple:

// Get a decoder instance
+ (id)decoder;
// Start decoding a BSON byte array
- (id)decode:(NSData*)source withError:(NSError**)error;

There is also a convenience NSData category:

// Decoding a BSON byte array
- (id)decodeBSONWithError:(NSError**)error;

About

An Objective-C framework for decoding BSON binary data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published