simdjson/examples/quickstart/quickstart_ondemand.cpp

10 lines
354 B
C++
Raw Normal View History

2020-12-25 06:59:58 +08:00
#include "simdjson.h"
using namespace simdjson;
using namespace simdjson::builtin; // for ondemand
int main(void) {
ondemand::parser parser;
padded_string json = padded_string::load("twitter.json");
ondemand::document tweets = parser.iterate(json);
std::cout << uint64_t(tweets["search_metadata"]["count"]) << " results." << std::endl;
}