Forums > Dev

jsonreader_parse()

October 1, 2010 | 9:53 am

Hi MaxDevelopers !

The SDK documentation in the chapter "dictionaries" mention a function jsonreader_parse() which, I guess is able to parse JSON files. For one of my externals, I would like to parse a JSON file but not fetch it in a dictionary structure (I have a custom data structure). So I would very much like to use such a function instead of writing my own parser…
But I can’t find any documentation about this jsonreader_parse() (neither can I even find the prototype of it).

Is it yet possible to use this function ? How do I use it ?

Thank’s


October 5, 2010 | 2:06 pm

In Max we do everything with dictionaries, and jsonreader_parse() is an internal implementation that is setup to work with dictionaries. If you would like to work with custom data structure serialization then you will need to write or find a parser such as those at http://json.org .

Cheers


October 5, 2010 | 5:09 pm

You may find it easier to just load into a dictionary and iterate across its values to convert it to your structure.


October 5, 2010 | 6:08 pm

Thank’s for your replies and info !

I’ll see what I do. I’m not decided yet…
(I’ve already written a parser of my own using Bison (to read DOT files) so it may be as easy to use Bison to generate a JSON parser as to load in a dictionary and then iterate across. Maybe not).
I’ll keep you posted anyway.

Cheers


Viewing 4 posts - 1 through 4 (of 4 total)