Files
ArduinoJson/JsonParser/JsonToken.cpp
Benoit Blanchon 649f292ea7 Added comments
2014-07-22 20:28:59 +02:00

27 lines
515 B
C++

/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/
#include "JsonToken.h"
using namespace ArduinoJson::Parser;
JsonToken JsonToken::nextSibling() const
{
// start with current token
jsmntok_t* t = token;
// count the number of token to skip
int yetToVisit = 1;
// skip all nested tokens
while (yetToVisit)
{
yetToVisit += t->size - 1;
t++;
}
// build a JsonToken at the new location
return JsonToken(json, t);
}