Formated code with clang-format

This commit is contained in:
Benoit Blanchon
2014-10-23 19:54:00 +02:00
parent 888fdc1d54
commit 9175046f35
52 changed files with 2002 additions and 2638 deletions

View File

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