System.JSON.Writers.TJsonTextWriter.WriteStartObject : Différence entre versions

De RAD Studio API Documentation
Aller à : navigation, rechercher
(Iamworthyandhappy2015LOC-21990)
 
m (1 version : Iamworthyandhappy2015LOC-21990)
(Aucune différence)

Version du 15 mars 2016 à 08:41

Delphi

procedure WriteStartObject; override;

C++

virtual void __fastcall WriteStartObject();

Propriétés

Type Visibilité  Source Unité  Parent
procedure
function
public
System.JSON.Writers.pas
System.JSON.Writers.hpp
System.JSON.Writers TJsonTextWriter


Description

Ecrit le début d'un objet JSON.

Voir l'extrait de code ci-dessous pour illustrer l'utilisation de WriteStartObject :

  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"
    }
  ]
}

Voir aussi