Anable jsx|jiffy option

This commit is contained in:
Yuki Ito 2014-01-01 14:15:18 +09:00
parent 77608032d8
commit 67292fc884
2 changed files with 9 additions and 0 deletions

View File

@ -43,6 +43,7 @@
-type msgpack_list_options() :: [
{format, jsx|jiffy} |
jsx | jiffy |
{allow_atom, none|pack} |
{enable_str, boolean()} |
{ext, {msgpack_ext_packer(),msgpack_ext_unpacker()}}

View File

@ -117,6 +117,14 @@ parse_options(Opt) -> parse_options(Opt, ?OPTION{original_list=Opt}).
%% @private
parse_options([], Opt) -> Opt;
parse_options([jsx|TL], Opt0) ->
Opt = Opt0?OPTION{interface=jsx,
map_unpack_fun=msgpack_unpacker:map_unpacker(jsx)},
parse_options(TL, Opt);
parse_options([jiffy|TL], Opt0) ->
Opt = Opt0?OPTION{interface=jiffy,
map_unpack_fun=msgpack_unpacker:map_unpacker(jiffy)},
parse_options(TL, Opt);
parse_options([{format,Type}|TL], Opt0) when Type =:= jsx; Type =:= jiffy ->
Opt = Opt0?OPTION{interface=Type,
map_unpack_fun=msgpack_unpacker:map_unpacker(Type)},