Clear the JsonObject or JsonArray in deserializeJson()

This commit is contained in:
Benoit Blanchon
2018-03-18 14:50:52 +01:00
parent cf149940ed
commit 0d1623edef
15 changed files with 126 additions and 9 deletions

View File

@@ -15,6 +15,7 @@ typename Internals::EnableIf<!Internals::IsArray<TString>::value,
JsonError>::type
deserializeJson(TDestination &destination, const TString &json,
uint8_t nestingLimit = ARDUINOJSON_DEFAULT_NESTING_LIMIT) {
destination.clear();
return Internals::makeParser(&destination.buffer(), json, nestingLimit)
.parse(destination);
}
@@ -26,6 +27,7 @@ template <typename TDestination, typename TString>
JsonError deserializeJson(
TDestination &destination, TString *json,
uint8_t nestingLimit = ARDUINOJSON_DEFAULT_NESTING_LIMIT) {
destination.clear();
return Internals::makeParser(&destination.buffer(), json, nestingLimit)
.parse(destination);
}
@@ -37,6 +39,7 @@ template <typename TDestination, typename TString>
JsonError deserializeJson(
TDestination &destination, TString &json,
uint8_t nestingLimit = ARDUINOJSON_DEFAULT_NESTING_LIMIT) {
destination.clear();
return Internals::makeParser(&destination.buffer(), json, nestingLimit)
.parse(destination);
}