33= An open-source MATLAB/Octave JSON encoder and decoder =
44===============================================================================
55
6- *Copyright (C) 2011-2015 Qianqian Fang <fangq at nmr.mgh.harvard .edu>
6+ *Copyright (C) 2011-2017 Qianqian Fang <q.fang at neu .edu>
77*License: BSD or GNU General Public License version 3 (GPL v3), see License*.txt
8- *Version: 1.2 (Optimus - Update 2 )
8+ *Version: 1.8 (Magnus - alpha )
99
1010-------------------------------------------------------------------------------
1111
@@ -83,7 +83,7 @@ JSON. The detailed help info for the four functions can be found below:
8383
8484 parse a JSON (JavaScript Object Notation) file or string
8585
86- authors:Qianqian Fang (fangq <at> nmr.mgh.harvard .edu)
86+ authors:Qianqian Fang (q.fang <at> neu .edu)
8787 created on 2011/09/09, including previous works from
8888
8989 Nedialko Krouchev: http://www.mathworks.com/matlabcentral/fileexchange/25713
@@ -94,7 +94,7 @@ JSON. The detailed help info for the four functions can be found below:
9494 http://www.mathworks.com/matlabcentral/fileexchange/20565
9595 created on 2008/07/03
9696
97- $Id: loadjson.m 487 2015-05-06 18:19:07Z fangq $
97+ $Id$
9898
9999 input:
100100 fname: input file name, if fname contains "{}" or "[]", fname
@@ -131,7 +131,10 @@ JSON. The detailed help info for the four functions can be found below:
131131 dat=loadjson('{"obj":{"string":"value","array":[1,2,3]}}')
132132 dat=loadjson(['examples' filesep 'example1.json'])
133133 dat=loadjson(['examples' filesep 'example1.json'],'SimplifyCell',1)
134- </pre>
134+
135+ license:
136+ BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
137+ </pre>
135138
136139=== savejson.m ===
137140
@@ -144,16 +147,17 @@ JSON. The detailed help info for the four functions can be found below:
144147 convert a MATLAB object (cell, struct or array) into a JSON (JavaScript
145148 Object Notation) string
146149
147- author: Qianqian Fang (fangq <at> nmr.mgh.harvard .edu)
150+ author: Qianqian Fang (q.fang <at> neu .edu)
148151 created on 2011/09/09
149152
150- $Id: savejson.m 486 2015-05-05 20:37:11Z fangq $
153+ $Id$
151154
152155 input:
153156 rootname: the name of the root-object, when set to '', the root name
154157 is ignored, however, when opt.ForceRootName is set to 1 (see below),
155158 the MATLAB variable name will be used as the root name.
156- obj: a MATLAB object (array, cell, cell array, struct, struct array).
159+ obj: a MATLAB object (array, cell, cell array, struct, struct array,
160+ class instance).
157161 filename: a string for the file name to save the output JSON data.
158162 opt: a struct for additional options, ignore to use default values.
159163 opt can have the following fields (first in [.|.] is the default)
@@ -176,10 +180,13 @@ JSON. The detailed help info for the four functions can be found below:
176180 parts, and also "_ArrayIsComplex_":1 is added.
177181 opt.ParseLogical [0|1]: if this is set to 1, logical array elem
178182 will use true/false rather than 1/0.
179- opt.NoRowBracket [1|0 ]: if this is set to 1, arrays with a single
183+ opt.SingletArray [0|1 ]: if this is set to 1, arrays with a single
180184 numerical element will be shown without a square
181185 bracket, unless it is the root object; if 0, square
182186 brackets are forced for any numerical arrays.
187+ opt.SingletCell [1|0]: if 1, always enclose a cell with "[]"
188+ even it has only one element; if 0, brackets
189+ are ignored when a cell has only 1 element.
183190 opt.ForceRootName [0|1]: when set to 1 and rootname is empty, savejson
184191 will use the name of the passed obj variable as the
185192 root object name; if obj is an expression and
@@ -214,6 +221,9 @@ JSON. The detailed help info for the four functions can be found below:
214221 'SpecialData',[nan, inf, -inf]);
215222 savejson('jmesh',jsonmesh)
216223 savejson('',jsonmesh,'ArrayIndent',0,'FloatFormat','\t%.5g')
224+
225+ license:
226+ BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
217227 </pre>
218228
219229=== loadubjson.m ===
@@ -225,10 +235,10 @@ JSON. The detailed help info for the four functions can be found below:
225235
226236 parse a JSON (JavaScript Object Notation) file or string
227237
228- authors:Qianqian Fang (fangq <at> nmr.mgh.harvard .edu)
238+ authors:Qianqian Fang (q.fang <at> neu .edu)
229239 created on 2013/08/01
230240
231- $Id: loadubjson.m 487 2015-05-06 18:19:07Z fangq $
241+ $Id$
232242
233243 input:
234244 fname: input file name, if fname contains "{}" or "[]", fname
@@ -261,6 +271,9 @@ JSON. The detailed help info for the four functions can be found below:
261271 dat=loadubjson(ubjdata)
262272 dat=loadubjson(['examples' filesep 'example1.ubj'])
263273 dat=loadubjson(['examples' filesep 'example1.ubj'],'SimplifyCell',1)
274+
275+ license:
276+ BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
264277</pre>
265278
266279=== saveubjson.m ===
@@ -274,16 +287,17 @@ JSON. The detailed help info for the four functions can be found below:
274287 convert a MATLAB object (cell, struct or array) into a Universal
275288 Binary JSON (UBJSON) binary string
276289
277- author: Qianqian Fang (fangq <at> nmr.mgh.harvard .edu)
290+ author: Qianqian Fang (q.fang <at> neu .edu)
278291 created on 2013/08/17
279292
280- $Id: saveubjson.m 465 2015-01-25 00:46:07Z fangq $
293+ $Id$
281294
282295 input:
283296 rootname: the name of the root-object, when set to '', the root name
284297 is ignored, however, when opt.ForceRootName is set to 1 (see below),
285298 the MATLAB variable name will be used as the root name.
286- obj: a MATLAB object (array, cell, cell array, struct, struct array)
299+ obj: a MATLAB object (array, cell, cell array, struct, struct array,
300+ class instance)
287301 filename: a string for the file name to save the output UBJSON data
288302 opt: a struct for additional options, ignore to use default values.
289303 opt can have the following fields (first in [.|.] is the default)
@@ -302,10 +316,13 @@ JSON. The detailed help info for the four functions can be found below:
302316 parts, and also "_ArrayIsComplex_":1 is added.
303317 opt.ParseLogical [1|0]: if this is set to 1, logical array elem
304318 will use true/false rather than 1/0.
305- opt.NoRowBracket [1|0 ]: if this is set to 1, arrays with a single
319+ opt.SingletArray [0|1 ]: if this is set to 1, arrays with a single
306320 numerical element will be shown without a square
307321 bracket, unless it is the root object; if 0, square
308322 brackets are forced for any numerical arrays.
323+ opt.SingletCell [1|0]: if 1, always enclose a cell with "[]"
324+ even it has only one element; if 0, brackets
325+ are ignored when a cell has only 1 element.
309326 opt.ForceRootName [0|1]: when set to 1 and rootname is empty, saveubjson
310327 will use the name of the passed obj variable as the
311328 root object name; if obj is an expression and
@@ -332,6 +349,9 @@ JSON. The detailed help info for the four functions can be found below:
332349 'SpecialData',[nan, inf, -inf]);
333350 saveubjson('jsonmesh',jsonmesh)
334351 saveubjson('jsonmesh',jsonmesh,'meshdata.ubj')
352+
353+ license:
354+ BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
335355</pre>
336356
337357
0 commit comments