[Cppcms-users] Is there any way to get a list of key values from a JSON object?
Brought to you by:
artyom-beilis
|
From: doug l. <bi...@gm...> - 2012-05-10 16:59:00
|
Hi -- if I had this json object:
{
"service": {
"api": "http",
"port": 3001
},
"http": {
"script_names": [ "/imageservice" ]
},
"imageservice": {
"secret": "sup3rs3cr3t",
"storage": "tmp",
"types": {
"test-type-1": {
"on_save": [ ".JPEG" ],
"versions": {
"big": [ "300x1000>" ],
"thumb": [ "75x75#" ],
"thumb-png": [ "75x75#", ".PNG" ]
}
},
"test-type-2": {
"on_save": [ "600x150!" ],
"versions": {
"gallery-jpeg": [ "50%", ".JPEG" ],
"gallery-png": [ "50%", ".PNG" ]
}
}
}
}
}
Would it be possible for me to query the JSON value object to find out that
there are two "type" values in the "imageservice" bit, and that those types
had keys of "test-type-1" and "test-type-2"?
I've been trying & failing to achieve this.
Thanks for any & all help,
Doug.
|