[Overview][Constants][Types][Classes][Procedures and functions][Index] |
Convert JSON string to JSON data structure
Source position: fpjson.pp line 590
function GetJSON( |
const JSON: TJSONStringType; |
const UseUTF8: Boolean = True |
):TJSONData; |
const JSON: TStream; |
const UseUTF8: Boolean = True |
):TJSONData; |
JSON |
|
The JSON to parse. |
UseUTF8 |
|
Convert unicode characters to UTF-8 |
The TJSONData data (tree) represented by JSON
JSON |
|
The JSON to parse. |
UseUTF8 |
|
Convert unicode characters to UTF-8 |
GetJSON will read the JSON argument (a string or stream that contains a valid JSON data representation) and converts it to native JSON objects. The stream must be positioned on the start of the JSON.
The fpJSON unit does not contain a JSON parser. The jsonparser unit does contain a JSON parser, and must be included once in the project to be able to parse JSON. The jsonparser unit uses the SetJSONParserHandler call to set a callback that is used by GetJSON to parse the data.
If UseUTF8 is set to true, then unicode characters will be encoded as UTF-8. Otherwise, they are converted to the nearest matching ansi character.
An exception will be raised if the JSON data stream does not contain valid JSON data.
|
Get the current JSON parser handler |
|
|
Set the JSON parser handler |
|
|
Base (abstract) object for all JSON based data types |