A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arduinojson.org/v6/api/jsondocument/size/ below:

JsonDocument::size() | ArduinoJson 6

Description

If the root of the JsonDocument is an object, JsonDocument::size() returns the number of key-value pairs in the object (same as JsonObject::size())

If the root of the JsonDocument is an array, JsonDocument::size() returns the number of elements in the array (same as JsonArray::size())

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

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

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

Signature Example
StaticJsonDocument<200> doc;
object["hello"] = "world";
Serial.println(object.size()); // 1
See also
  1. Home
  2. Version 6
  3. API
  4. JsonDocument
  5. size()

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4