Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-07

jsonrtti and integer arrays

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hello,

I see that according to http://wiki.freepascal.org/Streaming_JSON one can use TStringList for an array of strings, but this seams to work only for writing JSON, is it possible to read array of strings?

And how to read an array of integers?

Also, can my json be an array instead of an object?

A non-rtti simple example would also be good, since it looks like that the rtti version cannot read arrays.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Michael Van Canneyt
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
Hello, I see that according to http://wiki.freepascal.org/Streaming_JSON one can use TStringList for an array of strings, but this seams to work

Small linguistic intermezzo: "seems".

"seams" exists, but is something different :)

only for writing JSON, is it possible to read array of strings?

Currently not, although I have somewhere code to do this.

And how to read an array of integers?

Currently it is not, but I already have code to do this (see restbase unit in fcl-web).

Also, can my json be an array instead of an object?

In what sense ?

A non-rtti simple example would also be good, since it looks like that the rtti version cannot read arrays.

Yes, I should improve the unit, I have several ideas and already partial implementations to improve it. Ideally, the code in restbase should be replaced with calls to rttiutils.

Michael.

Reply by email