fabriciocolombo / delphi-rest-client-api

A Delphi REST client API to consume REST services written in any programming language.
Apache License 2.0
380 stars 182 forks source link

Append TJsonAncestor.ToJSON in XE fix. #103

Open Eden5Wu opened 6 years ago

Eden5Wu commented 6 years ago

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}