Latest 1.1.1
Homepage https://github.com/smartdevicelink/bson_c_lib
License New BSD
Platforms ios 6.0, osx 10.7, watchos 2.0, tvos 9.0
Authors

README

Library for converting to and from BSON

Build library

./configure
make

Install library

sudo make install

Build Lua wrapper

Install Dependencies

sudo apt-get install liblua5.2-dev

Build Library

./configure --with-lua-wrapper=yes
make

Using the Lua Library

bson = require("bson4lua");

bsonBytes = bson.to_bytes({
    doubleValue = {
        type = 0x01, --Double type
        value = 3.141592653589793
    },
    intValue = {
        type = 0x10, --Int32 Type
        value = 360
    },
    stringValue = {
        type = 0x02, --String type
        value = "A string of characters"
    }
});

print(bsonBytes:byte(1, string.len(bsonBytes)));

bsonTable = bson.to_table(string.char(0x05, 0x00, 0x00, 0x00, 0x00)); --Empty BSON document

print("Table: ");
for k, v in pairs(bsonTable) do
    print(k, v);
end

Apple Platforms

There is a CocoaPod for iOS, MacOS, tvOS, and watchOS. Add to your podfile:

pod 'BiSON'

Build and run sample program

cd examples
gcc -o sample sample.c -lbson
./sample

Latest podspec

{
    "name": "BiSON",
    "version": "1.1.1",
    "summary": "A portable BSON C library",
    "homepage": "https://github.com/smartdevicelink/bson_c_lib",
    "license": {
        "type": "New BSD",
        "file": "LICENSE"
    },
    "preserve_paths": "src/emhashmap/LICENSE",
    "authors": {
        "SmartDeviceLink Team": "[email protected]"
    },
    "platforms": {
        "ios": "6.0",
        "osx": "10.7",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/smartdevicelink/bson_c_lib.git",
        "tag": "1.1.1"
    },
    "source_files": [
        "src/*.{h,c}",
        "src/emhashmap/*.{h,c}"
    ],
    "header_mappings_dir": "src"
}

Pin It on Pinterest

Share This