tutorial.cpp: update for FindMember change

* use MemberIterator instead of plain pointer
 * check against MemberEnd() instead of NULL
This commit is contained in:
Philipp A. Hartmann 2014-07-03 15:04:04 +02:00
parent 86c47a6a8b
commit 78c75de22c

View File

@ -44,8 +44,8 @@ int main(int, char*[]) {
printf("hello = %s\n", document["hello"].GetString()); printf("hello = %s\n", document["hello"].GetString());
// Since version 0.2, you can use single lookup to check the existing of member and its value: // Since version 0.2, you can use single lookup to check the existing of member and its value:
Value::Member* hello = document.FindMember("hello"); Value::MemberIterator hello = document.FindMember("hello");
assert(hello != 0); assert(hello != document.MemberEnd());
assert(hello->value.IsString()); assert(hello->value.IsString());
assert(strcmp("world", hello->value.GetString()) == 0); assert(strcmp("world", hello->value.GetString()) == 0);
(void)hello; (void)hello;