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

De RAD Studio API Documentation
Aller à : navigation, rechercher
m (1 version : Iamworthyandhappy2015LOC-21990)
m (1 version : March 10, 2016 Translation package. LOC-21990)
 
(Une révision intermédiaire par le même utilisateur non affichée)
(Aucune différence)

Version actuelle datée du 15 mars 2016 à 08:55

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