Creating

<< Click to Display Table of Contents >>

Navigation:  JSON >

Creating

To create a new empty JSON object or array use .Create('{}') or .Create('[]');

 

Adding values to array

 

  function Add(const AValue: hstring): PHtJSON; 
  function Add(const AValue: Int64): PHtJSON; 
  function Add(const AValue: TValue): PHtJSON; 
  function Add(AObject: TObject; AsList: boolean = false;
    AVisibility: TMemberVisibilities = [mvPublic, mvPublished]): PHtJSON; 
  function Add(const AValue: PHtJSON): PHtJSON; 
  function AddObject: PHtJSON; 
  function AddArray: PHtJSON;

 

Adding pairs to object

 

  function AddPair(const AKey, AValue: hstring): PHtJSON; 
  function AddPair(const AKey: hstring; AValue: Int64): PHtJSON; 
  function AddPair(const AKey: hstring; AValue: boolean): PHtJSON; 
  function AddPair(const AKey: hstring; const AValue: double): PHtJSON; 
  function AddPair(const AKey: hstring; const AValue: TDateTime): PHtJSON; 
  function AddPair(const AKey: hstring; AValue: TObject; AsList: boolean = false;
    AVisibility: TMemberVisibilities = [mvPublic, mvPublished]): PHtJSON; 
  function AddPair(const AKey: hstring; const AValue: TValue): PHtJSON; 
  function AddPairArray<T>(const AKey: hstring; const AValue: TArray<T>): PHtJSON;
  function AddPair(const AKey: hstring; AValue: PHtJSON): PHtJSON; 
  function AddPair(const AKey: hstring; const AValue: TBytes): PHtJSON; 

 

Deleting nodes

 

  procedure Delete(AIndex: integer); 
  procedure Delete(const AName: hstring);