On Sat, 21 Jul 2018, Sven Barth via Lazarus wrote:

=== code begin ===

s := streamer.RecordToJSONString(@t1, TypeInfo(t1));
// becomes
s := streamer.specialize RecordToJSONString<TMyRecord>(t1);

destreamer.JSONToRecord(s, @t2, TypeInfo(t2));
// becomes
destreamer.specialize JSONToRecord<TMyRecord>(s, t2);

=== code end ===

@Michael: maybe we can integrate this in fpjsonrtti directly?


:-) :-) :-)

I am glad you proposed it, saves me the trouble of asking it. I was planning to extend JSONRTTI so it can handle more cases (I want to replace the rest JSON handling with it), so this can definitely be included.

I'll study your code and get back to you. Thanks for the sample code !! :)

Michael.
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to