TJSON = class (TObject)
public
const
EmptyObject = '{}';
private
FObject :TJSONObject;
procedure Add(APath :String; AData :TJSONData);
function GetAJSON :String;
procedure SetAJSON (AData :String);
function GetBoolean (APath :String) :Boolean;
function GetUInt8 (APath :String) :UInt8;
function GetUInt16 (APath :String) :UInt16;
function GetUInt32 (APath :String) :UInt32;
function GetUInt64 (APath :String) :UInt64;
function GetInt8 (APath :String) :Int8;
function GetInt16 (APath :String) :Int16;
function GetInt32 (APath :String) :Int32;
function GetInt64 (APath :String) :Int64;
function GetSingle (APath :String) :Single;
function GetDouble (APath :String) :Double;
function GetExtended (APath :String) :Extended;
function GetCurrency (APath :String) :Currency;
function GetDateTime (APath :String) :TDateTime;
function GetGuid (APath :String) :TGuid;
function GetBytes (APath :String) :TBytes;
function GetString (APath :String) :String;
function GetObject (APath :String) :String;
procedure SetBoolean (APath :String; AData :Boolean);
procedure SetUInt8 (APath :String; AData :UInt8);
procedure SetUInt16 (APath :String; AData :UInt16);
procedure SetUInt32 (APath :String; AData :UInt32);
procedure SetUInt64 (APath :String; AData :UInt64);
procedure SetInt8 (APath :String; AData :Int8);
procedure SetInt16 (APath :String; AData :Int16);
procedure SetInt32 (APath :String; AData :Int32);
procedure SetInt64 (APath :String; AData :Int64);
procedure SetSingle (APath :String; AData :Single);
procedure SetDouble (APath :String; AData :Double);
procedure SetExtended (APath :String; AData :Extended);
procedure SetCurrency (APath :String; AData :Currency);
procedure SetDateTime (APath :String; AData :TDateTime);
procedure SetGuid (APath :String; AData :TGuid);
procedure SetBytes (APath :String; AData :TBytes);
procedure SetString (APath :String; AData :String);
procedure SetObject (APath :String; AData :String);
public
constructor Create;
destructor Destroy; override;
function AsFormat :String;
property AsJSON :String read GetAJSON write SetAJSON;
property AsBoolean [APath :String] :Boolean read GetBoolean write SetBoolean;
property AsUInt8 [APath :String] :UInt8 read GetUInt8 write SetUInt8;
property AsUInt16 [APath :String] :UInt16 read GetUInt16 write SetUInt16;
property AsUInt32 [APath :String] :UInt32 read GetUInt32 write SetUInt32;
property AsUInt64 [APath :String] :UInt64 read GetUInt64 write SetUInt64;
property AsInt8 [APath :String] :Int8 read GetInt8 write SetInt8;
property AsInt16 [APath :String] :Int16 read GetInt16 write SetInt16;
property AsInt32 [APath :String] :Int32 read GetInt32 write SetInt32;
property AsInt64 [APath :String] :Int64 read GetInt64 write SetInt64;
property AsSingle [APath :String] :Single read GetSingle write SetSingle;
property AsDouble [APath :String] :Double read GetDouble write SetDouble;
property AsExtended [APath :String] :Extended read GetExtended write SetExtended;
property AsCurrency [APath :String] :Currency read GetCurrency write SetCurrency;
property AsDateTime [APath :String] :TDateTime read GetDateTime write SetDateTime;
property AsGuid [APath :String] :TGuid read GetGuid write SetGuid;
property AsBytes [APath :String] :TBytes read GetBytes write SetBytes;
property AsString [APath :String] :String read GetString write SetString;
property AsObject [APath :String] :String read GetObject write SetObject;
property AsArray [APath :String] :String read GetObject write SetObject;
end;