API:System.JSON.BSON.TBsonWriter.WriteEndObject

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure WriteEndObject; override;

C++

virtual void __fastcall WriteEndObject();

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.JSON.BSON.pas
System.JSON.BSON.hpp
System.JSON.BSON TBsonWriter

Description

Writes the end of a JSON object.

System.JSON.BSON.TBsonWriter.WriteEndObject inherits from System.JSON.Writers.TJsonWriter.WriteEndObject. All content below this line refers to System.JSON.Writers.TJsonWriter.WriteEndObject.

Writes the end of a JSON object.

See the code snippet below to illustrate the use of WriteEndObject:

  Writer.WriteStartObject;
  Writer.WritePropertyName('colors');
  Writer.WriteStartArray;
  Writer.WriteStartObject;
  Writer.WriteComment('Hexadecimal value for the red color');
  Writer.WritePropertyName('name');
  Writer.WriteValue('red');
  Writer.WritePropertyName('hex');
  Writer.WriteValue('#f00');
  Writer.WriteEndObject;
  Writer.WriteEndArray;
{
  "colors": [
    {
      /*Hexadecimal value for the red color*/
      "name": "red",
      "hex": "#f00"
    }
  ]
}

See Also