TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ calc_bson_object_size()

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_object_size ( const typename BasicJsonType::object_t &  value)
inlinestaticprivate

Calculates the size of the BSON serialization of the given JSON-object j.

Parameters
[in]valueJSON value to serialize
Precondition
value.type() == value_t::object

Definition at line 15085 of file json.hpp.

15086 {
15087 std::size_t document_size = std::accumulate(value.begin(), value.end(), std::size_t(0),
15088 [](size_t result, const typename BasicJsonType::object_t::value_type & el)
15089 {
15090 return result += calc_bson_element_size(el.first, el.second);
15091 });
15092 return sizeof(std::int32_t) + document_size + 1ul;
15093 }
@ value
the parser finished reading a JSON value