MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / basic_json from_cbor

Function basic_json from_cbor

Source/Utils/json.hpp:23958–23969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23956 */
23957 template<typename InputType>
23958 JSON_HEDLEY_WARN_UNUSED_RESULT
23959 static basic_json from_cbor(InputType&& i,
23960 const bool strict = true,
23961 const bool allow_exceptions = true,
23962 const cbor_tag_handler_t tag_handler = cbor_tag_handler_t::error)
23963 {
23964 basic_json result;
23965 detail::json_sax_dom_parser<basic_json> sdp(result, allow_exceptions);
23966 auto ia = detail::input_adapter(std::forward<InputType>(i));
23967 const bool res = binary_reader<decltype(ia)>(std::move(ia)).sax_parse(input_format_t::cbor, &sdp, strict, tag_handler);
23968 return res ? result : basic_json(value_t::discarded);
23969 }
23970
23971 /*!
23972 @copydoc from_cbor(detail::input_adapter&&, const bool, const bool, const cbor_tag_handler_t)

Callers

nothing calls this directly

Calls 3

input_adapterFunction · 0.85
sax_parseMethod · 0.80
basic_jsonFunction · 0.70

Tested by

no test coverage detected