CreateJSON¶
Create a JSON data item.
Declaration¶
Source position: fpjson.pp line 810
function CreateJSON : TJSONNull;
function CreateJSON(Data: Boolean) : TJSONBoolean;
function CreateJSON(Data: Integer) : TJSONIntegerNumber;
function CreateJSON(Data: Int64) : TJSONInt64Number;
function CreateJSON(Data: QWord) : TJSONQWordNumber;
function CreateJSON(Data: TJSONFloat) : TJSONFloatNumber;
function CreateJSON(const Data: TJSONStringType) : TJSONString;
function CreateJSON(const Data: TJSONUnicodeStringType) : TJSONString;
Description¶
CreateJSON will create a JSON Data item depending on the type of data passed to it, and will use the classes returned by GetJSONInstanceType to do so. The classes to be used can be set using the SetJSONInstanceType.
The JSON parser uses these functions to create instances of TJSONData.
Errors¶
None.
See also¶
| Name | Description |
|---|---|
| GetJSONInstanceType | JSON factory: Get the JSONData class types to use. |
| SetJSONInstanceType | JSON factory: Set the JSONData class types to use. |
| GetJSON | Convert JSON string to JSON data structure. |
| CreateJSONArray | Create a JSON array. |
| CreateJSONObject | Create a JSON object. |