JSON Parser  1.0
list_object* json_path_to_list_object ( list_object *  json_data,
const char *  path 
)

Convert a JSON dotted notation path to a list_object for that path.

This function performs the work of converting a textural JSON dotted notation path, into first a json_member_list_t set of path segments and then returning the specific list_object needed to access the original item the JSON dotted notation path was meant to describe.

If the path is invalid, or describes a path that does not exist, various error messages will be output to sdterr, and a NULL pointer is returned to the caller.

The path is always followed strictly, if a segment of the path is not found an error is produced and NULL returned. If you wish to have the path converted by using the fuzzy search option available in the lower level functions, you will have to write the calls to those functions yourself. It was felt that making the fuzzy search option available in a general purpose conversion tools was too error prone for users.

If the JSON path you wish to locate is an absolute path, then you must also provide the root list_object for that JSON data block, or the search will fail, as absolute paths must originate from the top of the JSON tree. This function makes no distinction between absolute and relative paths, but the starting point will always dictate how successful a search is going to be.

The returned list object pointer can to be used as an argument in any of the json_list_object_xxx() or json_find_xxx() functions, as well as any D-List functions that you wish to use to access, manage, or update the data within that JSON Object or Array at the end of the original path.

This function performs the same sequence a user would have to call, it just removed the work from their code.

Parameters
[in]json_dataA 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]pathpointer to a nul terminated character array that contains the JSON dotted notation path to be converted.
Return values
pointerto the list object that represents that JSON path object
NULLof there was an error, or the path was invalid.