2015-02-07 16:05:48 +01:00
|
|
|
// Copyright Benoit Blanchon 2014-2015
|
2014-10-23 23:39:22 +02:00
|
|
|
// MIT License
|
|
|
|
//
|
|
|
|
// Arduino JSON library
|
|
|
|
// https://github.com/bblanchon/ArduinoJson
|
2014-10-16 16:25:42 +02:00
|
|
|
|
2014-11-03 18:35:22 +01:00
|
|
|
#include "../../include/ArduinoJson/Internals/StringBuilder.hpp"
|
2014-10-16 16:25:42 +02:00
|
|
|
|
|
|
|
using namespace ArduinoJson::Internals;
|
|
|
|
|
2014-10-23 19:54:00 +02:00
|
|
|
size_t StringBuilder::write(uint8_t c) {
|
2014-10-23 23:13:13 +02:00
|
|
|
if (length >= capacity) return 0;
|
2014-10-16 16:25:42 +02:00
|
|
|
|
2014-10-23 19:54:00 +02:00
|
|
|
buffer[length++] = c;
|
2014-11-03 17:03:55 +01:00
|
|
|
buffer[length] = '\0';
|
2014-10-23 19:54:00 +02:00
|
|
|
return 1;
|
2014-10-23 23:45:36 +02:00
|
|
|
}
|