2014-10-23 23:39:22 +02:00
|
|
|
// Copyright Benoit Blanchon 2014
|
|
|
|
// MIT License
|
|
|
|
//
|
|
|
|
// Arduino JSON library
|
|
|
|
// https://github.com/bblanchon/ArduinoJson
|
|
|
|
|
2014-10-19 15:46:36 +02:00
|
|
|
#include "ArduinoJson/JsonBuffer.hpp"
|
2014-10-16 16:25:42 +02:00
|
|
|
|
2014-10-27 22:50:50 +01:00
|
|
|
#include "ArduinoJson/JsonArray.hpp"
|
|
|
|
#include "ArduinoJson/Internals/JsonArrayImpl.hpp"
|
|
|
|
#include "ArduinoJson/JsonObject.hpp"
|
|
|
|
#include "ArduinoJson/Internals/JsonObjectImpl.hpp"
|
|
|
|
#include "ArduinoJson/JsonValue.hpp"
|
|
|
|
#include "ArduinoJson/Internals/JsonValueImpl.hpp"
|
2014-10-19 15:46:36 +02:00
|
|
|
#include "ArduinoJson/Internals/JsonParser.hpp"
|
2014-10-16 16:25:42 +02:00
|
|
|
|
2014-10-18 23:05:54 +02:00
|
|
|
using namespace ArduinoJson;
|
|
|
|
using namespace ArduinoJson::Internals;
|
|
|
|
|
2014-10-27 22:50:50 +01:00
|
|
|
JsonArray JsonBuffer::createArray() {
|
2014-10-28 16:29:55 +01:00
|
|
|
return JsonArray(JsonArrayImpl::createFrom(this));
|
2014-10-27 22:50:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
JsonObject JsonBuffer::createObject() {
|
2014-10-28 16:29:55 +01:00
|
|
|
return JsonObject(JsonObjectImpl::createFrom(this));
|
2014-10-27 22:50:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
JsonValue JsonBuffer::createValue() {
|
2014-10-28 16:29:55 +01:00
|
|
|
return JsonValue(JsonValueImpl::createFrom(this));
|
2014-10-27 22:50:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
JsonArray JsonBuffer::parseArray(char* json) {
|
|
|
|
JsonParser parser(this, json);
|
|
|
|
return JsonArray(parser.parseArray());
|
|
|
|
}
|
|
|
|
|
|
|
|
JsonObject JsonBuffer::parseObject(char* json) {
|
|
|
|
JsonParser parser(this, json);
|
|
|
|
return JsonObject(parser.parseObject());
|
|
|
|
}
|
|
|
|
|
|
|
|
JsonValue JsonBuffer::parseValue(char* json) {
|
|
|
|
JsonParser parser(this, json);
|
|
|
|
return JsonValue(parser.parseValue());
|
|
|
|
}
|