2014-06-26 12:50:48 +02:00
|
|
|
/*
|
|
|
|
* Arduino JSON library
|
|
|
|
* Benoit Blanchon 2014 - MIT License
|
|
|
|
*/
|
|
|
|
|
2014-06-25 13:02:39 +02:00
|
|
|
#include "StringBuilder.h"
|
|
|
|
|
2014-07-07 14:05:41 +02:00
|
|
|
using namespace ArduinoJson::Internals;
|
2014-07-03 13:54:27 +02:00
|
|
|
|
2014-07-01 14:08:15 +02:00
|
|
|
size_t StringBuilder::write(uint8_t c)
|
2014-06-25 13:02:39 +02:00
|
|
|
{
|
2014-07-01 13:15:50 +02:00
|
|
|
if (length >= capacity) return 0;
|
2014-06-25 13:47:28 +02:00
|
|
|
|
2014-06-30 19:19:39 +02:00
|
|
|
buffer[length++] = c;
|
2014-06-25 13:55:18 +02:00
|
|
|
buffer[length] = 0;
|
2014-07-01 13:15:50 +02:00
|
|
|
return 1;
|
2014-06-25 13:02:39 +02:00
|
|
|
}
|