2014-06-25 13:02:39 +02:00
|
|
|
/*
|
|
|
|
* Arduino JSON library
|
|
|
|
* Benoit Blanchon 2014 - MIT License
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-07-01 13:36:22 +02:00
|
|
|
#include "Print.h"
|
2014-06-30 19:19:39 +02:00
|
|
|
|
2014-07-03 13:54:27 +02:00
|
|
|
namespace ArduinoJson
|
2014-06-25 13:02:39 +02:00
|
|
|
{
|
2014-07-07 14:05:41 +02:00
|
|
|
namespace Internals
|
2014-06-25 13:02:39 +02:00
|
|
|
{
|
2014-07-03 13:54:27 +02:00
|
|
|
class StringBuilder : public Print
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StringBuilder(char* buf, int size)
|
|
|
|
: buffer(buf), capacity(size - 1), length(0)
|
|
|
|
{
|
|
|
|
buffer[0] = 0;
|
|
|
|
}
|
2014-06-25 13:02:39 +02:00
|
|
|
|
2014-07-03 13:54:27 +02:00
|
|
|
virtual size_t write(uint8_t c);
|
2014-06-25 13:02:39 +02:00
|
|
|
|
2014-07-03 13:54:27 +02:00
|
|
|
private:
|
|
|
|
char* buffer;
|
|
|
|
int capacity;
|
|
|
|
int length;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|