Files
ArduinoJson/JsonGenerator/IndentedPrint.h

40 lines
672 B
C
Raw Normal View History

/*
* Arduino JSON library
* Benoit Blanchon 2014 - MIT License
*/
#pragma once
#include "Print.h"
namespace ArduinoJson
{
namespace Generator
{
class IndentedPrint : public Print
{
public:
IndentedPrint(Print& p)
: sink(p)
{
level = 0;
isNewLine = true;
}
virtual size_t write(uint8_t);
2014-08-26 09:53:32 +02:00
void indent();
void unindent();
private:
Print& sink;
uint8_t level : 7;
bool isNewLine : 1;
size_t writeTabs();
};
}
}