Convert JSON data to YAML format
Source position: json2yaml.pp line 54
public procedure TJSONToYaml.Convert( |
JSON: TJSONData; |
aOutput: TStream |
); |
JSON |
|
Source JSON data to convert |
aOutput |
|
Target stream for YAML output |
The Convert method converts the provided JSON data structure to YAML format and writes the result to the specified output stream. The method handles all JSON data types: objects, arrays, strings, numbers, booleans, and null values.
The conversion process uses the current IndentSize setting for proper YAML indentation. If AddHeader is True, a YAML document separator (---) is written at the beginning of the output.
Objects are converted to YAML mappings with key-value pairs, arrays become YAML sequences with list items prefixed by dashes, and scalar values are converted to their string representations.
|
Controls whether to add YAML document header |
|
|
Number of spaces used for indentation |