Epic refactoring in progress...

This commit is contained in:
Benoit Blanchon
2014-10-28 16:29:55 +01:00
parent 852256c1af
commit 61218f12fd
13 changed files with 63 additions and 32 deletions

View File

@ -17,21 +17,16 @@
using namespace ArduinoJson;
using namespace ArduinoJson::Internals;
// TODO: what happens if alloc returns NULL
void* operator new(size_t size, ArduinoJson::JsonBuffer* buffer) {
return buffer->alloc(size);
}
JsonArray JsonBuffer::createArray() {
return JsonArray(new (this) JsonArrayImpl(this));
return JsonArray(JsonArrayImpl::createFrom(this));
}
JsonObject JsonBuffer::createObject() {
return JsonObject(new (this) JsonObjectImpl(this));
return JsonObject(JsonObjectImpl::createFrom(this));
}
JsonValue JsonBuffer::createValue() {
return JsonValue(new (this) JsonValueImpl());
return JsonValue(JsonValueImpl::createFrom(this));
}
JsonArray JsonBuffer::parseArray(char* json) {