json-c
0.11
|
json-c forces clients to use its private data structures for JSON Object iteration. This API corrects that by abstracting the private json-c details. More...
Data Structures | |
struct | json_object_iterator |
Functions | |
struct json_object_iterator | json_object_iter_init_default (void) |
struct json_object_iterator | json_object_iter_begin (struct json_object *obj) |
struct json_object_iterator | json_object_iter_end (const struct json_object *obj) |
void | json_object_iter_next (struct json_object_iterator *iter) |
const char * | json_object_iter_peek_name (const struct json_object_iterator *iter) |
struct json_object * | json_object_iter_peek_value (const struct json_object_iterator *iter) |
json_bool | json_object_iter_equal (const struct json_object_iterator *iter1, const struct json_object_iterator *iter2) |
json-c forces clients to use its private data structures for JSON Object iteration. This API corrects that by abstracting the private json-c details.
Copyright (c) 2009-2012 Hewlett-Packard Development Company, L.P.
This library is free software; you can redistribute it and/or modify it under the terms of the MIT license. See COPYING for details.
API attributes:
|
read |
Retrieves an iterator to the first pair of the JSON Object.
obj | JSON Object instance (MUST be of type json_object) |
|
read |
Retrieves the iterator that represents the position beyond the last pair of the given JSON Object instance.
obj | JSON Object instance (MUST be of type json_object) |
json_bool json_object_iter_equal | ( | const struct json_object_iterator * | iter1, |
const struct json_object_iterator * | iter2 | ||
) |
Tests two iterators for equality. Typically used to test for end of iteration by comparing an iterator to the corresponding "end" iterator (that was derived from the same JSON Object instance).
iter1 | Pointer to first valid, non-NULL iterator |
iter2 | POinter to second valid, non-NULL iterator |
|
read |
Initializes an iterator structure to a "default" value that is convenient for initializing an iterator variable to a default state (e.g., initialization list in a class' constructor).
void json_object_iter_next | ( | struct json_object_iterator * | iter | ) |
Returns an iterator to the next pair, if any
iter | [IN/OUT] Pointer to iterator that references a name/value pair; MUST be a valid, non-end iterator. WARNING: bad things will happen if invalid or "end" iterator is passed. Upon return will contain the reference to the next pair if there is one; if there are no more pairs, will contain the "end" iterator value, which may be compared against the return value of json_object_iter_end() for the same JSON Object instance. |
const char* json_object_iter_peek_name | ( | const struct json_object_iterator * | iter | ) |
Returns a const pointer to the name of the pair referenced by the given iterator.
iter | pointer to iterator that references a name/value pair; MUST be a valid, non-end iterator. |
|
read |
Returns a pointer to the json-c instance representing the value of the referenced name/value pair, without altering the instance's reference count.
iter | pointer to iterator that references a name/value pair; MUST be a valid, non-end iterator. |