diff --git a/JsonGenerator/IndentedPrintDecorator.cpp b/JsonGenerator/IndentedPrint.cpp similarity index 57% rename from JsonGenerator/IndentedPrintDecorator.cpp rename to JsonGenerator/IndentedPrint.cpp index 7d30e0ca..700d5f92 100644 --- a/JsonGenerator/IndentedPrintDecorator.cpp +++ b/JsonGenerator/IndentedPrint.cpp @@ -1,18 +1,18 @@ -#include "IndentedPrintDecorator.h" +#include "IndentedPrint.h" -void IndentedPrintDecorator::indent() +void IndentedPrint::indent() { if (level<127) level++; } -void IndentedPrintDecorator::unindent() +void IndentedPrint::unindent() { if (level>0) level--; } -size_t IndentedPrintDecorator::write(uint8_t c) +size_t IndentedPrint::write(uint8_t c) { size_t n = 0; @@ -26,7 +26,7 @@ size_t IndentedPrintDecorator::write(uint8_t c) return n; } -size_t IndentedPrintDecorator::writeTabs() +size_t IndentedPrint::writeTabs() { size_t n = 0; diff --git a/JsonGenerator/IndentedPrintDecorator.h b/JsonGenerator/IndentedPrint.h similarity index 76% rename from JsonGenerator/IndentedPrintDecorator.h rename to JsonGenerator/IndentedPrint.h index 98000b25..79ab43b9 100644 --- a/JsonGenerator/IndentedPrintDecorator.h +++ b/JsonGenerator/IndentedPrint.h @@ -7,11 +7,11 @@ #include "Print.h" -class IndentedPrintDecorator : public Print +class IndentedPrint : public Print { public: - IndentedPrintDecorator(Print& p) + IndentedPrint(Print& p) : sink(p) { level = 0; diff --git a/JsonGenerator/JsonGenerator.vcxproj b/JsonGenerator/JsonGenerator.vcxproj index 54fe2bef..f51ddb92 100644 --- a/JsonGenerator/JsonGenerator.vcxproj +++ b/JsonGenerator/JsonGenerator.vcxproj @@ -12,7 +12,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/JsonGenerator/JsonGenerator.vcxproj.filters b/JsonGenerator/JsonGenerator.vcxproj.filters index e7639326..fe8df2dd 100644 --- a/JsonGenerator/JsonGenerator.vcxproj.filters +++ b/JsonGenerator/JsonGenerator.vcxproj.filters @@ -48,7 +48,7 @@ Header Files - + Header Files @@ -74,7 +74,7 @@ Source Files - + Source Files diff --git a/JsonGenerator/JsonPrintable.h b/JsonGenerator/JsonPrintable.h index b2f1a47b..10e58c49 100644 --- a/JsonGenerator/JsonPrintable.h +++ b/JsonGenerator/JsonPrintable.h @@ -26,7 +26,7 @@ namespace ArduinoJson return printTo(sb); } - size_t prettyPrintTo(IndentedPrintDecorator& p) const + size_t prettyPrintTo(IndentedPrint& p) const { PrettyPrintDecorator decorator(p); return printTo(decorator); @@ -34,7 +34,7 @@ namespace ArduinoJson size_t prettyPrintTo(Print& p) const { - IndentedPrintDecorator decorator(p); + IndentedPrint decorator(p); return printTo(decorator); } diff --git a/JsonGenerator/PrettyPrintDecorator.h b/JsonGenerator/PrettyPrintDecorator.h index 99df3035..b28018eb 100644 --- a/JsonGenerator/PrettyPrintDecorator.h +++ b/JsonGenerator/PrettyPrintDecorator.h @@ -6,7 +6,7 @@ #pragma once #include "Print.h" -#include "IndentedPrintDecorator.h" +#include "IndentedPrint.h" namespace ArduinoJson { @@ -16,7 +16,7 @@ namespace ArduinoJson { public: - PrettyPrintDecorator(IndentedPrintDecorator& p) + PrettyPrintDecorator(IndentedPrint& p) : sink(p) { previousChar = 0; @@ -27,7 +27,7 @@ namespace ArduinoJson private: uint8_t previousChar; - IndentedPrintDecorator& sink; + IndentedPrint& sink; bool inString; bool inEmptyBlock() diff --git a/JsonGeneratorTests/PrettyPrint_Array_Tests.cpp b/JsonGeneratorTests/PrettyPrint_Array_Tests.cpp index b8d558bd..549733dd 100644 --- a/JsonGeneratorTests/PrettyPrint_Array_Tests.cpp +++ b/JsonGeneratorTests/PrettyPrint_Array_Tests.cpp @@ -76,7 +76,7 @@ namespace JsonGeneratorTests void whenInputIs(const char input[]) { StringBuilder sb(buffer, sizeof(buffer)); - IndentedPrintDecorator indentedPrint(sb); + IndentedPrint indentedPrint(sb); PrettyPrintDecorator decorator(indentedPrint); returnValue = decorator.print(input); diff --git a/JsonGeneratorTests/PrettyPrint_Object_Tests.cpp b/JsonGeneratorTests/PrettyPrint_Object_Tests.cpp index 8986143b..d0a693c4 100644 --- a/JsonGeneratorTests/PrettyPrint_Object_Tests.cpp +++ b/JsonGeneratorTests/PrettyPrint_Object_Tests.cpp @@ -74,7 +74,7 @@ namespace JsonGeneratorTests void whenInputIs(const char input[]) { StringBuilder sb(buffer, sizeof(buffer)); - IndentedPrintDecorator indentedPrint(sb); + IndentedPrint indentedPrint(sb); PrettyPrintDecorator decorator(indentedPrint); returnValue = decorator.print(input); diff --git a/JsonGeneratorTests/PrettyPrint_String_Tests.cpp b/JsonGeneratorTests/PrettyPrint_String_Tests.cpp index 6ce4a166..70b02dab 100644 --- a/JsonGeneratorTests/PrettyPrint_String_Tests.cpp +++ b/JsonGeneratorTests/PrettyPrint_String_Tests.cpp @@ -61,7 +61,7 @@ namespace JsonGeneratorTests void whenInputIs(const char input[]) { StringBuilder sb(buffer, sizeof(buffer)); - IndentedPrintDecorator indentedPrint(sb); + IndentedPrint indentedPrint(sb); PrettyPrintDecorator decorator(indentedPrint); returnValue = decorator.print(input);