mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-17 20:42:24 +02:00
28 lines
443 B
C++
28 lines
443 B
C++
/*
|
|
* Arduino JSON library
|
|
* Benoit Blanchon 2014 - MIT License
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "JsonSink.h"
|
|
|
|
class StringBuilder : public JsonSink
|
|
{
|
|
public:
|
|
StringBuilder(char* buf, int size)
|
|
: buffer(buf), capacity(size-1), length(0)
|
|
{
|
|
buffer[0] = 0;
|
|
}
|
|
|
|
virtual size_t append(char c);
|
|
size_t append(const char* c);
|
|
|
|
private:
|
|
char* buffer;
|
|
int capacity;
|
|
int length;
|
|
};
|
|
|