Forum Navigation
Looping through JsonObject attributes is cumbersome
Moderators:
kris
Posted: 04/01/09 12:38:31Using foreach for the attributes in a JsonObject? is a bit unwieldy:
void main() { auto json = new Json!(char); json.parse(import("test.json")); foreach (char[] key, Json!(char).Value val ; *json.value.toObject()) { Stdout("key: ")(key).newline; Stdout("value type: ")(val.type).newline; } }Not very pretty. Makes one wonder if anyone even uses this part of Tango.