We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I develop some function for parse JSON easier. assume the below json:
{ "episodes" : [ { "title" : "First Movie", "cover" : "https://example.com/banner1.jpg", "imdb_rate" : 3.4, "comments" : ["great", "not good", "best movie"] }, { "title" : "Second Movie", "cover" : "https://example.com/banner2.jpg", "imdb_rate" : 6, "comments" : ["great", "not good", "best movie"] } ], "success" : true }
you can easily access to title of Second Movie with this function
Second Movie
jsonp(obj, "episodes[].title", 1).string
or for get third comment of first movie you can
jsonp(obj, "eposides[].comments[]",0,2).string
for print all cover url with imdb rate you can:
for (int i = 0; i < jsonp_length(obj, "episodes[]"); i++) { char* cover = jsonp(obj, "episodes[].cover", i).string; int rate = jsonp(obj, "episode[].imdb_rate", i).number; printf("url: %s, rate: %d", cover, rate); }
can I pull request it to merge on json-c library?
The text was updated successfully, but these errors were encountered:
We already have http://json-c.github.io/json-c/json-c-0.16/doc/html/json__pointer_8h.html, aka JSON Pointer, aka RFC6901
Sorry, something went wrong.
No branches or pull requests
I develop some function for parse JSON easier.
assume the below json:
you can easily access to title of
Second Movie
with this functionor for get third comment of first movie you can
for print all cover url with imdb rate you can:
can I pull request it to merge on json-c library?
The text was updated successfully, but these errors were encountered: