Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "msgpack"

Title:DCG for packing & unpacking of MessagePack data to/from bytes
Rating:Not rated. Create the first rating!
Latest version:0.1.6
SHA1 sum:6e5b3c2f5aa179564fe4b7acd12213c88806d833
Author:James N. V. Cash <james.cash@occasionallycogent.com>
Home page:https://github.com/jamesnvc/msgpack
Download URL:https://github.com/jamesnvc/msgpack/releases/*.zip

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.1.07167174e70c4b8fef842df67361ba08012c487621https://github.com/jamesnvc/msgpack/archive/v0.1.0.zip
0.1.21f7beecf966d344299cf511f6e70d48aeda19a991https://github.com/jamesnvc/msgpack/archive/v0.1.2.zip
0.1.45c50c0762da27a80b623394981e95d890a26fe502https://github.com/jamesnvc/msgpack/archive/v0.1.4.zip
0.1.5708629987ad26a5d0d6b976a1eb63c1db9a318242https://api.github.com/repos/jamesnvc/msgpack/zipball/v0.1.5
0.1.66e5b3c2f5aa179564fe4b7acd12213c88806d83326https://api.github.com/repos/jamesnvc/msgpack/zipball/v0.1.6

Prolog-MessagePack

This library provides a DCG, msgpack//1 for the parsing of MessagePack.

It can be used to either pack or unpack MessagePack data structures to/from bytes.

It is available from the SWI Prolog registry and can be installed via ?- pack_install(msgpack)..

Examples

Unpacking:

?- Bytes = [0x82, 0xa3, 0x66, 0x6f, 0x6f, 0x1, 0xa3, 0x62, 0x61, 0x72, 0x94,
            0xcd, 0xf, 0xff, 0xc3, 0xc2, 0xc0],
   msgpack(Data, Bytes, []).
Data = dict([str("foo")-1, str("bar")-list([4095, true, false, none])]).

Packing:

?- msgpack(list([-32, str("bloop"), list([65, 129, 2000])]),
           Bytes, []), format_hex_list(Bytes).
Bytes = [147, 208, 224, 165, 98, 108, 111, 111, 112|...].

Contents of pack "msgpack"

Pack contains 5 files holding a total of 25.1K bytes.