Moved IndentedPrint into the namespace ArduinoJson::Generator

This commit is contained in:
Benoit Blanchon
2014-08-26 10:16:13 +02:00
parent f127ef6019
commit aa2cd0db00
2 changed files with 28 additions and 20 deletions

View File

@ -1,5 +1,7 @@
#include "IndentedPrint.h" #include "IndentedPrint.h"
using namespace ArduinoJson::Generator;
void IndentedPrint::indent() void IndentedPrint::indent()
{ {
if (level<127) if (level<127)

View File

@ -7,27 +7,33 @@
#include "Print.h" #include "Print.h"
class IndentedPrint : public Print namespace ArduinoJson
{ {
public: namespace Generator
IndentedPrint(Print& p)
: sink(p)
{ {
level = 0; class IndentedPrint : public Print
isNewLine = true; {
public:
IndentedPrint(Print& p)
: sink(p)
{
level = 0;
isNewLine = true;
}
virtual size_t write(uint8_t);
void indent();
void unindent();
private:
Print& sink;
uint8_t level : 7;
bool isNewLine : 1;
size_t writeTabs();
};
} }
}
virtual size_t write(uint8_t);
void indent();
void unindent();
private:
Print& sink;
uint8_t level : 7;
bool isNewLine : 1;
size_t writeTabs();
};