Просмотр исходного кода

Renamed IndentedPrintDecorator into IndentedPrint

Benoit Blanchon 11 лет назад
Родитель
Сommit
23e61cc0f7

+ 5 - 5
JsonGenerator/IndentedPrintDecorator.cpp → 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;
 

+ 2 - 2
JsonGenerator/IndentedPrintDecorator.h → 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;

+ 2 - 2
JsonGenerator/JsonGenerator.vcxproj

@@ -12,7 +12,7 @@
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="EscapedString.h" />
-    <ClInclude Include="IndentedPrintDecorator.h" />
+    <ClInclude Include="IndentedPrint.h" />
     <ClInclude Include="PrettyPrintDecorator.h" />
     <ClInclude Include="JsonArray.h" />
     <ClInclude Include="JsonArrayBase.h" />
@@ -26,7 +26,7 @@
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="EscapedString.cpp" />
-    <ClCompile Include="IndentedPrintDecorator.cpp" />
+    <ClCompile Include="IndentedPrint.cpp" />
     <ClCompile Include="PrettyPrintDecorator.cpp" />
     <ClCompile Include="JsonArrayBase.cpp" />
     <ClCompile Include="JsonObjectBase.cpp" />

+ 2 - 2
JsonGenerator/JsonGenerator.vcxproj.filters

@@ -48,7 +48,7 @@
     <ClInclude Include="PrettyPrintDecorator.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="IndentedPrintDecorator.h">
+    <ClInclude Include="IndentedPrint.h">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>
@@ -74,7 +74,7 @@
     <ClCompile Include="PrettyPrintDecorator.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="IndentedPrintDecorator.cpp">
+    <ClCompile Include="IndentedPrint.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>

+ 2 - 2
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);
             }
 

+ 3 - 3
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()

+ 1 - 1
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);

+ 1 - 1
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);

+ 1 - 1
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);