diff --git a/JsonGenerator.cpp b/JsonGenerator.cpp index 9aaffce1..2be2b76c 100644 --- a/JsonGenerator.cpp +++ b/JsonGenerator.cpp @@ -6,8 +6,8 @@ // This file is here to help the Arduino IDE find the .cpp files #include "JsonGenerator/EscapedString.cpp" -#include "JsonGenerator/IndentedPrintDecorator.cpp" #include "JsonGenerator/JsonArrayBase.cpp" #include "JsonGenerator/JsonObjectBase.cpp" #include "JsonGenerator/JsonValue.cpp" +#include "JsonGenerator/PrettyPrintDecorator.cpp" #include "JsonGenerator/StringBuilder.cpp" \ No newline at end of file diff --git a/JsonGenerator/JsonGenerator.vcxproj b/JsonGenerator/JsonGenerator.vcxproj index e1f161af..e934aa93 100644 --- a/JsonGenerator/JsonGenerator.vcxproj +++ b/JsonGenerator/JsonGenerator.vcxproj @@ -12,7 +12,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/JsonGenerator/JsonGenerator.vcxproj.filters b/JsonGenerator/JsonGenerator.vcxproj.filters index e6e350a9..c01fc7a3 100644 --- a/JsonGenerator/JsonGenerator.vcxproj.filters +++ b/JsonGenerator/JsonGenerator.vcxproj.filters @@ -45,7 +45,7 @@ Header Files - + Header Files @@ -68,7 +68,7 @@ Source Files - + Source Files diff --git a/JsonGenerator/JsonPrintable.h b/JsonGenerator/JsonPrintable.h index 8d2b7bb0..3d8dfc9e 100644 --- a/JsonGenerator/JsonPrintable.h +++ b/JsonGenerator/JsonPrintable.h @@ -8,7 +8,7 @@ #include "JsonValue.h" #include "Print.h" #include "Printable.h" -#include "IndentedPrintDecorator.h" +#include "PrettyPrintDecorator.h" namespace ArduinoJson { @@ -28,7 +28,7 @@ namespace ArduinoJson size_t prettyPrintTo(Print& p) const { - IndentedPrintDecorator decorator(p); + PrettyPrintDecorator decorator(p); return printTo(decorator); } diff --git a/JsonGenerator/IndentedPrintDecorator.cpp b/JsonGenerator/PrettyPrintDecorator.cpp similarity index 88% rename from JsonGenerator/IndentedPrintDecorator.cpp rename to JsonGenerator/PrettyPrintDecorator.cpp index 12aaa398..41e6ac1e 100644 --- a/JsonGenerator/IndentedPrintDecorator.cpp +++ b/JsonGenerator/PrettyPrintDecorator.cpp @@ -3,9 +3,9 @@ * Benoit Blanchon 2014 - MIT License */ -#include "IndentedPrintDecorator.h" +#include "PrettyPrintDecorator.h" -size_t IndentedPrintDecorator::write(uint8_t c) +size_t PrettyPrintDecorator::write(uint8_t c) { switch (c) { @@ -85,7 +85,7 @@ size_t IndentedPrintDecorator::write(uint8_t c) } } -size_t IndentedPrintDecorator::writeln() +size_t PrettyPrintDecorator::writeln() { size_t n = sink.write('\n'); diff --git a/JsonGenerator/IndentedPrintDecorator.h b/JsonGenerator/PrettyPrintDecorator.h similarity index 77% rename from JsonGenerator/IndentedPrintDecorator.h rename to JsonGenerator/PrettyPrintDecorator.h index ee03faf0..7170af3f 100644 --- a/JsonGenerator/IndentedPrintDecorator.h +++ b/JsonGenerator/PrettyPrintDecorator.h @@ -8,11 +8,11 @@ #include "Print.h" -class IndentedPrintDecorator : public Print +class PrettyPrintDecorator : public Print { public: - IndentedPrintDecorator(Print& p) + PrettyPrintDecorator(Print& p) : indent(0), sink(p) { previousChar = 0; diff --git a/JsonGeneratorTests/JsonGeneratorTests.vcxproj b/JsonGeneratorTests/JsonGeneratorTests.vcxproj index e9456dc5..1b31c03b 100644 --- a/JsonGeneratorTests/JsonGeneratorTests.vcxproj +++ b/JsonGeneratorTests/JsonGeneratorTests.vcxproj @@ -85,9 +85,9 @@ - - - + + + diff --git a/JsonGeneratorTests/JsonGeneratorTests.vcxproj.filters b/JsonGeneratorTests/JsonGeneratorTests.vcxproj.filters index b6cd652c..8028fec2 100644 --- a/JsonGeneratorTests/JsonGeneratorTests.vcxproj.filters +++ b/JsonGeneratorTests/JsonGeneratorTests.vcxproj.filters @@ -39,13 +39,13 @@ Source Files - + Source Files - + Source Files - + Source Files diff --git a/JsonGeneratorTests/Intented_Array_Tests.cpp b/JsonGeneratorTests/PrettyPrint_Array_Tests.cpp similarity index 89% rename from JsonGeneratorTests/Intented_Array_Tests.cpp rename to JsonGeneratorTests/PrettyPrint_Array_Tests.cpp index 6d493831..b7b3bb82 100644 --- a/JsonGeneratorTests/Intented_Array_Tests.cpp +++ b/JsonGeneratorTests/PrettyPrint_Array_Tests.cpp @@ -4,7 +4,7 @@ */ #include "CppUnitTest.h" -#include "IndentedPrintDecorator.h" +#include "PrettyPrintDecorator.h" #include "StringBuilder.h" using namespace ArduinoJson::Internals; @@ -12,7 +12,7 @@ using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace JsonGeneratorTests { - TEST_CLASS(Indented_Array_Tests) + TEST_CLASS(PrettyPrint_Array_Tests) { char buffer[1024]; size_t returnValue; @@ -75,7 +75,7 @@ namespace JsonGeneratorTests void whenInputIs(const char input[]) { StringBuilder sb(buffer, sizeof(buffer)); - IndentedPrintDecorator decorator(sb); + PrettyPrintDecorator decorator(sb); returnValue = decorator.print(input); } diff --git a/JsonGeneratorTests/Intented_Object_Tests.cpp b/JsonGeneratorTests/PrettyPrint_Object_Tests.cpp similarity index 90% rename from JsonGeneratorTests/Intented_Object_Tests.cpp rename to JsonGeneratorTests/PrettyPrint_Object_Tests.cpp index a1ce73f7..d8b8088e 100644 --- a/JsonGeneratorTests/Intented_Object_Tests.cpp +++ b/JsonGeneratorTests/PrettyPrint_Object_Tests.cpp @@ -4,7 +4,7 @@ */ #include "CppUnitTest.h" -#include "IndentedPrintDecorator.h" +#include "PrettyPrintDecorator.h" #include "StringBuilder.h" using namespace ArduinoJson::Internals; @@ -12,7 +12,7 @@ using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace JsonGeneratorTests { - TEST_CLASS(Indented_Object_Tests) + TEST_CLASS(PrettyPrint_Object_Tests) { char buffer[1024]; size_t returnValue; @@ -73,7 +73,7 @@ namespace JsonGeneratorTests void whenInputIs(const char input[]) { StringBuilder sb(buffer, sizeof(buffer)); - IndentedPrintDecorator decorator(sb); + PrettyPrintDecorator decorator(sb); returnValue = decorator.print(input); } diff --git a/JsonGeneratorTests/Intented_String_Tests.cpp b/JsonGeneratorTests/PrettyPrint_String_Tests.cpp similarity index 85% rename from JsonGeneratorTests/Intented_String_Tests.cpp rename to JsonGeneratorTests/PrettyPrint_String_Tests.cpp index 5d7c2452..4a046e79 100644 --- a/JsonGeneratorTests/Intented_String_Tests.cpp +++ b/JsonGeneratorTests/PrettyPrint_String_Tests.cpp @@ -4,7 +4,7 @@ */ #include "CppUnitTest.h" -#include "IndentedPrintDecorator.h" +#include "PrettyPrintDecorator.h" #include "StringBuilder.h" using namespace ArduinoJson::Internals; @@ -12,7 +12,7 @@ using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace JsonGeneratorTests { - TEST_CLASS(Intented_String_Tests) + TEST_CLASS(PrettyPrint_String_Tests) { char buffer[1024]; size_t returnValue; @@ -36,7 +36,7 @@ namespace JsonGeneratorTests void whenInputIs(const char input[]) { StringBuilder sb(buffer, sizeof(buffer)); - IndentedPrintDecorator decorator(sb); + PrettyPrintDecorator decorator(sb); returnValue = decorator.print(input); }