https://github.com/paulmelnikow/objcbson
High-performance BSON serialization and deserialization in Objective-C
https://github.com/paulmelnikow/objcbson
bson
Last synced: 5 months ago
JSON representation
High-performance BSON serialization and deserialization in Objective-C
- Host: GitHub
- URL: https://github.com/paulmelnikow/objcbson
- Owner: paulmelnikow
- License: apache-2.0
- Created: 2014-11-15T23:03:54.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-18T20:23:39.000Z (about 8 years ago)
- Last Synced: 2024-12-28T03:30:48.845Z (5 months ago)
- Topics: bson
- Language: Objective-C
- Homepage:
- Size: 116 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
ObjCBSON
========High-performance BSON serialization and deserialization in Objective-C.
[](https://travis-ci.org/paulmelnikow/ObjCBSON)
[](http://cocoadocs.org/docsets/ObjCBSON)
[](http://cocoadocs.org/docsets/ObjCBSON)
[](http://cocoadocs.org/docsets/ObjCBSON)Installation
------------ObjCBSON is available through [CocoaPods][]. It depends on [libbson][], which
is installed automatically, however two of its build dependences are not.First, install those:
```sh
brew install automake libtool
```Then, add the following line to your Podfile:
```rb
pod 'ObjCBSON'
```[cocoapods]: http://cocoapods.org/pods/ObjCBSON
[libbson]: http://cocoapods.org/pods/libbsonExample
-------```objc
#import "BSONSerialization.h"- (void) bsonExample {
NSError *error = nil;// BSON encode dictionary `sampleDict` to `NSData *` instance `bsonEncodedData`
NSDictionary *sampleDict = @{ @"sampleKey" : @"sampleValue" };
NSData *bsonEncodedData = [BSONSerialization BSONDataWithDictionary:sampleDict error:&error];
NSLog(@"bsonEncodedData=%@ error=%@", bsonEncodedData, [error localizedDescription]);// ...end perform decording from BSON back to `NSDictionary *`
NSDictionary *bsonDict = [BSONSerialization dictionaryWithBSONData:bsonEncodedData error:&error];
NSLog(@"bsonDict=%@, error=%@", bsonDict, [error localizedDescription]);
}
```Development
-----------To develop on the library and run the unit tests, clone the repo, run `pod install`
from the Example directory, and open the xcworkspace.Contribute
----------- Issue Tracker: https://github.com/paulmelnikow/ObjCBSON/issues
- Source Code: https://github.com/paulmelnikow/ObjCBSONLicense
-------The project is licensed under the Apache 2.0 license.