The OpenD Programming Language

json2ion

Converts JSON Value Stream to binary Ion data.

  1. immutable(ubyte)[] json2ion(const(char)[] text)
    @trusted pure
    immutable(ubyte)[]
    json2ion
    (
    scope const(char)[] text
    )
  2. void json2ion(const(char)[] text, Appender appender)

Examples

import mir.test;
static immutable ubyte[] data = [0xe0, 0x01, 0x00, 0xea, 0xe9, 0x81, 0x83, 0xd6, 0x87, 0xb4, 0x81, 0x62, 0x81, 0x61, 0xd6, 0x8b, 0x21, 0x01, 0x8a, 0x21, 0x02];
`{"a":1,"b":2}`.json2ion.should == data;

Meta