MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / write_bson

Method write_bson

Source/Utils/json.hpp:12772–12787  ·  view source on GitHub ↗

! @param[in] j JSON value to serialize @pre j.type() == value_t::object */

Source from the content-addressed store, hash-verified

12770 @pre j.type() == value_t::object
12771 */
12772 void write_bson(const BasicJsonType& j)
12773 {
12774 switch (j.type())
12775 {
12776 case value_t::object:
12777 {
12778 write_bson_object(*j.m_value.object);
12779 break;
12780 }
12781
12782 default:
12783 {
12784 JSON_THROW(type_error::create(317, "to serialize to BSON, top-level type must be object, but is " + std::string(j.type_name())));
12785 }
12786 }
12787 }
12788
12789 /*!
12790 @param[in] j JSON value to serialize

Callers 1

to_bsonFunction · 0.80

Calls 3

createFunction · 0.85
typeMethod · 0.80
type_nameMethod · 0.80

Tested by

no test coverage detected