Using Jansson library in a generic way

101 views
Skip to first unread message

Ashish

unread,
Apr 17, 2013, 7:44:30 PM4/17/13
to jansso...@googlegroups.com

Hi,

I am a newbie to Jannson and just downloaded the library 2.4 from json.org. I wrote small pieces of code to clear my understanding of the various APIs which 
jansson provides. I underrstand how the various APIs work , the ending /decoding stuff . Can someone tell me that 

1. Do we have a generic way of decoding and encoding the data from JSON. Like for eg. i am receiving some JSON data from a file stream . (Assuming this data will be different everytime), do we have a 
    generic code which will convert this JSON type of data to the C format for me ?

2. Same for the encoding . Maybe encoding part is still under our control since we know what we are sending out .

Any help is sincerely appreciated.

Thanks,
Ashish 

Petri Lehtinen

unread,
Apr 19, 2013, 2:42:19 AM4/19/13
to jansso...@googlegroups.com
There's no way to e.g. convert JSON automatically to a C struct,
because structs are statically defined at compile time. Jansson has
functions for traversing structured JSON data, and helpers for
extracting C values from JSON data with a known structure.

Petri

Ashish Juneja

unread,
Apr 30, 2013, 8:30:41 PM4/30/13
to jansso...@googlegroups.com
Thanks Petri for the response....



--
--
Jansson users mailing list
jansso...@googlegroups.com
http://groups.google.com/group/jansson-users
---
You received this message because you are subscribed to a topic in the Google Groups "Jansson users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jansson-users/fNZXJqNgtaE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to jansson-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages