API:System.JSON.BSON.TBsonWriter.WriteEndArray

From RAD Studio API Documentation

Delphi

<source lang="delphi">

procedure WriteEndArray; override;

</source>

C++

<source lang="cpp">

virtual void __fastcall WriteEndArray();

</source>

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 an array. System.JSON.BSON.TBsonWriter.WriteEndArray inherits from System.JSON.Writers.TJsonWriter.WriteEndArray. All content below this line refers to System.JSON.Writers.TJsonWriter.WriteEndArray.

Writes the end of an array.

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

  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