在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):harningt/luajson开源软件地址(OpenSource Url):https://github.com/harningt/luajson开源编程语言(OpenSource Language):Lua 98.5%开源软件介绍(OpenSource Introduction):LuaJSONJSON Parser/Constructor for Lua Author:Thomas Harning Jr. [email protected] Source code:Bug reports:http://github.com/harningt/luajson [email protected] RequirementsLua 5.1, 5.2, 5.3, LuaJIT 2.0, or LuaJIT 2.1 LPeg (Tested with 0.7, 0.8, 0.9, 0.10, 0.12rc2, 1.0.1) For regressionTest: lfs (Tested with 1.6.3) For lunit-tests:lunitx >= 0.8 NOTE:LPeg 0.11 may not work - it crashed during my initial tests, it is not in the test matrix. Lua versions tested recently:
LicenseAll-but tests: MIT-style, See LICENSE for details tests/*: Public Domain / MIT - whichever is least restrictive Module/Function overview:json.encode (callable module referencing json.encode.encode)encode ( value : ANY-valid ) Takes in a JSON-encodable value and returns the JSON-encoded text Valid input types:
Table keys (string,number,boolean) are encoded as strings, others are erroneus Table values are any valid input-type Array-like tables are converted into JSON arrays... Position 1 maps to JSON Array position 0 json.decode (callable module referencing json.decode.decode)decode (data : string, strict : optional boolean) Takes in a string of JSON data and converts it into a Lua object If 'strict' is set, then the strict JSON rule-set is used json.utilUseful utilitiesnull Reference value to represent 'null' in a well-defined way to allow for null values to be inserted into an array/table undefined Reference value to represent 'undefined' in a well-defined way to allow for undefined values to be inserted into an array/table. IsArray (t : ANY) Checks if the passed in object is a plain-old-array based on whether or not is has the LuaJSON array metatable attached or the custom __is_luajson_array metadata key stored. InitArray(t: table) Sets the 'array' marker metatable to guarantee the table is represented as a LuaJSON array type. isCall (t : ANY) Checks if the passed in object is a LuaJSON call object. buildCall(name : string, ... parameters) Builds a call object with the given name and set of parameters. The name is stored in the 'name' field and the parameters in the 'parameters' field as an array. Additional Utilitiesclone (t : table) Shallow-clones a table by iterating using pairs and assigning. ___printValue (tab : ANY, name : string) recursively prints out all object values - if duplicates found, reference printed ___merge (t : table, ... : tables) Shallow-merges a sequence of tables onto table t by iterating over each using pairs and assigning. Internal Utilities - Not to UsedecodeCall doOptionMerge Attributionparsing test suite from JSON_checker project of http://www.json.org/ No listed license for these files in their package. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论