Closed GoogleCodeExporter closed 8 years ago
Sorry that examples are insufficient at the moment.
I think line 483-493 of
http://code.google.com/p/rapidjson/source/browse/trunk/test/unittest/valuetest.c
pp
may do what you need:
// member iterator
Value::MemberIterator itr = x.MemberBegin();
EXPECT_TRUE(itr != x.MemberEnd());
EXPECT_STREQ("A", itr->name.GetString());
EXPECT_STREQ("Apple", itr->value.GetString());
++itr;
EXPECT_TRUE(itr != x.MemberEnd());
EXPECT_STREQ("B", itr->name.GetString());
EXPECT_STREQ("Banana", itr->value.GetString());
++itr;
EXPECT_FALSE(itr != x.MemberEnd());
Basically if x is an object type value, then you can iterate it with the
iterators returned by MemberBegin() and MemberEnd(). And then you can access
the name and value of each member via the iterator.
Original comment by milo...@gmail.com
on 31 Jan 2012 at 7:47
I was also stuck at this issue. Hope you add it soon to the tutorial example.
Thanks for such a great parser!
Original comment by niranjan...@gmail.com
on 8 May 2012 at 4:04
Original comment by milo...@gmail.com
on 14 Nov 2012 at 2:54
Original comment by milo...@gmail.com
on 20 Jun 2014 at 8:28
Original issue reported on code.google.com by
waldoalv...@gmail.com
on 13 Jan 2012 at 4:07