MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / size

Function size

src/include/nlohmann/json.hpp:2974–3009  ·  view source on GitHub ↗

@brief returns the number of elements @sa https://json.nlohmann.me/api/basic_json/size/

Source from the content-addressed store, hash-verified

2972 /// @brief returns the number of elements
2973 /// @sa https://json.nlohmann.me/api/basic_json/size/
2974 size_type size() const noexcept
2975 {
2976 switch (m_data.m_type)
2977 {
2978 case value_t::null:
2979 {
2980 // null values are empty
2981 return 0;
2982 }
2983
2984 case value_t::array:
2985 {
2986 // delegate call to array_t::size()
2987 return m_data.m_value.array->size();
2988 }
2989
2990 case value_t::object:
2991 {
2992 // delegate call to object_t::size()
2993 return m_data.m_value.object->size();
2994 }
2995
2996 case value_t::string:
2997 case value_t::boolean:
2998 case value_t::number_integer:
2999 case value_t::number_unsigned:
3000 case value_t::number_float:
3001 case value_t::binary:
3002 case value_t::discarded:
3003 default:
3004 {
3005 // all other types have size 1
3006 return 1;
3007 }
3008 }
3009 }
3010
3011 /// @brief returns the maximum possible number of elements
3012 /// @sa https://json.nlohmann.me/api/basic_json/max_size/

Callers 6

bufferClass · 0.85
endMethod · 0.85
memsetMethod · 0.85
copy_fromMethod · 0.85
eraseFunction · 0.85
max_sizeFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected