From dd5cf661e36de066c1c4bad0aeeb539b8c2b7516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Blanchon?= Date: Thu, 3 Jul 2014 12:55:53 +0200 Subject: [PATCH] Moved Print::write() implementation into Print.cpp --- JsonGenerator/Print.h | 10 +--------- JsonGeneratorTests/JsonGeneratorTests.vcxproj | 1 + .../JsonGeneratorTests.vcxproj.filters | 3 +++ JsonGeneratorTests/Print.cpp | 16 ++++++++++++++++ 4 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 JsonGeneratorTests/Print.cpp diff --git a/JsonGenerator/Print.h b/JsonGenerator/Print.h index 77dd0664..84368c0c 100644 --- a/JsonGenerator/Print.h +++ b/JsonGenerator/Print.h @@ -15,15 +15,7 @@ public: virtual size_t write(uint8_t c) = 0; - size_t write(const char* s) - { - size_t n = 0; - while (*s) - { - n += write(*s++); - } - return n; - } + size_t write(const char* s); }; #else diff --git a/JsonGeneratorTests/JsonGeneratorTests.vcxproj b/JsonGeneratorTests/JsonGeneratorTests.vcxproj index 4f7fb9b4..fb4d2a4e 100644 --- a/JsonGeneratorTests/JsonGeneratorTests.vcxproj +++ b/JsonGeneratorTests/JsonGeneratorTests.vcxproj @@ -89,6 +89,7 @@ + diff --git a/JsonGeneratorTests/JsonGeneratorTests.vcxproj.filters b/JsonGeneratorTests/JsonGeneratorTests.vcxproj.filters index 22f563b7..128d8b3e 100644 --- a/JsonGeneratorTests/JsonGeneratorTests.vcxproj.filters +++ b/JsonGeneratorTests/JsonGeneratorTests.vcxproj.filters @@ -33,6 +33,9 @@ Source Files + + Source Files + diff --git a/JsonGeneratorTests/Print.cpp b/JsonGeneratorTests/Print.cpp new file mode 100644 index 00000000..d1d40b60 --- /dev/null +++ b/JsonGeneratorTests/Print.cpp @@ -0,0 +1,16 @@ +/* + * Arduino JSON library + * Benoit Blanchon 2014 - MIT License + */ + +#include "Print.h" + +size_t Print::write(const char* s) +{ + size_t n = 0; + while (*s) + { + n += write(*s++); + } + return n; +} \ No newline at end of file