Description

If the JsonVariant points to an object, JsonVariant::size() returns the number of key-value pairs in the object (same as JsonObject::size())

If the JsonVariant points to an array, JsonVariant::size() returns the number of elements in the array (same as JsonArray::size())

In all other cases, JsonVariant::size() returns 0

Internally, this function walks a linked-list to count the elements, so its time complexity is O(n).

Don’t confuse JsonVariant::size() with JsonVariant::memoryUsage().

Signature

size_t size() const;

See also

Global warming stripes by Professor Ed Hawkins (University of Reading)