Closed nscnd closed 3 years ago
Well, it's kind of by design. If you iterate over an object, you can use json_object_iter_set
to modify the object via the iterator, or json_object_iter_value
to grab a non-const json_t *
to modify a value contained in the object. This could perhaps be circumvented by adding a separate "constant iterator" type and iteration functions that work with constant iterators.
Thanks for your answer, it make senses when you put it like that. If I find the time I'll try to cook something up along those lines. Cheers,
Hi there,
First let me start by the fact that I love this library and it's simplicity. But the thing I find myself missing is a way to iterate over the key/value of a
const json_t *
object.json_object_foreach
expands tojson_object_iter
which doesn't take aconst json_t *
Is there a way to acheive this ? Is this feature missing ? Is it by design ?Thanks for any help on this matter.