mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
3fa40b8dc2
* Adding an example. * Updated other doc file. * Trying to take into account @jkeiser's comments. * Some people prefer empty final lines.
14 lines
447 B
C++
14 lines
447 B
C++
#include "simdjson.h"
|
|
|
|
int main(void) {
|
|
simdjson::dom::parser parser;
|
|
simdjson::dom::element tweets;
|
|
auto error = parser.load("twitter.json").get(tweets);
|
|
if(error) { std::cerr << error << std::endl; return EXIT_FAILURE; }
|
|
uint64_t identifier;
|
|
error = tweets["statuses"].at(0)["id"].get(identifier);
|
|
if(error) { std::cerr << error << std::endl; return EXIT_FAILURE; }
|
|
std::cout << identifier << std::endl;
|
|
return EXIT_SUCCESS;
|
|
}
|