MCPcopy Create free account
hub / github.com/BayshoreNetworks/yextend / parse_json_string

Function parse_json_string

main.cpp:409–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407
408
409json parse_json_string(std::string j_dat) {
410
411 json j_null;
412 try {
413 auto j = json::parse(j_dat);
414 return j;
415 } catch (nlohmann::detail::type_error & e) {
416 std::cout << json_type_error << " : " << e.what() << std::endl;
417 } catch (nlohmann::detail::parse_error const& e) {
418 std::cout << json_parse_error << " : " << e.what() << std::endl;
419 } catch (nlohmann::detail::invalid_iterator const& e) {
420 std::cout << json_invalid_iterator_error << " : " << e.what() << std::endl;
421 } catch (nlohmann::detail::out_of_range const& e) {
422 std::cout << json_out_of_range_error << " : " << e.what() << std::endl;
423 } catch (nlohmann::detail::other_error const& e) {
424 std::cout << json_other_error << " : " << e.what() << std::endl;
425 } catch (nlohmann::detail::exception const& e) {
426 std::cout << json_exception << " : " << e.what() << std::endl;
427 }
428 return j_null;
429
430}
431
432///////////////////////////////////////////////////////////////
433

Callers 1

mainFunction · 0.85

Calls 2

parseFunction · 0.85
whatMethod · 0.80

Tested by

no test coverage detected