ahausladen / JsonDataObjects

JSON parser for Delphi 2009 and newer
MIT License
413 stars 160 forks source link

UInt64 support #24

Closed JayDi85 closed 8 years ago

JayDi85 commented 8 years ago

Can you add UInt64 support?

Some real time web-services like Periscope use Net Time Protocol data format. It's UInt64 (explain).

Example:

{
    "message": {
        "channel": "blablabla",
        "ntpForBroadcasterFrame": 14567816253328083,
        "ntpForLiveFrame": 14567816253328083,
        "participant_index": 1,
        "signature": "blablabla",
        "signer_str_ntpForBroadcasterFrame": "14567816253328083",
        "signer_str_ntpForLiveFrame": "14567816253328083"
    },
    "channel": "blablabla"
}

Wrong test code:

var
  s1, s2: string;
  json: TJsonObject;
begin
  s1 := '{"long_val":15744383709429629494,"long_str":"15744383709429629494"}';
  json := TJsonObject.Parse(s1) as TJsonObject;
  s2 := json.ToJSON;
  Assert(s1 = s2);
end;