1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-25 13:41:56 +03:00

🔨 using the SAX-DOM parser

This commit is contained in:
Niels Lohmann
2018-03-06 18:17:07 +01:00
parent faf2546a15
commit 5beab80553
6 changed files with 173 additions and 166 deletions

View File

@ -148,9 +148,10 @@ json parser_helper(const std::string& s)
CHECK_NOTHROW(json::parser(nlohmann::detail::input_adapter(s), nullptr, false).parse(true, j_nothrow));
CHECK(j_nothrow == j);
nlohmann::json_sax_dom_parser<json> sdp;
json j_sax;
nlohmann::json_sax_dom_parser<json> sdp(j_sax);
json::sax_parse(s, &sdp);
CHECK(sdp.get_value() == j);
CHECK(j_sax == j);
return j;
}