JsonObjectBase.cpp 426 B

123456789101112131415161718192021222324
  1. /*
  2. * Arduino JSON library
  3. * Benoit Blanchon 2014 - MIT License
  4. */
  5. #include "JsonObjectBase.h"
  6. using namespace ArduinoJson::Parser;
  7. int JsonObjectBase::getNestedTokenCount(jsmntok_t* token)
  8. {
  9. int tokensToVisit = token->size;
  10. int count = 0;
  11. while (tokensToVisit)
  12. {
  13. count++;
  14. token++;
  15. tokensToVisit--;
  16. tokensToVisit += token->size;
  17. }
  18. return count;
  19. }