Module mochijson2

Module mochijson2

Yet another JSON (RFC 4627) library for Erlang.

Copyright � 2007 Mochi Media, Inc.

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

Description

Yet another JSON (RFC 4627) library for Erlang. mochijson2 works with binaries as strings, arrays as lists (without an {array, _}) wrapper and it only knows how to decode UTF-8 (and ASCII).

Data Types

iodata()

iodata() = iolist() | binary()

iolist()

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

json_array()

json_array() = [json_term() ]

json_number()

json_number() = integer() | float()

json_object()

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

json_string()

json_string() = atom | binary()

json_term()

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

Function Index

decode/1 Decode the given iolist to Erlang terms.
decoder/1 Create a decoder/1 with the given options.
encode/1 Encode the given as JSON to an iolist.
encoder/1 Create an encoder/1 with the given options.
test/0  

Function Details

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()

 

 

转自: http://www.erlware.org/lib/5.6.3/mochiweb-0.83/mochijson2.html#type-json_number

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值