Skip to content

Commit d8c19b8

Browse files
committed
add support to MessagePack, close #53, add NestArray option, close #6
1 parent c87e7d2 commit d8c19b8

File tree

4 files changed

+316
-101
lines changed

4 files changed

+316
-101
lines changed

loadjson.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@
140140
end
141141
end
142142
parse_char(inStr, '}');
143-
if(isstruct(object))
144-
object=struct2jdata(object);
145-
end
143+
% if(isstruct(object))
144+
% object=struct2jdata(object);
145+
% end
146146

147147
%%-------------------------------------------------------------------------
148148

savemsgpack.m

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
function msgpk=savemsgpack(rootname,obj,varargin)
2+
%
3+
% msgpk=savemsgpack(rootname,obj,filename)
4+
% or
5+
% msgpk=savemsgpack(rootname,obj,opt)
6+
% msgpk=savemsgpack(rootname,obj,'param1',value1,'param2',value2,...)
7+
%
8+
% convert a MATLAB object (cell, struct, array, table, map, handles ...)
9+
% into a MessagePack binary stream
10+
%
11+
% author: Qianqian Fang (q.fang <at> neu.edu)
12+
% created on 2019/05/20
13+
%
14+
% This function is the same as calling saveubjson(...,'MessagePack',1)
15+
%
16+
% Please type "help saveubjson" for details for the supported inputs and outputs.
17+
%
18+
% license:
19+
% BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
20+
%
21+
% -- this function is part of JSONLab toolbox (http://iso2mesh.sf.net/cgi-bin/index.cgi?jsonlab)
22+
%
23+
24+
if(length(varargin)==1)
25+
msgpk=saveubjson(rootname,obj,'FileName',varargin{1},'MessagePack',1);
26+
else
27+
msgpk=saveubjson(rootname,obj,varargin{:},'MessagePack',1);
28+
end

0 commit comments

Comments
 (0)