2014-07-08 13:27:29 +02:00
|
|
|
#include "JsonHashTable.h"
|
|
|
|
|
|
|
|
using namespace ArduinoJson::Generator;
|
|
|
|
|
|
|
|
size_t JsonHashTableBase::printTo(Print& p) const
|
|
|
|
{
|
|
|
|
size_t n = 0;
|
|
|
|
|
|
|
|
n += p.write('{');
|
|
|
|
|
2014-07-08 13:46:34 +02:00
|
|
|
KeyValuePair* current = items;
|
2014-07-08 13:38:37 +02:00
|
|
|
for (int i = 0; i < count; i++)
|
2014-07-08 13:27:29 +02:00
|
|
|
{
|
|
|
|
if (i > 0)
|
|
|
|
{
|
|
|
|
n += p.write(',');
|
|
|
|
}
|
|
|
|
|
2014-07-08 13:46:34 +02:00
|
|
|
n += current->key.printTo(p);
|
2014-07-08 13:27:29 +02:00
|
|
|
n += p.write(':');
|
2014-07-08 13:46:34 +02:00
|
|
|
n += current->value.printTo(p);
|
|
|
|
|
|
|
|
current++;
|
2014-07-08 13:27:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
n += p.write('}');
|
|
|
|
|
|
|
|
return n;
|
|
|
|
}
|