JsonObjectBase.cpp 338 B

12345678910111213141516171819
  1. /*
  2. * malloc-free JSON parser for Arduino
  3. * Benoit Blanchon 2014
  4. * MIT License
  5. */
  6. #include "JsonObjectBase.h"
  7. int JsonObjectBase::getNestedTokenCount(int tokenIndex)
  8. {
  9. int count = 0;
  10. for (int i = 0; i < tokens[tokenIndex].size; i++)
  11. {
  12. count += 1 + getNestedTokenCount(tokenIndex + 1 + i);
  13. }
  14. return count;
  15. }