Refactored to use StringBuilder

This commit is contained in:
Benoit Blanchon
2014-09-30 16:40:00 +02:00
parent ab2587f089
commit 6b2705769a
9 changed files with 156 additions and 6 deletions

17
srcs/StringBuilder.cpp Normal file
View File

@ -0,0 +1,17 @@
/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/
#include "StringBuilder.h"
using namespace ArduinoJson::Internals;
size_t StringBuilder::write(uint8_t c)
{
if (length >= capacity) return 0;
buffer[length++] = c;
buffer[length] = 0;
return 1;
}