Skip to content

Commit

Permalink
The property AsInt64 of TJsonNumber was included from Delphi XE2. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciocolombo authored and alex-taylor-ioof committed Feb 2, 2014
1 parent 28ec7a9 commit 2457a27
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/DBXJsonHelpers.pas
Expand Up @@ -24,7 +24,7 @@ TJsonValueHelper = class helper for TJsonValue
function AsJsonArray: TJSONArray;
end;

{$IFDEF DELPHI_2010}
{$IF defined(DELPHI_2010) or defined(DELPHI_XE)}
TJsonObjectHelper = class helper for TJsonObject
public
function Get(const PairName: UnicodeString): TJSONPair; overload;
Expand All @@ -35,7 +35,7 @@ TJsonNumberHelper = class helper for TJsonNumber
public
function AsInt64: Int64;
end;
{$ENDIF}
{$IFEND}

TRttiFieldHelper = class helper for TRttiField
public
Expand Down Expand Up @@ -120,7 +120,7 @@ function TRttiFieldHelper.GetFieldName: string;
Result := Name;
end;

{$IFDEF DELPHI_2010}
{$IF defined(DELPHI_2010) or defined(DELPHI_XE) }
{ TJsonObjectHelper }

function TJsonObjectHelper.Get(const PairName: UnicodeString): TJSONPair;
Expand All @@ -142,8 +142,8 @@ class function TJsonObjectHelper.ParseJSONValue(const Data: String): TJSONValue;
function Sanitize(AData: String): string;
begin
Result := AData;
Result := StringReplace(Result, '" :', '":', [rfReplaceAll]);
Result := StringReplace(Result, '": ', '":', [rfReplaceAll]);
//Result := StringReplace(Result, '" : ', '":', [rfReplaceAll]);
// Result := StringReplace(Result, '": ', '":', [rfReplaceAll]);
end;

var
Expand All @@ -161,6 +161,6 @@ function TJsonNumberHelper.AsInt64: Int64;
Result := StrToInt64(ToString);
end;

{$ENDIF}
{$IFEND}

end.

0 comments on commit 2457a27

Please sign in to comment.