interface
{$IF defined(DELPHI_2010) or defined(DELPHI_XE)}
TJsonAncestorHelper = class helper for TJsonAncestor
public
function ToJson(): string;
end;
{$IFEND}
implementation
{ TJsonAncestorHelper }
{$IF defined(DELPHI_2010) or defined(DELPHI_XE)}
function TJsonAncestorHelper.ToJson: string;
var
bytes: TBytes;
len: Integer;
begin
SetLength(bytes, Self.EstimatedByteSize);
len := Self.ToBytes(bytes, 0);
Result := TEncoding.ASCII.GetString(bytes, 0, len);
end;
{$IFEND}
interface {$IF defined(DELPHI_2010) or defined(DELPHI_XE)} TJsonAncestorHelper = class helper for TJsonAncestor public function ToJson(): string; end; {$IFEND} implementation { TJsonAncestorHelper } {$IF defined(DELPHI_2010) or defined(DELPHI_XE)} function TJsonAncestorHelper.ToJson: string; var bytes: TBytes; len: Integer; begin SetLength(bytes, Self.EstimatedByteSize); len := Self.ToBytes(bytes, 0); Result := TEncoding.ASCII.GetString(bytes, 0, len); end; {$IFEND}