Renamed IndentedPrintDecorator into IndentedPrint

This commit is contained in:
Benoit Blanchon
2014-08-26 09:56:05 +02:00
parent b5002265cf
commit 23e61cc0f7
9 changed files with 19 additions and 19 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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" />

View File

@ -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>

View File

@ -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);
}

View File

@ -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()

View File

@ -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);

View File

@ -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);

View File

@ -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);