ArduinoJson 5.8.0 * Added operator `==` to compare `JsonVariant` and strings (issue #402) * Added support for `Stream` (issue #300) * Reduced memory consumption by not duplicating spaces and comments
Changes since 5.7.3
- Added operator
==
to compareJsonVariant
and strings (issue #402) - Added support for
Stream
(issue #300) - Reduced memory consumption by not duplicating spaces and comments
Breaking changes
JsonBuffer::parseObject()
and JsonBuffer::parseArray()
have been pulled down to the derived classes DynamicJsonBuffer
and StaticJsonBufferBase
.
This means that if you have code like:
void myFunction(JsonBuffer& jsonBuffer);
you need to replace it by one of the following:
void myFunction(DynamicJsonBuffer& jsonBuffer);
void myFunction(StaticJsonBufferBase& jsonBuffer);
template<typename TJsonBuffer> void myFunction(TJsonBuffer& jsonBuffer);
Stream
feature?
How to use the new If you have something like:
char json[256];
size_t n= stream.readBytes(json, sizeof(json));
json[n] = 0;
JsonObject& root = jsonBuffer.parseObject(json);
then you can replace by:
JsonObject& root = jsonBuffer.parseObject(stream);
but don't forget to increase the size of the JsonBuffer
because it now has to hold a copy of the input.