forked from bblanchon/ArduinoJson
* Removed `ArduinoJson::String` * Removed `JsonVariant::defaultValue<T>()` * Removed non-template `JsonObject::get()` and `JsonArray.get()` * Fixed support for `StringSumHelper` (issue #184) * Replaced `ARDUINOJSON_USE_ARDUINO_STRING` by `ARDUINOJSON_ENABLE_STD_STRING` and `ARDUINOJSON_ENABLE_ARDUINO_STRING` (issue #378) * Added example `StringExample.ino` to show where `String` can be used
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
// Copyright Benoit Blanchon 2014-2016
|
|
// MIT License
|
|
//
|
|
// Arduino JSON library
|
|
// https://github.com/bblanchon/ArduinoJson
|
|
// If you like this project, please add a star!
|
|
|
|
#pragma once
|
|
|
|
#include "Internals/JsonParser.hpp"
|
|
|
|
inline ArduinoJson::JsonArray &ArduinoJson::JsonBuffer::createArray() {
|
|
JsonArray *ptr = new (this) JsonArray(this);
|
|
return ptr ? *ptr : JsonArray::invalid();
|
|
}
|
|
|
|
inline ArduinoJson::JsonObject &ArduinoJson::JsonBuffer::createObject() {
|
|
JsonObject *ptr = new (this) JsonObject(this);
|
|
return ptr ? *ptr : JsonObject::invalid();
|
|
}
|
|
|
|
inline ArduinoJson::JsonArray &ArduinoJson::JsonBuffer::parseArray(
|
|
char *json, uint8_t nestingLimit) {
|
|
Internals::JsonParser parser(this, json, nestingLimit);
|
|
return parser.parseArray();
|
|
}
|
|
|
|
inline ArduinoJson::JsonObject &ArduinoJson::JsonBuffer::parseObject(
|
|
char *json, uint8_t nestingLimit) {
|
|
Internals::JsonParser parser(this, json, nestingLimit);
|
|
return parser.parseObject();
|
|
}
|
|
|
|
inline ArduinoJson::JsonVariant ArduinoJson::JsonBuffer::parse(
|
|
char *json, uint8_t nestingLimit) {
|
|
Internals::JsonParser parser(this, json, nestingLimit);
|
|
return parser.parseVariant();
|
|
}
|