#cp.json
A collection of handy JSON tools.
#API Overview
Functions - API calls offered directly by the extension
#API Documentation
#Functions
Signature | cp.json.decode(jsonString) -> table |
Type | Function |
Description | Decodes JSON into a table |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | src/extensions/cp/json/init.lua line 83 |
Signature | cp.json.encode(val[, prettyprint]) -> string |
Type | Function |
Description | Encodes a table as JSON |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | src/extensions/cp/json/init.lua line 66 |
Signature | cp.json.prop(path, folder, filename, defaultValue[, errorCallbackFn]) -> cp.prop |
Type | Function |
Description | Returns a cp.prop instance for a JSON file. |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | src/extensions/cp/json/init.lua line 99 |
Signature | cp.json.read(path) -> table | nil |
Type | Function |
Description | Attempts to read the specified path as a JSON file. If the file cannot be found, nil is returned. If the file is not a JSON file, an error will occur. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/json/init.lua line 20 |
Signature | cp.json.write(path, data) -> boolean |
Type | Function |
Description | Writes data to a JSON file. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/json/init.lua line 40 |