![]() |
JSON Parser
1.0
|
| list_object* json_find_members_value_type | ( | list_object * | json_data, |
| const char * | member_name, | ||
| const boolean | partial_name, | ||
| const JSON_value_types | value_type | ||
| ) |
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 value type 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 name "init-param" and the value type JSON_object could return such Members as "init-param": {
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] | value_type | A JSON value type to be used as a direct match against the JSON Object Member number value types in the JSON data list. Only JSON Object Members that have already matched with member_name, will be evaluated against supplied JSON value type. This can be ay valid JSON value type as defined in this header file above. |
| 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. |