MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / basic_json from_cbor

Function basic_json from_cbor

3rd/nlohmann_json/include/nlohmann/json.hpp:7734–7745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7732 */
7733 template<typename InputType>
7734 JSON_HEDLEY_WARN_UNUSED_RESULT
7735 static basic_json from_cbor(InputType&& i,
7736 const bool strict = true,
7737 const bool allow_exceptions = true,
7738 const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error)
7739 {
7740 basic_json result;
7741 detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions);
7742 auto ia = detail::input_adapter(std::forward<InputType>(i));
7743 const bool res = binary_reader<decltype(ia)>(std::move(ia)).sax_parse(input_format_t::cbor, &sdp, strict, tag_handler);
7744 return res ? result : basic_json(value_t::discarded);
7745 }
7746
7747 /*!
7748 @copydoc from_cbor(InputType&&, const bool, const bool, const cbor_tag_handler_t)

Callers

nothing calls this directly

Calls 3

basic_jsonFunction · 0.70
input_adapterFunction · 0.50
sax_parseMethod · 0.45

Tested by

no test coverage detected