Unit 'fpjson' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#fcl]

TJSONData.FormatJSON

Return a formatted JSON representation of the data.

Declaration

Source position: fpjson.pp line 177

public function TJSONData.FormatJSON(

  Options: TFormatOptions = DefaultFormat;

  Indentsize: Integer = DefaultIndentSize

):TJSONStringType;

Arguments

Options

  

Formatting options to apply.

Indentsize

  

Amount of indent to use when starting new lines.

Function result

The JSON representation of the instance.

Description

FormatJSON returns a formatted JSON representation of the data. For simple JSON values, this is the same representation as the AsJSON property, but for complex values (TJSONArray and TJSONObject) the JSON is formatted differently.

There are some optional parameters to control the formatting. Options controls the use of whitespace and newlines. IndentSize controls the amount of indent applied when starting a new line.

The implementation is not optimized for speed.

See also

AsJSON

  

Return a JSON representation of the value.

TFormatOptions

  

Set of TFormatOption options.


Documentation generated on: Dec 27 2024