mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 04:22:18 +02:00
Test that adding values to the JsonObject increase the size of the buffer
This commit is contained in:
@ -4,8 +4,10 @@
|
||||
#include "JsonObject.h"
|
||||
|
||||
template<int CAPACITY>
|
||||
class StaticJsonBuffer //: public JsonBuffer
|
||||
class StaticJsonBuffer : public JsonBuffer
|
||||
{
|
||||
friend JsonObject;
|
||||
|
||||
public:
|
||||
|
||||
explicit StaticJsonBuffer()
|
||||
@ -15,14 +17,6 @@ public:
|
||||
|
||||
virtual ~StaticJsonBuffer() {}
|
||||
|
||||
JsonObject createObject()
|
||||
{
|
||||
if (_size < CAPACITY)
|
||||
_size++;
|
||||
|
||||
return JsonObject();
|
||||
}
|
||||
|
||||
int capacity()
|
||||
{
|
||||
return CAPACITY;
|
||||
@ -34,7 +28,11 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
//virtual JsonNode& allocateNode();
|
||||
virtual /*JsonNode&*/void allocateNode()
|
||||
{
|
||||
if (_size < CAPACITY)
|
||||
_size++;
|
||||
}
|
||||
|
||||
private:
|
||||
//JsonNode _buffer[CAPACITY];
|
||||
|
Reference in New Issue
Block a user