MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / calc_bson_array_size

Method calc_bson_array_size

Source/external/json.hpp:16022–16032  ·  view source on GitHub ↗

! @return The size of the BSON-encoded array @a value */

Source from the content-addressed store, hash-verified

16020 @return The size of the BSON-encoded array @a value
16021 */
16022 static std::size_t calc_bson_array_size(const typename BasicJsonType::array_t& value)
16023 {
16024 std::size_t array_index = 0ul;
16025
16026 const std::size_t embedded_document_size = std::accumulate(std::begin(value), std::end(value), static_cast<std::size_t>(0), [&array_index](std::size_t result, const typename BasicJsonType::array_t::value_type & el)
16027 {
16028 return result + calc_bson_element_size(std::to_string(array_index++), el);
16029 });
16030
16031 return sizeof(std::int32_t) + embedded_document_size + 1ul;
16032 }
16033
16034 /*!
16035 @return The size of the BSON-encoded binary array @a value

Callers

nothing calls this directly

Calls 3

beginFunction · 0.85
endFunction · 0.85
to_stringFunction · 0.70

Tested by

no test coverage detected