Re: [fpc-pascal] JSON register new data types for custom output/input

2016-05-17 Thread Graeme Geldenhuys
On 2016-05-17 13:01, Michael Van Canneyt wrote: > JSONRTTI, RestBase can easily be enhanced to support a custom type registry: > > RegisterType(TypeInfo(TMySpecialType), @Reader, @Writer) That's what I had in mind. If I have a spare moment I'll take a look at that. Thanks for pointing me in the

Re: [fpc-pascal] JSON register new data types for custom output/input

2016-05-17 Thread Michael Van Canneyt
On Tue, 17 May 2016, Graeme Geldenhuys wrote: On 2016-05-17 12:23, Michael Van Canneyt wrote: There cannot be custom output in JSON, then it would no longer be JSON. JSON is a fixed defined format; it does not allow "deviation". Maybe you understood me wrong, or my output examples were rubb

Re: [fpc-pascal] pretty print json output

2016-05-17 Thread Graeme Geldenhuys
On 2016-05-17 12:12, Michael Van Canneyt wrote: > Yes. >FormatJSON() Fantastic, thanks Michael, Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Re: [fpc-pascal] JSON register new data types for custom output/input

2016-05-17 Thread Graeme Geldenhuys
On 2016-05-17 12:23, Michael Van Canneyt wrote: > There cannot be custom output in JSON, then it would no longer be JSON. > JSON is a fixed defined format; it does not allow "deviation". Maybe you understood me wrong, or my output examples were rubbish - you pick. ;-) I don't mean generating non-

Re: [fpc-pascal] JSON register new data types for custom output/input

2016-05-17 Thread Michael Van Canneyt
On Tue, 17 May 2016, Graeme Geldenhuys wrote: Hi, Is it possible (or on some wish list) to register new data types with fpjson so it can understand and generate custom output, and understand reading back that custom output. There cannot be custom output in JSON, then it would no longer be J

[fpc-pascal] JSON register new data types for custom output/input

2016-05-17 Thread Graeme Geldenhuys
Hi, Is it possible (or on some wish list) to register new data types with fpjson so it can understand and generate custom output, and understand reading back that custom output. eg: Current I write a TColor value to JSON and it results in: "BackgroundColor": -2147483648 Yes, technically that

Re: [fpc-pascal] pretty print json output

2016-05-17 Thread Michael Van Canneyt
On Tue, 17 May 2016, Graeme Geldenhuys wrote: Hi, Does fpjson support an option to “pretty print” (neatly indent) generated JSON output? Yes. FormatJSON() It is documented. Michael.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org ht

[fpc-pascal] pretty print json output

2016-05-17 Thread Graeme Geldenhuys
Hi, Does fpjson support an option to “pretty print” (neatly indent) generated JSON output? Regards, Graeme ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal