mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-13 18:46:35 +02:00
27 lines
419 B
C++
27 lines
419 B
C++
/*
|
|
* Arduino JSON library
|
|
* Benoit Blanchon 2014 - MIT License
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "../Arduino/Print.hpp"
|
|
|
|
namespace ArduinoJson {
|
|
namespace Internals {
|
|
class StringBuilder : public Print {
|
|
public:
|
|
StringBuilder(char *buf, int size)
|
|
: buffer(buf), capacity(size - 1), length(0) {
|
|
buffer[0] = 0;
|
|
}
|
|
|
|
virtual size_t write(uint8_t c);
|
|
|
|
private:
|
|
char *buffer;
|
|
int capacity;
|
|
int length;
|
|
};
|
|
}
|
|
} |