33= An open-source MATLAB/Octave JSON encoder and decoder =
44===============================================================================
55
6- *Copyright (c ) 2011-2014 Qianqian Fang <fangq at nmr.mgh.harvard.edu>
6+ *Copyright (C ) 2011-2014 Qianqian Fang <fangq at nmr.mgh.harvard.edu>
77*License: BSD or GNU General Public License version 3 (GPL v3), see License*.txt
8- *Version: 1.0.0-RC1 (Optimus - RC2)
8+ *Version: 1.0.0-RC2 (Optimus - RC2)
99
1010-------------------------------------------------------------------------------
1111
@@ -93,14 +93,33 @@ JSON. The detailed help info for the four functions can be found below:
9393 http://www.mathworks.com/matlabcentral/fileexchange/20565
9494 date: 2008/07/03
9595
96- $Id: loadjson.m 437 2014-09-15 18:59:36Z fangq $
96+ $Id: loadjson.m 452 2014-11-22 16:43:33Z fangq $
9797
9898 input:
9999 fname: input file name, if fname contains "{}" or "[]", fname
100100 will be interpreted as a JSON string
101101 opt: a struct to store parsing options, opt can be replaced by
102- a list of ('param',value) pairs. The param string is equivallent
103- to a field in opt.
102+ a list of ('param',value) pairs. opt can have the following
103+ fields (first in [.|.] is the default)
104+
105+ opt.SimplifyCell [0|1]: if set to 1, loadjson will call cell2mat
106+ for each element of the JSON data, and group
107+ arrays based on the cell2mat rules.
108+ opt.FastArrayParser [1|0 or integer]: if set to 1, use a
109+ speed-optimized array parser when loading an
110+ array object. The fast array parser may
111+ collapse block arrays into a single large
112+ array similar to rules defined in cell2mat; 0 to
113+ use a legacy parser; if set to a larger-than-1
114+ value, this option will specify the minimum
115+ dimension to enable the fast array parser. For
116+ example, if the input is a 3D array, setting
117+ FastArrayParser to 1 will return a 3D array;
118+ setting to 2 will return a cell array of 2D
119+ arrays; setting to 3 will return to a 2D cell
120+ array of 1D vectors; setting to 4 will return a
121+ 3D cell array.
122+ opt.ShowProgress [0|1]: if set to 1, loadjson displays a progress bar.
104123
105124 output:
106125 dat: a cell array, where {...} blocks are converted into cell arrays,
@@ -121,7 +140,7 @@ JSON. The detailed help info for the four functions can be found below:
121140 author: Qianqian Fang (fangq<at> nmr.mgh.harvard.edu)
122141 created on 2011/09/09
123142
124- $Id: savejson.m 439 2014-09-17 05:31:08Z fangq $
143+ $Id: savejson.m 450 2014-11-18 20:53:31Z fangq $
125144
126145 input:
127146 rootname: name of the root-object, if set to '', will use variable name
@@ -170,8 +189,10 @@ JSON. The detailed help info for the four functions can be found below:
170189 opt.UnpackHex [1|0]: conver the 0x[hex code] output by loadjson
171190 back to the string form
172191 opt.SaveBinary [0|1]: 1 - save the JSON file in binary mode; 0 - text mode.
192+ opt.Compact [0|1]: 1- out compact JSON format (remove all newlines and tabs)
193+
173194 opt can be replaced by a list of ('param',value) pairs. The param
174- string is equivallent to a field in opt.
195+ string is equivallent to a field in opt and is case sensitive .
175196 output:
176197 json: a string in the JSON format (see http://json.org)
177198
@@ -222,7 +243,7 @@ JSON. The detailed help info for the four functions can be found below:
222243 author: Qianqian Fang (fangq<at> nmr.mgh.harvard.edu)
223244 created on 2013/08/17
224245
225- $Id: saveubjson.m 439 2014-09-17 05:31:08Z fangq $
246+ $Id: saveubjson.m 440 2014-09-17 19:59:45Z fangq $
226247
227248 input:
228249 rootname: name of the root-object, if set to '', will use variable name
0 commit comments