CBA_fnc_parseJSON

Description

Deserializes a JSON string.

Parameters

_jsonString containing valid JSON.  STRING
_objectTypeSelects the type used for deserializing objects (optional) <BOOLEAN or NUMBER> 0, false: CBA namespace (default) 1, true: CBA hash 2: Native hash map

Returns

_objectThe deserialized JSON object or nil if JSON is invalid.  <LOCATION, ARRAY, STRING, NUMBER, BOOL, HASHMAP, NIL>

Examples

private _json = "{ ""enabled"": true }";
private _settings = [_json] call CBA_fnc_parseJSON;
private _enabled = _settings getVariable "enabled";

loadFile "data\config.json" call CBA_fnc_parseJSON
[preprocessFile "data\config.json", true] call CBA_fnc_parseJSON

Author

BaerMitUmlaut

string used by format
Close