Module mochijson

Yet another JSON (RFC 4627) library for Erlang.

Copyright © 2006 Mochi Media, Inc.

Authors: Bob Ippolito (bob@mochimedia.com).

Description

Yet another JSON (RFC 4627) library for Erlang.

Data Types

binary_decoder_option()

binary_decoder_option() = {object_hook, function()}

binary_encoder_option()

binary_encoder_option() = {handler, function()}

bjson_array()

bjson_array() = [bjson_term()]

bjson_number()

bjson_number() = integer() | float()

bjson_object()

bjson_object() = {struct, [{bjson_string(), bjson_term()}]}

bjson_string()

bjson_string() = binary()

bjson_term()

bjson_term() = bjson_string() | bjson_number() | bjson_array() | bjson_object()

decoder_option()

decoder_option() = {input_encoding, encoding()} | {object_hook, function()}

encoder_option()

encoder_option() = {input_encoding, encoding()} | {handler, function()}

encoding()

encoding() = utf8 | unicode

iodata()

iodata() = iolist() | binary()

iolist()

iolist() = [char() | binary() | iolist()]

json_array()

json_array() = {array, [json_term()]}

json_number()

json_number() = integer() | float()

json_object()

json_object() = {struct, [{json_string(), json_term()}]}

json_string()

json_string() = atom | string() | binary()

json_term()

json_term() = json_string() | json_number() | json_array() | json_object()

Function Index

binary_decode/1Decode the given iolist to Erlang terms, using lists for arrays and binaries for strings.
binary_decoder/1Create a binary_decoder/1 with the given options.
binary_encode/1Encode the given as JSON to an iolist, using lists for arrays and binaries for strings.
binary_encoder/1Create a binary_encoder/1 with the given options.
decode/1Decode the given iolist to Erlang terms.
decoder/1Create a decoder/1 with the given options.
encode/1Encode the given as JSON to an iolist.
encoder/1Create an encoder/1 with the given options.
test/0

Function Details

binary_decode/1

binary_decode(S::iolist()) -> bjson_term()

Decode the given iolist to Erlang terms, using lists for arrays and binaries for strings.

binary_decoder/1

binary_decoder(Options::[binary_decoder_option()]) -> function()

Create a binary_decoder/1 with the given options.

binary_encode/1

binary_encode(Any::bjson_term()) -> iolist()

Encode the given as JSON to an iolist, using lists for arrays and binaries for strings.

binary_encoder/1

binary_encoder(Options::[binary_encoder_option()]) -> function()

Create a binary_encoder/1 with the given options.

decode/1

decode(S::iolist()) -> json_term()

Decode the given iolist to Erlang terms.

decoder/1

decoder(Options::[decoder_option()]) -> function()

Create a decoder/1 with the given options.

encode/1

encode(Any::json_term()) -> iolist()

Encode the given as JSON to an iolist.

encoder/1

encoder(Options::[encoder_option()]) -> function()

Create an encoder/1 with the given options.

test/0

test() -> any()


Generated by EDoc, Aug 8 2008, 22:08:31.