Sfoglia il codice sorgente

Renamed IndentedPrintDecorator to PrettyPrintDecorator

Benoit Blanchon 11 anni fa
parent
commit
2ddf8f1619

+ 1 - 1
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"

+ 2 - 2
JsonGenerator/JsonGenerator.vcxproj

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

+ 2 - 2
JsonGenerator/JsonGenerator.vcxproj.filters

@@ -45,7 +45,7 @@
     <ClInclude Include="JsonObject.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="IndentedPrintDecorator.h">
+    <ClInclude Include="PrettyPrintDecorator.h">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>
@@ -68,7 +68,7 @@
     <ClCompile Include="JsonObjectBase.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="IndentedPrintDecorator.cpp">
+    <ClCompile Include="PrettyPrintDecorator.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>

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

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

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

+ 3 - 3
JsonGeneratorTests/JsonGeneratorTests.vcxproj

@@ -85,9 +85,9 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="EscapedStringTests.cpp" />
-    <ClCompile Include="Intented_Array_Tests.cpp" />
-    <ClCompile Include="Intented_Object_Tests.cpp" />
-    <ClCompile Include="Intented_String_Tests.cpp" />
+    <ClCompile Include="PrettyPrint_Array_Tests.cpp" />
+    <ClCompile Include="PrettyPrint_Object_Tests.cpp" />
+    <ClCompile Include="PrettyPrint_String_Tests.cpp" />
     <ClCompile Include="Issue10.cpp" />
     <ClCompile Include="JsonArrayTests.cpp" />
     <ClCompile Include="JsonObject_Indexer_Tests.cpp" />

+ 3 - 3
JsonGeneratorTests/JsonGeneratorTests.vcxproj.filters

@@ -39,13 +39,13 @@
     <ClCompile Include="Issue10.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Intented_Array_Tests.cpp">
+    <ClCompile Include="PrettyPrint_Array_Tests.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Intented_Object_Tests.cpp">
+    <ClCompile Include="PrettyPrint_Object_Tests.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Intented_String_Tests.cpp">
+    <ClCompile Include="PrettyPrint_String_Tests.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>

+ 3 - 3
JsonGeneratorTests/Intented_Array_Tests.cpp → 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);
         }

+ 3 - 3
JsonGeneratorTests/Intented_Object_Tests.cpp → 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);
         }

+ 3 - 3
JsonGeneratorTests/Intented_String_Tests.cpp → 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);
         }