Renamed all .h files into .hpp (so that Sublime Text selects C++ syntax)

This commit is contained in:
Benoit Blanchon
2014-10-19 15:46:36 +02:00
parent 074c39ca5b
commit 0daf82eee2
49 changed files with 91 additions and 132 deletions

View File

@@ -0,0 +1,44 @@
#pragma once
#include "JsonBuffer.hpp"
#include "JsonObject.hpp"
namespace ArduinoJson
{
template<int CAPACITY>
class StaticJsonBuffer : public JsonBuffer
{
friend class JsonObject;
public:
explicit StaticJsonBuffer()
: _size(0)
{
}
virtual ~StaticJsonBuffer() {}
int capacity()
{
return CAPACITY;
}
int size()
{
return _size;
}
protected:
virtual void* allocateNode()
{
if (_size >= CAPACITY) return 0;
return &_buffer[_size++];
}
private:
Internals::JsonNode _buffer[CAPACITY];
int _size;
};
}