TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ calc_bson_entry_header_size()

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_entry_header_size ( const string_t &  name,
const BasicJsonType &  j 
)
inlinestaticprivate
Returns
The size of a BSON document entry header, including the id marker and the entry name size (and its null-terminator).

Definition at line 14787 of file json.hpp.

14788 {
14789 const auto it = name.find(static_cast<typename string_t::value_type>(0));
14790
14791 if (JSON_HEDLEY_UNLIKELY(it != BasicJsonType::string_t::npos))
14792 {
14793 JSON_THROW(out_of_range::create(409, "BSON key cannot contain code point U+0000 (at byte " + std::to_string(it) + ")", j));
14794 static_cast<void>(j);
14795 }
14796
14797 return /*id*/ 1ul + name.size() + /*zero-terminator*/1u;
14798 }