1. 程式人生 > >【原始碼】JSON/UBJSON編解碼工具箱JSONlab version 1.5.0.0

【原始碼】JSON/UBJSON編解碼工具箱JSONlab version 1.5.0.0

在這裡插入圖片描述 JSONlab是"iso2mesh"工具箱的組成部分之一。

JSONlab is a component of the"iso2mesh" toolbox (http://iso2mesh.sf.net).

JSON(JavaScript Object Notation)是一種高度可移植的、人類可讀的、“輕量級”的文字格式,用於表示複雜和分層資料。

JSON (JavaScript Object Notation) is ahighly portable, human-readable and “fat-free” text format torepresent complex and hierarchical data.

JSON的功能與XML同樣強大,但更為簡潔。

It is as powerful as XML, but less verbose.

JSON格式廣泛用於應用程式中的資料交換,對於Ajax和Web2.0的巨大成功至關重要。

JSON format is widely used fordata-exchange in applications, and is essential for the wild success of Ajax and Web2.0.

UBJSON(通用二進位制JSON)是一種二進位制JSON格式,特別針對緊湊的檔案大小和更好的效能進行了優化,同時保持語義與基於文字的JSON格式一樣簡單。

UBJSON (Universal Binary JSON) is a binaryJSON format, specifically optimized for compact file size and betterperformance while keeping the semantics as simple as the text-based JSONformat.

使用UBJSON格式允許以靈活和可擴充套件的結構包裝複雜的二進位制資料,能夠處理複雜和大型資料集,而不會由於文字轉換而造成準確度損失。

Using the UBJSON format allows to wrapcomplex binary data in a flexible and extensible structure, making it possibleto process complex and large dataset without accuracy loss due to textconversions.

未來的科學研究中,JSON和UBJSON將作為主流資料交換格式的一部分。

We envision that both JSON and its binaryversion will serve as part of the mainstream data-exchange formats forscientific research in the future.

它將通過其它流行檔案規範實現靈活性和通用性,如HDF5,從而顯著降低複雜性,並提高效能。

It will provide the flexibility andgenerality achieved by other popular general-purpose file specifications, suchas HDF5, with significantly reduced complexity and enhanced performance.

JSONlab是一個免費的基於MATLAB語言的開源JSON/UBJSON編解碼器。

JSONlab is a free and open-sourceimplementation of a JSON/UBJSON encoder and a decoder in the native MATLABlanguage.

JSONlab可以用於將MATLAB資料結構(陣列、結構、單元、結構陣列和單元陣列)轉換為JSON/UBJSON格式的字串,或者將JSON/UBJSON檔案解碼為MATLAB資料結構。

It can be used to convert a MATLAB datastructure (array, struct, cell, struct array and cell array) into JSON/UBJSONformatted strings, or to decode a JSON/UBJSON file into MATLAB data structure.

JSONlab支援MATLAB和GNU Octave。

JSONlab supports both MATLAB and GNU Octave(a free MATLAB clone).

JSONlab提供的主要函式如下:

loadjson.m:JSON解碼函式

savejson.m:JSON編碼函式

loadubjson.m:UBJSON解碼函式

saveubjson.m:UBJSON編碼函式

原始碼下載地址:

更多精彩文章請關注微訊號:在這裡插入圖片描述