2014-01-11 15:05:35 +01:00
|
|
|
/*
|
|
|
|
* malloc-free JSON parser for Arduino
|
|
|
|
* Benoit Blanchon 2014
|
|
|
|
* MIT License
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "JsonObjectBase.h"
|
|
|
|
|
2014-01-11 15:23:08 +01:00
|
|
|
int JsonObjectBase::getNestedTokenCount(int tokenIndex)
|
2014-01-11 15:05:35 +01:00
|
|
|
{
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < tokens[tokenIndex].size; i++)
|
|
|
|
{
|
2014-01-11 15:23:08 +01:00
|
|
|
count += 1 + getNestedTokenCount(tokenIndex + 1 + i);
|
2014-01-11 15:05:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|