mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 12:32:17 +02:00
Extracted class JsonHashTableBase to reduce the size of the code.
This commit is contained in:
26
JsonGenerator/JsonHashTableBase.cpp
Normal file
26
JsonGenerator/JsonHashTableBase.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include "JsonHashTable.h"
|
||||
|
||||
using namespace ArduinoJson::Generator;
|
||||
|
||||
size_t JsonHashTableBase::printTo(Print& p) const
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
n += p.write('{');
|
||||
|
||||
for (int i = 0; i < itemCount; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
n += p.write(',');
|
||||
}
|
||||
|
||||
n += items[i].key.printTo(p);
|
||||
n += p.write(':');
|
||||
n += items[i].value.printTo(p);
|
||||
}
|
||||
|
||||
n += p.write('}');
|
||||
|
||||
return n;
|
||||
}
|
Reference in New Issue
Block a user