MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / size

Method size

extern/json/json.hpp:4694–4722  ·  view source on GitHub ↗

! @brief returns the number of elements Returns the number of elements in a JSON value. @return The return value depends on the different types and is defined as follows: Value type | return value ----------- | ------------- null | `0` boolean | `1` string | `1` number | `1`

Source from the content-addressed store, hash-verified

4692 @since version 1.0.0
4693 */
4694 size_type size() const noexcept
4695 {
4696 switch (m_type)
4697 {
4698 case value_t::null:
4699 {
4700 // null values are empty
4701 return 0;
4702 }
4703
4704 case value_t::array:
4705 {
4706 // delegate call to array_t::size()
4707 return m_value.array->size();
4708 }
4709
4710 case value_t::object:
4711 {
4712 // delegate call to object_t::size()
4713 return m_value.object->size();
4714 }
4715
4716 default:
4717 {
4718 // all other types have size 1
4719 return 1;
4720 }
4721 }
4722 }
4723
4724 /*!
4725 @brief returns the maximum possible number of elements

Callers 14

basic_jsonMethod · 0.45
get_implMethod · 0.45
operator[]Method · 0.45
push_backMethod · 0.45
escape_stringMethod · 0.45
fill_line_bufferMethod · 0.45
get_uncheckedMethod · 0.45
get_checkedMethod · 0.45
splitMethod · 0.45
replace_substringMethod · 0.45
flattenMethod · 0.45
patchMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected