![]() |
JSON Parser
1.0
|
| list_object* json_find_members_value_integer | ( | list_object * | json_data, |
| char * | member_name, | ||
| const boolean | partial_name, | ||
| const json_integer_t | minimum_value, | ||
| const json_integer_t | maximum_value, | ||
| const boolean | value_range | ||
| ) |
Using the provided search criteria, search the JSON data and locate all object members in the list hierarchy that match the criteria, returning them in a new list_object to the caller.
This function can only be called to search JSON Object Member names, and a number value criteria as well. To search for JSON Object Member names alone please refer to the function json_find_members_value_string() above.
For example, to search for all Object Members in the list hierarchy for a match with the partial name "PackageTags" and the number values between 0 and 100, could return such Members as "cachePackageTagsRefresh": 60, but not return "cachePackageTagsStore": 200,
This function may be called with an option to perform JSON Object Name number value matches on a single number or an inclusive range of the minimum and maximum numbers provided.
This function will only compare all JSON_integer value types. This function cannot evaluate numbers of different classes (non-integer and integer), if you require this or other more complicated searches of JSON data list hierarchies, you will have to write your own code to iterate through those list_objects and perform whatever evaluations you need.
JSON data elements with the value type JSON_float_str, may be evaluated by string comparison using json_find_members_value_string() above.
Upon return if Object Members were found that matched the search criteria, a list containing elements of the type json_member_list_t would be provided one element in the list for each match found. When the caller has finished with the list, it must erased with list_erase() and then freed.
| [in] | json_data | A D-List list_object that describes the JSON data to be searched. This can be a root list_object, or it can be any subordinate list_object within that hierarchy. It can be an Array or an Object list. The search is confined to the list(s) covered by this top level list_object. |
| [in] | member_name | Pointer to a nul terminated string to use as a match against the JSON Object Member names in the JSON data list. |
| [in] | partial_name | TRUE perform the search using member_name as a partial name match, FALSE perform the search looking only for a complete match with member_name. |
| [in] | minimum_value | A number to be used either as a direct match against the JSON Object Member number values in the JSON data list, or as a minimum for a range match. Only JSON Object Members that have already matched with member_name, and have the value type of JSON_integer will be evaluated against either the number or the range. |
| [in] | maximum_value | Optional number to to be used as a maximum number for a range match. Only JSON Object Members that have already matched with member_name, and have the value type of JSON_integer will be evaluated against the range provided. |
| [in] | value_range | TRUE perform the search using minimum_value and maximum_value as an inclusive range of numbers to value match. FALSE perform the search looking only for a match with the number in minimum_value. |
| list_object | contains the JSON Object Members found that matched the search criteria. This list was created with LIST_COPY_DATA option, so element's storage will be managed as described by D-List depending on what functions you use to access or manage this list. list_erase() will release ay internal and element storage remaining when called. |
| NULL | No JSON Object Members were found that matched the search criteria. No list_object was created. |